vendor: 4,556 bytes, lines 1-25
1 2/* /web/static/lib/luxon/luxon.js */ 3var luxon=(function(exports){'use strict';function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}} 4function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;} 5function _extends(){_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}} 6return target;};return _extends.apply(this,arguments);} 7function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;_setPrototypeOf(subClass,superClass);} 8function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);} 9function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);} 10function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}} 11function _construct(Parent,args,Class){if(_isNativeReflectConstruct()){_construct=Reflect.construct.bind();}else{_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)_setPrototypeOf(instance,Class.prototype);return instance;};} 12return _construct.apply(null,arguments);} 13function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;} 14function _wrapNativeSuper(Class){var _cache=typeof Map==="function"?new Map():undefined;_wrapNativeSuper=function _wrapNativeSuper(Class){if(Class===null||!_isNativeFunction(Class))return Class;if(typeof Class!=="function"){throw new TypeError("Super expression must either be null or a function");} 15if(typeof _cache!=="undefined"){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper);} 16function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor);} 17Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,Class);};return _wrapNativeSuper(Class);} 18function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];} 19return target;} 20function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);} 21function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;} 22function _createForOfIteratorHelperLoose(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;return function(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};};} 23throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");} 24var LuxonError=function(_Error){_inheritsLoose(LuxonError,_Error);function LuxonError(){return _Error.apply(this,arguments)||this;} 25return LuxonError;}(_wrapNativeSuper(Error));var InvalidDateTimeError=function(_LuxonError){_inheritsLoose(Invali
vendor: 37,194 bytes, lines 25-163
25dDateTimeError,_LuxonError);function InvalidDateTimeError(reason){return _LuxonError.call(this,"Invalid DateTime: "+reason.toMessage())||this;} 26return InvalidDateTimeError;}(LuxonError);var InvalidIntervalError=function(_LuxonError2){_inheritsLoose(InvalidIntervalError,_LuxonError2);function InvalidIntervalError(reason){return _LuxonError2.call(this,"Invalid Interval: "+reason.toMessage())||this;} 27return InvalidIntervalError;}(LuxonError);var InvalidDurationError=function(_LuxonError3){_inheritsLoose(InvalidDurationError,_LuxonError3);function InvalidDurationError(reason){return _LuxonError3.call(this,"Invalid Duration: "+reason.toMessage())||this;} 28return InvalidDurationError;}(LuxonError);var ConflictingSpecificationError=function(_LuxonError4){_inheritsLoose(ConflictingSpecificationError,_LuxonError4);function ConflictingSpecificationError(){return _LuxonError4.apply(this,arguments)||this;} 29return ConflictingSpecificationError;}(LuxonError);var InvalidUnitError=function(_LuxonError5){_inheritsLoose(InvalidUnitError,_LuxonError5);function InvalidUnitError(unit){return _LuxonError5.call(this,"Invalid unit "+unit)||this;} 30return InvalidUnitError;}(LuxonError);var InvalidArgumentError=function(_LuxonError6){_inheritsLoose(InvalidArgumentError,_LuxonError6);function InvalidArgumentError(){return _LuxonError6.apply(this,arguments)||this;} 31return InvalidArgumentError;}(LuxonError);var ZoneIsAbstractError=function(_LuxonError7){_inheritsLoose(ZoneIsAbstractError,_LuxonError7);function ZoneIsAbstractError(){return _LuxonError7.call(this,"Zone is an abstract class")||this;} 32return ZoneIsAbstractError;}(LuxonError);var n="numeric",s="short",l="long";var DATE_SHORT={year:n,month:n,day:n};var DATE_MED={year:n,month:s,day:n};var DATE_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s};var DATE_FULL={year:n,month:l,day:n};var DATE_HUGE={year:n,month:l,day:n,weekday:l};var TIME_SIMPLE={hour:n,minute:n};var TIME_WITH_SECONDS={hour:n,minute:n,second:n};var TIME_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,timeZoneName:s};var TIME_WITH_LONG_OFFSET={hour:n,minute:n,second:n,timeZoneName:l};var TIME_24_SIMPLE={hour:n,minute:n,hourCycle:"h23"};var TIME_24_WITH_SECONDS={hour:n,minute:n,second:n,hourCycle:"h23"};var TIME_24_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:s};var TIME_24_WITH_LONG_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:l};var DATETIME_SHORT={year:n,month:n,day:n,hour:n,minute:n};var DATETIME_SHORT_WITH_SECONDS={year:n,month:n,day:n,hour:n,minute:n,second:n};var DATETIME_MED={year:n,month:s,day:n,hour:n,minute:n};var DATETIME_MED_WITH_SECONDS={year:n,month:s,day:n,hour:n,minute:n,second:n};var DATETIME_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s,hour:n,minute:n};var DATETIME_FULL={year:n,month:l,day:n,hour:n,minute:n,timeZoneName:s};var DATETIME_FULL_WITH_SECONDS={year:n,month:l,day:n,hour:n,minute:n,second:n,timeZoneName:s};var DATETIME_HUGE={year:n,month:l,day:n,weekday:l,hour:n,minute:n,timeZoneName:l};var DATETIME_HUGE_WITH_SECONDS={year:n,month:l,day:n,weekday:l,hour:n,minute:n,second:n,timeZoneName:l};function isUndefined(o){return typeof o==="undefined";} 33function isNumber(o){return typeof o==="number";} 34function isInteger(o){return typeof o==="number"&&o%1===0;} 35function isString(o){return typeof o==="string";} 36function isDate(o){return Object.prototype.toString.call(o)==="[object Date]";} 37function hasRelative(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat;}catch(e){return false;}} 38function maybeArray(thing){return Array.isArray(thing)?thing:[thing];} 39function bestBy(arr,by,compare){if(arr.length===0){return undefined;} 40return arr.reduce(function(best,next){var pair=[by(next),next];if(!best){return pair;}else if(compare(best[0],pair[0])===best[0]){return best;}else{return pair;}},null)[1];} 41function pick(obj,keys){return keys.reduce(function(a,k){a[k]=obj[k];return a;},{});} 42function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);} 43function integerBetween(thing,bottom,top){return isInteger(thing)&&thing>=bottom&&thing<=top;} 44function floorMod(x,n){return x-n*Math.floor(x/n);} 45function padStart(input,n){if(n===void 0){n=2;} 46var isNeg=input<0;var padded;if(isNeg){padded="-"+(""+-input).padStart(n,"0");}else{padded=(""+input).padStart(n,"0");} 47return padded;} 48function parseInteger(string){if(isUndefined(string)||string===null||string===""){return undefined;}else{return parseInt(string,10);}} 49function parseFloating(string){if(isUndefined(string)||string===null||string===""){return undefined;}else{return parseFloat(string);}} 50function parseMillis(fraction){if(isUndefined(fraction)||fraction===null||fraction===""){return undefined;}else{var f=parseFloat("0."+fraction)*1000;return Math.floor(f);}} 51function roundTo(number,digits,towardZero){if(towardZero===void 0){towardZero=false;} 52var factor=Math.pow(10,digits),rounder=towardZero?Math.trunc:Math.round;return rounder(number*factor)/factor;} 53function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0);} 54function daysInYear(year){return isLeapYear(year)?366:365;} 55function daysInMonth(year,month){var modMonth=floorMod(month-1,12)+1,modYear=year+(month-modMonth)/12;if(modMonth===2){return isLeapYear(modYear)?29:28;}else{return[31,null,31,30,31,30,31,31,30,31,30,31][modMonth-1];}} 56function objToLocalTS(obj){var d=Date.UTC(obj.year,obj.month-1,obj.day,obj.hour,obj.minute,obj.second,obj.millisecond);if(obj.year<100&&obj.year>=0){d=new Date(d);d.setUTCFullYear(d.getUTCFullYear()-1900);} 57return+d;} 58function weeksInWeekYear(weekYear){var p1=(weekYear+Math.floor(weekYear/4)-Math.floor(weekYear/100)+Math.floor(weekYear/400))%7,last=weekYear-1,p2=(last+Math.floor(last/4)-Math.floor(last/100)+Math.floor(last/400))%7;return p1===4||p2===3?53:52;} 59function untruncateYear(year){if(year>99){return year;}else return year>60?1900+year:2000+year;} 60function parseZoneInfo(ts,offsetFormat,locale,timeZone){if(timeZone===void 0){timeZone=null;} 61var date=new Date(ts),intlOpts={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(timeZone){intlOpts.timeZone=timeZone;} 62var modified=_extends({timeZoneName:offsetFormat},intlOpts);var parsed=new Intl.DateTimeFormat(locale,modified).formatToParts(date).find(function(m){return m.type.toLowerCase()==="timezonename";});return parsed?parsed.value:null;} 63function signedOffset(offHourStr,offMinuteStr){var offHour=parseInt(offHourStr,10);if(Number.isNaN(offHour)){offHour=0;} 64var offMin=parseInt(offMinuteStr,10)||0,offMinSigned=offHour<0||Object.is(offHour,-0)?-offMin:offMin;return offHour*60+offMinSigned;} 65function asNumber(value){var numericValue=Number(value);if(typeof value==="boolean"||value===""||Number.isNaN(numericValue))throw new InvalidArgumentError("Invalid unit value "+value);return numericValue;} 66function normalizeObject(obj,normalizer){var normalized={};for(var u in obj){if(hasOwnProperty(obj,u)){var v=obj[u];if(v===undefined||v===null)continue;normalized[normalizer(u)]=asNumber(v);}} 67return normalized;} 68function formatOffset(offset,format){var hours=Math.trunc(Math.abs(offset/60)),minutes=Math.trunc(Math.abs(offset%60)),sign=offset>=0?"+":"-";switch(format){case"short":return""+sign+padStart(hours,2)+":"+padStart(minutes,2);case"narrow":return""+sign+hours+(minutes>0?":"+minutes:"");case"techie":return""+sign+padStart(hours,2)+padStart(minutes,2);default:throw new RangeError("Value format "+format+" is out of range for property format");}} 69function timeObject(obj){return pick(obj,["hour","minute","second","millisecond"]);} 70var ianaRegex=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;var monthsLong=["January","February","March","April","May","June","July","August","September","October","November","December"];var monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var monthsNarrow=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(length){switch(length){case"narrow":return[].concat(monthsNarrow);case"short":return[].concat(monthsShort);case"long":return[].concat(monthsLong);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null;}} 71var weekdaysLong=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];var weekdaysShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];var weekdaysNarrow=["M","T","W","T","F","S","S"];function weekdays(length){switch(length){case"narrow":return[].concat(weekdaysNarrow);case"short":return[].concat(weekdaysShort);case"long":return[].concat(weekdaysLong);case"numeric":return["1","2","3","4","5","6","7"];default:return null;}} 72var meridiems=["AM","PM"];var erasLong=["Before Christ","Anno Domini"];var erasShort=["BC","AD"];var erasNarrow=["B","A"];function eras(length){switch(length){case"narrow":return[].concat(erasNarrow);case"short":return[].concat(erasShort);case"long":return[].concat(erasLong);default:return null;}} 73function meridiemForDateTime(dt){return meridiems[dt.hour<12?0:1];} 74function weekdayForDateTime(dt,length){return weekdays(length)[dt.weekday-1];} 75function monthForDateTime(dt,length){return months(length)[dt.month-1];} 76function eraForDateTime(dt,length){return eras(length)[dt.year<0?0:1];} 77function formatRelativeTime(unit,count,numeric,narrow){if(numeric===void 0){numeric="always";} 78if(narrow===void 0){narrow=false;} 79var units={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]};var lastable=["hours","minutes","seconds"].indexOf(unit)===-1;if(numeric==="auto"&&lastable){var isDay=unit==="days";switch(count){case 1:return isDay?"tomorrow":"next "+units[unit][0];case-1:return isDay?"yesterday":"last "+units[unit][0];case 0:return isDay?"today":"this "+units[unit][0];}} 80var isInPast=Object.is(count,-0)||count<0,fmtValue=Math.abs(count),singular=fmtValue===1,lilUnits=units[unit],fmtUnit=narrow?singular?lilUnits[1]:lilUnits[2]||lilUnits[1]:singular?units[unit][0]:unit;return isInPast?fmtValue+" "+fmtUnit+" ago":"in "+fmtValue+" "+fmtUnit;} 81function stringifyTokens(splits,tokenToString){var s="";for(var _iterator=_createForOfIteratorHelperLoose(splits),_step;!(_step=_iterator()).done;){var token=_step.value;if(token.literal){s+=token.val;}else{s+=tokenToString(token.val);}} 82return s;} 83var _macroTokenToFormatOpts={D:DATE_SHORT,DD:DATE_MED,DDD:DATE_FULL,DDDD:DATE_HUGE,t:TIME_SIMPLE,tt:TIME_WITH_SECONDS,ttt:TIME_WITH_SHORT_OFFSET,tttt:TIME_WITH_LONG_OFFSET,T:TIME_24_SIMPLE,TT:TIME_24_WITH_SECONDS,TTT:TIME_24_WITH_SHORT_OFFSET,TTTT:TIME_24_WITH_LONG_OFFSET,f:DATETIME_SHORT,ff:DATETIME_MED,fff:DATETIME_FULL,ffff:DATETIME_HUGE,F:DATETIME_SHORT_WITH_SECONDS,FF:DATETIME_MED_WITH_SECONDS,FFF:DATETIME_FULL_WITH_SECONDS,FFFF:DATETIME_HUGE_WITH_SECONDS};var Formatter=function(){Formatter.create=function create(locale,opts){if(opts===void 0){opts={};} 84return new Formatter(locale,opts);};Formatter.parseFormat=function parseFormat(fmt){var current=null,currentFull="",bracketed=false;var splits=[];for(var i=0;i<fmt.length;i++){var c=fmt.charAt(i);if(c==="'"){if(currentFull.length>0){splits.push({literal:bracketed,val:currentFull});} 85current=null;currentFull="";bracketed=!bracketed;}else if(bracketed){currentFull+=c;}else if(c===current){currentFull+=c;}else{if(currentFull.length>0){splits.push({literal:false,val:currentFull});} 86currentFull=c;current=c;}} 87if(currentFull.length>0){splits.push({literal:bracketed,val:currentFull});} 88return splits;};Formatter.macroTokenToFormatOpts=function macroTokenToFormatOpts(token){return _macroTokenToFormatOpts[token];};function Formatter(locale,formatOpts){this.opts=formatOpts;this.loc=locale;this.systemLoc=null;} 89var _proto=Formatter.prototype;_proto.formatWithSystemDefault=function formatWithSystemDefault(dt,opts){if(this.systemLoc===null){this.systemLoc=this.loc.redefaultToSystem();} 90var df=this.systemLoc.dtFormatter(dt,_extends({},this.opts,opts));return df.format();};_proto.formatDateTime=function formatDateTime(dt,opts){if(opts===void 0){opts={};} 91var df=this.loc.dtFormatter(dt,_extends({},this.opts,opts));return df.format();};_proto.formatDateTimeParts=function formatDateTimeParts(dt,opts){if(opts===void 0){opts={};} 92var df=this.loc.dtFormatter(dt,_extends({},this.opts,opts));return df.formatToParts();};_proto.resolvedOptions=function resolvedOptions(dt,opts){if(opts===void 0){opts={};} 93var df=this.loc.dtFormatter(dt,_extends({},this.opts,opts));return df.resolvedOptions();};_proto.num=function num(n,p){if(p===void 0){p=0;} 94if(this.opts.forceSimple){return padStart(n,p);} 95var opts=_extends({},this.opts);if(p>0){opts.padTo=p;} 96return this.loc.numberFormatter(opts).format(n);};_proto.formatDateTimeFromString=function formatDateTimeFromString(dt,fmt){var _this=this;var knownEnglish=this.loc.listingMode()==="en",useDateTimeFormatter=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",string=function string(opts,extract){return _this.loc.extract(dt,opts,extract);},formatOffset=function formatOffset(opts){if(dt.isOffsetFixed&&dt.offset===0&&opts.allowZ){return"Z";} 97return dt.isValid?dt.zone.formatOffset(dt.ts,opts.format):"";},meridiem=function meridiem(){return knownEnglish?meridiemForDateTime(dt):string({hour:"numeric",hourCycle:"h12"},"dayperiod");},month=function month(length,standalone){return knownEnglish?monthForDateTime(dt,length):string(standalone?{month:length}:{month:length,day:"numeric"},"month");},weekday=function weekday(length,standalone){return knownEnglish?weekdayForDateTime(dt,length):string(standalone?{weekday:length}:{weekday:length,month:"long",day:"numeric"},"weekday");},maybeMacro=function maybeMacro(token){var formatOpts=Formatter.macroTokenToFormatOpts(token);if(formatOpts){return _this.formatWithSystemDefault(dt,formatOpts);}else{return token;}},era=function era(length){return knownEnglish?eraForDateTime(dt,length):string({era:length},"era");},tokenToString=function tokenToString(token){switch(token){case"S":return _this.num(dt.millisecond);case"u":case"SSS":return _this.num(dt.millisecond,3);case"s":return _this.num(dt.second);case"ss":return _this.num(dt.second,2);case"uu":return _this.num(Math.floor(dt.millisecond/10),2);case"uuu":return _this.num(Math.floor(dt.millisecond/100));case"m":return _this.num(dt.minute);case"mm":return _this.num(dt.minute,2);case"h":return _this.num(dt.hour%12===0?12:dt.hour%12);case"hh":return _this.num(dt.hour%12===0?12:dt.hour%12,2);case"H":return _this.num(dt.hour);case"HH":return _this.num(dt.hour,2);case"Z":return formatOffset({format:"narrow",allowZ:_this.opts.allowZ});case"ZZ":return formatOffset({format:"short",allowZ:_this.opts.allowZ});case"ZZZ":return formatOffset({format:"techie",allowZ:_this.opts.allowZ});case"ZZZZ":return dt.zone.offsetName(dt.ts,{format:"short",locale:_this.loc.locale});case"ZZZZZ":return dt.zone.offsetName(dt.ts,{format:"long",locale:_this.loc.locale});case"z":return dt.zoneName;case"a":return meridiem();case"d":return useDateTimeFormatter?string({day:"numeric"},"day"):_this.num(dt.day);case"dd":return useDateTimeFormatter?string({day:"2-digit"},"day"):_this.num(dt.day,2);case"c":return _this.num(dt.weekday);case"ccc":return weekday("short",true);case"cccc":return weekday("long",true);case"ccccc":return weekday("narrow",true);case"E":return _this.num(dt.weekday);case"EEE":return weekday("short",false);case"EEEE":return weekday("long",false);case"EEEEE":return weekday("narrow",false);case"L":return useDateTimeFormatter?string({month:"numeric",day:"numeric"},"month"):_this.num(dt.month);case"LL":return useDateTimeFormatter?string({month:"2-digit",day:"numeric"},"month"):_this.num(dt.month,2);case"LLL":return month("short",true);case"LLLL":return month("long",true);case"LLLLL":return month("narrow",true);case"M":return useDateTimeFormatter?string({month:"numeric"},"month"):_this.num(dt.month);case"MM":return useDateTimeFormatter?string({month:"2-digit"},"month"):_this.num(dt.month,2);case"MMM":return month("short",false);case"MMMM":return month("long",false);case"MMMMM":return month("narrow",false);case"y":return useDateTimeFormatter?string({year:"numeric"},"year"):_this.num(dt.year);case"yy":return useDateTimeFormatter?string({year:"2-digit"},"year"):_this.num(dt.year.toString().slice(-2),2);case"yyyy":return useDateTimeFormatter?string({year:"numeric"},"year"):_this.num(dt.year,4);case"yyyyyy":return useDateTimeFormatter?string({year:"numeric"},"year"):_this.num(dt.year,6);case"G":return era("short");case"GG":return era("long");case"GGGGG":return era("narrow");case"kk":return _this.num(dt.weekYear.toString().slice(-2),2);case"kkkk":return _this.num(dt.weekYear,4);case"W":return _this.num(dt.weekNumber);case"WW":return _this.num(dt.weekNumber,2);case"o":return _this.num(dt.ordinal);case"ooo":return _this.num(dt.ordinal,3);case"q":return _this.num(dt.quarter);case"qq":return _this.num(dt.quarter,2);case"X":return _this.num(Math.floor(dt.ts/1000));case"x":return _this.num(dt.ts);default:return maybeMacro(token);}};return stringifyTokens(Formatter.parseFormat(fmt),tokenToString);};_proto.formatDurationFromString=function formatDurationFromString(dur,fmt){var _this2=this;var tokenToField=function tokenToField(token){switch(token[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null;}},tokenToString=function tokenToString(lildur){return function(token){var mapped=tokenToField(token);if(mapped){return _this2.num(lildur.get(mapped),token.length);}else{return token;}};},tokens=Formatter.parseFormat(fmt),realTokens=tokens.reduce(function(found,_ref){var literal=_ref.literal,val=_ref.val;return literal?found:found.concat(val);},[]),collapsed=dur.shiftTo.apply(dur,realTokens.map(tokenToField).filter(function(t){return t;}));return stringifyTokens(tokens,tokenToString(collapsed));};return Formatter;}();var Invalid=function(){function Invalid(reason,explanation){this.reason=reason;this.explanation=explanation;} 98var _proto=Invalid.prototype;_proto.toMessage=function toMessage(){if(this.explanation){return this.reason+": "+this.explanation;}else{return this.reason;}};return Invalid;}();var Zone=function(){function Zone(){} 99var _proto=Zone.prototype;_proto.offsetName=function offsetName(ts,opts){throw new ZoneIsAbstractError();};_proto.formatOffset=function formatOffset(ts,format){throw new ZoneIsAbstractError();};_proto.offset=function offset(ts){throw new ZoneIsAbstractError();};_proto.equals=function equals(otherZone){throw new ZoneIsAbstractError();};_createClass(Zone,[{key:"type",get:function get(){throw new ZoneIsAbstractError();}},{key:"name",get:function get(){throw new ZoneIsAbstractError();}},{key:"ianaName",get:function get(){return this.name;}},{key:"isUniversal",get:function get(){throw new ZoneIsAbstractError();}},{key:"isValid",get:function get(){throw new ZoneIsAbstractError();}}]);return Zone;}();var singleton$1=null;var SystemZone=function(_Zone){_inheritsLoose(SystemZone,_Zone);function SystemZone(){return _Zone.apply(this,arguments)||this;} 100var _proto=SystemZone.prototype;_proto.offsetName=function offsetName(ts,_ref){var format=_ref.format,locale=_ref.locale;return parseZoneInfo(ts,format,locale);};_proto.formatOffset=function formatOffset$1(ts,format){return formatOffset(this.offset(ts),format);};_proto.offset=function offset(ts){return-new Date(ts).getTimezoneOffset();};_proto.equals=function equals(otherZone){return otherZone.type==="system";};_createClass(SystemZone,[{key:"type",get:function get(){return"system";}},{key:"name",get:function get(){return new Intl.DateTimeFormat().resolvedOptions().timeZone;}},{key:"isUniversal",get:function get(){return false;}},{key:"isValid",get:function get(){return true;}}],[{key:"instance",get:function get(){if(singleton$1===null){singleton$1=new SystemZone();} 101return singleton$1;}}]);return SystemZone;}(Zone);var dtfCache={};function makeDTF(zone){if(!dtfCache[zone]){dtfCache[zone]=new Intl.DateTimeFormat("en-US",{hour12:false,timeZone:zone,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"});} 102return dtfCache[zone];} 103var typeToPos={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hackyOffset(dtf,date){var formatted=dtf.format(date).replace(/\u200E/g,""),parsed=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted),fMonth=parsed[1],fDay=parsed[2],fYear=parsed[3],fadOrBc=parsed[4],fHour=parsed[5],fMinute=parsed[6],fSecond=parsed[7];return[fYear,fMonth,fDay,fadOrBc,fHour,fMinute,fSecond];} 104function partsOffset(dtf,date){var formatted=dtf.formatToParts(date);var filled=[];for(var i=0;i<formatted.length;i++){var _formatted$i=formatted[i],type=_formatted$i.type,value=_formatted$i.value;var pos=typeToPos[type];if(type==="era"){filled[pos]=value;}else if(!isUndefined(pos)){filled[pos]=parseInt(value,10);}} 105return filled;} 106var ianaZoneCache={};var IANAZone=function(_Zone){_inheritsLoose(IANAZone,_Zone);IANAZone.create=function create(name){if(!ianaZoneCache[name]){ianaZoneCache[name]=new IANAZone(name);} 107return ianaZoneCache[name];};IANAZone.resetCache=function resetCache(){ianaZoneCache={};dtfCache={};};IANAZone.isValidSpecifier=function isValidSpecifier(s){return this.isValidZone(s);};IANAZone.isValidZone=function isValidZone(zone){if(!zone){return false;} 108try{new Intl.DateTimeFormat("en-US",{timeZone:zone}).format();return true;}catch(e){return false;}};function IANAZone(name){var _this;_this=_Zone.call(this)||this;_this.zoneName=name;_this.valid=IANAZone.isValidZone(name);return _this;} 109var _proto=IANAZone.prototype;_proto.offsetName=function offsetName(ts,_ref){var format=_ref.format,locale=_ref.locale;return parseZoneInfo(ts,format,locale,this.name);};_proto.formatOffset=function formatOffset$1(ts,format){return formatOffset(this.offset(ts),format);};_proto.offset=function offset(ts){var date=new Date(ts);if(isNaN(date))return NaN;var dtf=makeDTF(this.name);var _ref2=dtf.formatToParts?partsOffset(dtf,date):hackyOffset(dtf,date),year=_ref2[0],month=_ref2[1],day=_ref2[2],adOrBc=_ref2[3],hour=_ref2[4],minute=_ref2[5],second=_ref2[6];if(adOrBc==="BC"){year=-Math.abs(year)+1;} 110var adjustedHour=hour===24?0:hour;var asUTC=objToLocalTS({year:year,month:month,day:day,hour:adjustedHour,minute:minute,second:second,millisecond:0});var asTS=+date;var over=asTS%1000;asTS-=over>=0?over:1000+over;return(asUTC-asTS)/(60*1000);};_proto.equals=function equals(otherZone){return otherZone.type==="iana"&&otherZone.name===this.name;};_createClass(IANAZone,[{key:"type",get:function get(){return"iana";}},{key:"name",get:function get(){return this.zoneName;}},{key:"isUniversal",get:function get(){return false;}},{key:"isValid",get:function get(){return this.valid;}}]);return IANAZone;}(Zone);var singleton=null;var FixedOffsetZone=function(_Zone){_inheritsLoose(FixedOffsetZone,_Zone);FixedOffsetZone.instance=function instance(offset){return offset===0?FixedOffsetZone.utcInstance:new FixedOffsetZone(offset);};FixedOffsetZone.parseSpecifier=function parseSpecifier(s){if(s){var r=s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r){return new FixedOffsetZone(signedOffset(r[1],r[2]));}} 111return null;};function FixedOffsetZone(offset){var _this;_this=_Zone.call(this)||this;_this.fixed=offset;return _this;} 112var _proto=FixedOffsetZone.prototype;_proto.offsetName=function offsetName(){return this.name;};_proto.formatOffset=function formatOffset$1(ts,format){return formatOffset(this.fixed,format);};_proto.offset=function offset(){return this.fixed;};_proto.equals=function equals(otherZone){return otherZone.type==="fixed"&&otherZone.fixed===this.fixed;};_createClass(FixedOffsetZone,[{key:"type",get:function get(){return"fixed";}},{key:"name",get:function get(){return this.fixed===0?"UTC":"UTC"+formatOffset(this.fixed,"narrow");}},{key:"ianaName",get:function get(){if(this.fixed===0){return"Etc/UTC";}else{return"Etc/GMT"+formatOffset(-this.fixed,"narrow");}}},{key:"isUniversal",get:function get(){return true;}},{key:"isValid",get:function get(){return true;}}],[{key:"utcInstance",get:function get(){if(singleton===null){singleton=new FixedOffsetZone(0);} 113return singleton;}}]);return FixedOffsetZone;}(Zone);var InvalidZone=function(_Zone){_inheritsLoose(InvalidZone,_Zone);function InvalidZone(zoneName){var _this;_this=_Zone.call(this)||this;_this.zoneName=zoneName;return _this;} 114var _proto=InvalidZone.prototype;_proto.offsetName=function offsetName(){return null;};_proto.formatOffset=function formatOffset(){return"";};_proto.offset=function offset(){return NaN;};_proto.equals=function equals(){return false;};_createClass(InvalidZone,[{key:"type",get:function get(){return"invalid";}},{key:"name",get:function get(){return this.zoneName;}},{key:"isUniversal",get:function get(){return false;}},{key:"isValid",get:function get(){return false;}}]);return InvalidZone;}(Zone);function normalizeZone(input,defaultZone){if(isUndefined(input)||input===null){return defaultZone;}else if(input instanceof Zone){return input;}else if(isString(input)){var lowered=input.toLowerCase();if(lowered==="default")return defaultZone;else if(lowered==="local"||lowered==="system")return SystemZone.instance;else if(lowered==="utc"||lowered==="gmt")return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered)||IANAZone.create(input);}else if(isNumber(input)){return FixedOffsetZone.instance(input);}else if(typeof input==="object"&&input.offset&&typeof input.offset==="number"){return input;}else{return new InvalidZone(input);}} 115var now=function now(){return Date.now();},defaultZone="system",defaultLocale=null,defaultNumberingSystem=null,defaultOutputCalendar=null,throwOnInvalid;var Settings=function(){function Settings(){} 116Settings.resetCaches=function resetCaches(){Locale.resetCache();IANAZone.resetCache();};_createClass(Settings,null,[{key:"now",get:function get(){return now;},set:function set(n){now=n;}},{key:"defaultZone",get:function get(){return normalizeZone(defaultZone,SystemZone.instance);},set:function set(zone){defaultZone=zone;}},{key:"defaultLocale",get:function get(){return defaultLocale;},set:function set(locale){defaultLocale=locale;}},{key:"defaultNumberingSystem",get:function get(){return defaultNumberingSystem;},set:function set(numberingSystem){defaultNumberingSystem=numberingSystem;}},{key:"defaultOutputCalendar",get:function get(){return defaultOutputCalendar;},set:function set(outputCalendar){defaultOutputCalendar=outputCalendar;}},{key:"throwOnInvalid",get:function get(){return throwOnInvalid;},set:function set(t){throwOnInvalid=t;}}]);return Settings;}();var _excluded=["base"],_excluded2=["padTo","floor"];var intlLFCache={};function getCachedLF(locString,opts){if(opts===void 0){opts={};} 117var key=JSON.stringify([locString,opts]);var dtf=intlLFCache[key];if(!dtf){dtf=new Intl.ListFormat(locString,opts);intlLFCache[key]=dtf;} 118return dtf;} 119var intlDTCache={};function getCachedDTF(locString,opts){if(opts===void 0){opts={};} 120var key=JSON.stringify([locString,opts]);var dtf=intlDTCache[key];if(!dtf){dtf=new Intl.DateTimeFormat(locString,opts);intlDTCache[key]=dtf;} 121return dtf;} 122var intlNumCache={};function getCachedINF(locString,opts){if(opts===void 0){opts={};} 123var key=JSON.stringify([locString,opts]);var inf=intlNumCache[key];if(!inf){inf=new Intl.NumberFormat(locString,opts);intlNumCache[key]=inf;} 124return inf;} 125var intlRelCache={};function getCachedRTF(locString,opts){if(opts===void 0){opts={};} 126var _opts=opts;_opts.base;var cacheKeyOpts=_objectWithoutPropertiesLoose(_opts,_excluded);var key=JSON.stringify([locString,cacheKeyOpts]);var inf=intlRelCache[key];if(!inf){inf=new Intl.RelativeTimeFormat(locString,opts);intlRelCache[key]=inf;} 127return inf;} 128var sysLocaleCache=null;function systemLocale(){if(sysLocaleCache){return sysLocaleCache;}else{sysLocaleCache=new Intl.DateTimeFormat().resolvedOptions().locale;return sysLocaleCache;}} 129function parseLocaleString(localeStr){var uIndex=localeStr.indexOf("-u-");if(uIndex===-1){return[localeStr];}else{var options;var smaller=localeStr.substring(0,uIndex);try{options=getCachedDTF(localeStr).resolvedOptions();}catch(e){options=getCachedDTF(smaller).resolvedOptions();} 130var _options=options,numberingSystem=_options.numberingSystem,calendar=_options.calendar;return[smaller,numberingSystem,calendar];}} 131function intlConfigString(localeStr,numberingSystem,outputCalendar){if(outputCalendar||numberingSystem){localeStr+="-u";if(outputCalendar){localeStr+="-ca-"+outputCalendar;} 132if(numberingSystem){localeStr+="-nu-"+numberingSystem;} 133return localeStr;}else{return localeStr;}} 134function mapMonths(f){var ms=[];for(var i=1;i<=12;i++){var dt=DateTime.utc(2016,i,1);ms.push(f(dt));} 135return ms;} 136function mapWeekdays(f){var ms=[];for(var i=1;i<=7;i++){var dt=DateTime.utc(2016,11,13+i);ms.push(f(dt));} 137return ms;} 138function listStuff(loc,length,defaultOK,englishFn,intlFn){var mode=loc.listingMode(defaultOK);if(mode==="error"){return null;}else if(mode==="en"){return englishFn(length);}else{return intlFn(length);}} 139function supportsFastNumbers(loc){if(loc.numberingSystem&&loc.numberingSystem!=="latn"){return false;}else{return loc.numberingSystem==="latn"||!loc.locale||loc.locale.startsWith("en")||new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem==="latn";}} 140var PolyNumberFormatter=function(){function PolyNumberFormatter(intl,forceSimple,opts){this.padTo=opts.padTo||0;this.floor=opts.floor||false;opts.padTo;opts.floor;var otherOpts=_objectWithoutPropertiesLoose(opts,_excluded2);if(!forceSimple||Object.keys(otherOpts).length>0){var intlOpts=_extends({useGrouping:false},opts);if(opts.padTo>0)intlOpts.minimumIntegerDigits=opts.padTo;this.inf=getCachedINF(intl,intlOpts);}} 141var _proto=PolyNumberFormatter.prototype;_proto.format=function format(i){if(this.inf){var fixed=this.floor?Math.floor(i):i;return this.inf.format(fixed);}else{var _fixed=this.floor?Math.floor(i):roundTo(i,3);return padStart(_fixed,this.padTo);}};return PolyNumberFormatter;}();var PolyDateFormatter=function(){function PolyDateFormatter(dt,intl,opts){this.opts=opts;var z;if(dt.zone.isUniversal){var gmtOffset=-1*(dt.offset/60);var offsetZ=gmtOffset>=0?"Etc/GMT+"+gmtOffset:"Etc/GMT"+gmtOffset;if(dt.offset!==0&&IANAZone.create(offsetZ).valid){z=offsetZ;this.dt=dt;}else{z="UTC";if(opts.timeZoneName){this.dt=dt;}else{this.dt=dt.offset===0?dt:DateTime.fromMillis(dt.ts+dt.offset*60*1000);}}}else if(dt.zone.type==="system"){this.dt=dt;}else{this.dt=dt;z=dt.zone.name;} 142var intlOpts=_extends({},this.opts);if(z){intlOpts.timeZone=z;} 143this.dtf=getCachedDTF(intl,intlOpts);} 144var _proto2=PolyDateFormatter.prototype;_proto2.format=function format(){return this.dtf.format(this.dt.toJSDate());};_proto2.formatToParts=function formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate());};_proto2.resolvedOptions=function resolvedOptions(){return this.dtf.resolvedOptions();};return PolyDateFormatter;}();var PolyRelFormatter=function(){function PolyRelFormatter(intl,isEnglish,opts){this.opts=_extends({style:"long"},opts);if(!isEnglish&&hasRelative()){this.rtf=getCachedRTF(intl,opts);}} 145var _proto3=PolyRelFormatter.prototype;_proto3.format=function format(count,unit){if(this.rtf){return this.rtf.format(count,unit);}else{return formatRelativeTime(unit,count,this.opts.numeric,this.opts.style!=="long");}};_proto3.formatToParts=function formatToParts(count,unit){if(this.rtf){return this.rtf.formatToParts(count,unit);}else{return[];}};return PolyRelFormatter;}();var Locale=function(){Locale.fromOpts=function fromOpts(opts){return Locale.create(opts.locale,opts.numberingSystem,opts.outputCalendar,opts.defaultToEN);};Locale.create=function create(locale,numberingSystem,outputCalendar,defaultToEN){if(defaultToEN===void 0){defaultToEN=false;} 146var specifiedLocale=locale||Settings.defaultLocale;var localeR=specifiedLocale||(defaultToEN?"en-US":systemLocale());var numberingSystemR=numberingSystem||Settings.defaultNumberingSystem;var outputCalendarR=outputCalendar||Settings.defaultOutputCalendar;return new Locale(localeR,numberingSystemR,outputCalendarR,specifiedLocale);};Locale.resetCache=function resetCache(){sysLocaleCache=null;intlDTCache={};intlNumCache={};intlRelCache={};};Locale.fromObject=function fromObject(_temp){var _ref=_temp===void 0?{}:_temp,locale=_ref.locale,numberingSystem=_ref.numberingSystem,outputCalendar=_ref.outputCalendar;return Locale.create(locale,numberingSystem,outputCalendar);};function Locale(locale,numbering,outputCalendar,specifiedLocale){var _parseLocaleString=parseLocaleString(locale),parsedLocale=_parseLocaleString[0],parsedNumberingSystem=_parseLocaleString[1],parsedOutputCalendar=_parseLocaleString[2];this.locale=parsedLocale;this.numberingSystem=numbering||parsedNumberingSystem||null;this.outputCalendar=outputCalendar||parsedOutputCalendar||null;this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar);this.weekdaysCache={format:{},standalone:{}};this.monthsCache={format:{},standalone:{}};this.meridiemCache=null;this.eraCache={};this.specifiedLocale=specifiedLocale;this.fastNumbersCached=null;} 147var _proto4=Locale.prototype;_proto4.listingMode=function listingMode(){var isActuallyEn=this.isEnglish();var hasNoWeirdness=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return isActuallyEn&&hasNoWeirdness?"en":"intl";};_proto4.clone=function clone(alts){if(!alts||Object.getOwnPropertyNames(alts).length===0){return this;}else{return Locale.create(alts.locale||this.specifiedLocale,alts.numberingSystem||this.numberingSystem,alts.outputCalendar||this.outputCalendar,alts.defaultToEN||false);}};_proto4.redefaultToEN=function redefaultToEN(alts){if(alts===void 0){alts={};} 148return this.clone(_extends({},alts,{defaultToEN:true}));};_proto4.redefaultToSystem=function redefaultToSystem(alts){if(alts===void 0){alts={};} 149return this.clone(_extends({},alts,{defaultToEN:false}));};_proto4.months=function months$1(length,format,defaultOK){var _this=this;if(format===void 0){format=false;} 150if(defaultOK===void 0){defaultOK=true;} 151return listStuff(this,length,defaultOK,months,function(){var intl=format?{month:length,day:"numeric"}:{month:length},formatStr=format?"format":"standalone";if(!_this.monthsCache[formatStr][length]){_this.monthsCache[formatStr][length]=mapMonths(function(dt){return _this.extract(dt,intl,"month");});} 152return _this.monthsCache[formatStr][length];});};_proto4.weekdays=function weekdays$1(length,format,defaultOK){var _this2=this;if(format===void 0){format=false;} 153if(defaultOK===void 0){defaultOK=true;} 154return listStuff(this,length,defaultOK,weekdays,function(){var intl=format?{weekday:length,year:"numeric",month:"long",day:"numeric"}:{weekday:length},formatStr=format?"format":"standalone";if(!_this2.weekdaysCache[formatStr][length]){_this2.weekdaysCache[formatStr][length]=mapWeekdays(function(dt){return _this2.extract(dt,intl,"weekday");});} 155return _this2.weekdaysCache[formatStr][length];});};_proto4.meridiems=function meridiems$1(defaultOK){var _this3=this;if(defaultOK===void 0){defaultOK=true;} 156return listStuff(this,undefined,defaultOK,function(){return meridiems;},function(){if(!_this3.meridiemCache){var intl={hour:"numeric",hourCycle:"h12"};_this3.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map(function(dt){return _this3.extract(dt,intl,"dayperiod");});} 157return _this3.meridiemCache;});};_proto4.eras=function eras$1(length,defaultOK){var _this4=this;if(defaultOK===void 0){defaultOK=true;} 158return listStuff(this,length,defaultOK,eras,function(){var intl={era:length};if(!_this4.eraCache[length]){_this4.eraCache[length]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map(function(dt){return _this4.extract(dt,intl,"era");});} 159return _this4.eraCache[length];});};_proto4.extract=function extract(dt,intlOpts,field){var df=this.dtFormatter(dt,intlOpts),results=df.formatToParts(),matching=results.find(function(m){return m.type.toLowerCase()===field;});return matching?matching.value:null;};_proto4.numberFormatter=function numberFormatter(opts){if(opts===void 0){opts={};} 160return new PolyNumberFormatter(this.intl,opts.forceSimple||this.fastNumbers,opts);};_proto4.dtFormatter=function dtFormatter(dt,intlOpts){if(intlOpts===void 0){intlOpts={};} 161return new PolyDateFormatter(dt,this.intl,intlOpts);};_proto4.relFormatter=function relFormatter(opts){if(opts===void 0){opts={};} 162return new PolyRelFormatter(this.intl,this.isEnglish(),opts);};_proto4.listFormatter=function listFormatter(opts){if(opts===void 0){opts={};} 163return getCachedLF(this.intl,opts);};_proto4.isEnglish=function isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");};_proto4.equals=function equals(other){return this.locale===other.locale&&this.numberingSystem===other.numberingSystem&&this.outputCalendar===other.outputCalendar;};
vendor: 5,908 bytes, lines 163-187
163_createClass(Locale,[{key:"fastNumbers",get:function get(){if(this.fastNumbersCached==null){this.fastNumbersCached=supportsFastNumbers(this);} 164return this.fastNumbersCached;}}]);return Locale;}();function combineRegexes(){for(var _len=arguments.length,regexes=new Array(_len),_key=0;_key<_len;_key++){regexes[_key]=arguments[_key];} 165var full=regexes.reduce(function(f,r){return f+r.source;},"");return RegExp("^"+full+"$");} 166function combineExtractors(){for(var _len2=arguments.length,extractors=new Array(_len2),_key2=0;_key2<_len2;_key2++){extractors[_key2]=arguments[_key2];} 167return function(m){return extractors.reduce(function(_ref,ex){var mergedVals=_ref[0],mergedZone=_ref[1],cursor=_ref[2];var _ex=ex(m,cursor),val=_ex[0],zone=_ex[1],next=_ex[2];return[_extends({},mergedVals,val),zone||mergedZone,next];},[{},null,1]).slice(0,2);};} 168function parse(s){if(s==null){return[null,null];} 169for(var _len3=arguments.length,patterns=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){patterns[_key3-1]=arguments[_key3];} 170for(var _i=0,_patterns=patterns;_i<_patterns.length;_i++){var _patterns$_i=_patterns[_i],regex=_patterns$_i[0],extractor=_patterns$_i[1];var m=regex.exec(s);if(m){return extractor(m);}} 171return[null,null];} 172function simpleParse(){for(var _len4=arguments.length,keys=new Array(_len4),_key4=0;_key4<_len4;_key4++){keys[_key4]=arguments[_key4];} 173return function(match,cursor){var ret={};var i;for(i=0;i<keys.length;i++){ret[keys[i]]=parseInteger(match[cursor+i]);} 174return[ret,null,cursor+i];};} 175var offsetRegex=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;var isoExtendedZone="(?:"+offsetRegex.source+"?(?:\\[("+ianaRegex.source+")\\])?)?";var isoTimeBaseRegex=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;var isoTimeRegex=RegExp(""+isoTimeBaseRegex.source+isoExtendedZone);var isoTimeExtensionRegex=RegExp("(?:T"+isoTimeRegex.source+")?");var isoYmdRegex=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;var isoWeekRegex=/(\d{4})-?W(\d\d)(?:-?(\d))?/;var isoOrdinalRegex=/(\d{4})-?(\d{3})/;var extractISOWeekData=simpleParse("weekYear","weekNumber","weekDay");var extractISOOrdinalData=simpleParse("year","ordinal");var sqlYmdRegex=/(\d{4})-(\d\d)-(\d\d)/;var sqlTimeRegex=RegExp(isoTimeBaseRegex.source+" ?(?:"+offsetRegex.source+"|("+ianaRegex.source+"))?");var sqlTimeExtensionRegex=RegExp("(?: "+sqlTimeRegex.source+")?");function int(match,pos,fallback){var m=match[pos];return isUndefined(m)?fallback:parseInteger(m);} 176function extractISOYmd(match,cursor){var item={year:int(match,cursor),month:int(match,cursor+1,1),day:int(match,cursor+2,1)};return[item,null,cursor+3];} 177function extractISOTime(match,cursor){var item={hours:int(match,cursor,0),minutes:int(match,cursor+1,0),seconds:int(match,cursor+2,0),milliseconds:parseMillis(match[cursor+3])};return[item,null,cursor+4];} 178function extractISOOffset(match,cursor){var local=!match[cursor]&&!match[cursor+1],fullOffset=signedOffset(match[cursor+1],match[cursor+2]),zone=local?null:FixedOffsetZone.instance(fullOffset);return[{},zone,cursor+3];} 179function extractIANAZone(match,cursor){var zone=match[cursor]?IANAZone.create(match[cursor]):null;return[{},zone,cursor+1];} 180var isoTimeOnly=RegExp("^T?"+isoTimeBaseRegex.source+"$");var isoDuration=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function extractISODuration(match){var s=match[0],yearStr=match[1],monthStr=match[2],weekStr=match[3],dayStr=match[4],hourStr=match[5],minuteStr=match[6],secondStr=match[7],millisecondsStr=match[8];var hasNegativePrefix=s[0]==="-";var negativeSeconds=secondStr&&secondStr[0]==="-";var maybeNegate=function maybeNegate(num,force){if(force===void 0){force=false;} 181return num!==undefined&&(force||num&&hasNegativePrefix)?-num:num;};return[{years:maybeNegate(parseFloating(yearStr)),months:maybeNegate(parseFloating(monthStr)),weeks:maybeNegate(parseFloating(weekStr)),days:maybeNegate(parseFloating(dayStr)),hours:maybeNegate(parseFloating(hourStr)),minutes:maybeNegate(parseFloating(minuteStr)),seconds:maybeNegate(parseFloating(secondStr),secondStr==="-0"),milliseconds:maybeNegate(parseMillis(millisecondsStr),negativeSeconds)}];} 182var obsOffsets={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr){var result={year:yearStr.length===2?untruncateYear(parseInteger(yearStr)):parseInteger(yearStr),month:monthsShort.indexOf(monthStr)+1,day:parseInteger(dayStr),hour:parseInteger(hourStr),minute:parseInteger(minuteStr)};if(secondStr)result.second=parseInteger(secondStr);if(weekdayStr){result.weekday=weekdayStr.length>3?weekdaysLong.indexOf(weekdayStr)+1:weekdaysShort.indexOf(weekdayStr)+1;} 183return result;} 184var rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(match){var weekdayStr=match[1],dayStr=match[2],monthStr=match[3],yearStr=match[4],hourStr=match[5],minuteStr=match[6],secondStr=match[7],obsOffset=match[8],milOffset=match[9],offHourStr=match[10],offMinuteStr=match[11],result=fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr);var offset;if(obsOffset){offset=obsOffsets[obsOffset];}else if(milOffset){offset=0;}else{offset=signedOffset(offHourStr,offMinuteStr);} 185return[result,new FixedOffsetZone(offset)];} 186function preprocessRFC2822(s){return s.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim();} 187var rfc1123=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rfc850=/^(Monday|Tuesday|Wednesday|Thursday|Frid
vendor: 5,416 bytes, lines 187-201
187ay|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ascii=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(match){var weekdayStr=match[1],dayStr=match[2],monthStr=match[3],yearStr=match[4],hourStr=match[5],minuteStr=match[6],secondStr=match[7],result=fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr);return[result,FixedOffsetZone.utcInstance];} 188function extractASCII(match){var weekdayStr=match[1],monthStr=match[2],dayStr=match[3],hourStr=match[4],minuteStr=match[5],secondStr=match[6],yearStr=match[7],result=fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr);return[result,FixedOffsetZone.utcInstance];} 189var isoYmdWithTimeExtensionRegex=combineRegexes(isoYmdRegex,isoTimeExtensionRegex);var isoWeekWithTimeExtensionRegex=combineRegexes(isoWeekRegex,isoTimeExtensionRegex);var isoOrdinalWithTimeExtensionRegex=combineRegexes(isoOrdinalRegex,isoTimeExtensionRegex);var isoTimeCombinedRegex=combineRegexes(isoTimeRegex);var extractISOYmdTimeAndOffset=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone);var extractISOWeekTimeAndOffset=combineExtractors(extractISOWeekData,extractISOTime,extractISOOffset,extractIANAZone);var extractISOOrdinalDateAndTime=combineExtractors(extractISOOrdinalData,extractISOTime,extractISOOffset,extractIANAZone);var extractISOTimeAndOffset=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseISODate(s){return parse(s,[isoYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[isoWeekWithTimeExtensionRegex,extractISOWeekTimeAndOffset],[isoOrdinalWithTimeExtensionRegex,extractISOOrdinalDateAndTime],[isoTimeCombinedRegex,extractISOTimeAndOffset]);} 190function parseRFC2822Date(s){return parse(preprocessRFC2822(s),[rfc2822,extractRFC2822]);} 191function parseHTTPDate(s){return parse(s,[rfc1123,extractRFC1123Or850],[rfc850,extractRFC1123Or850],[ascii,extractASCII]);} 192function parseISODuration(s){return parse(s,[isoDuration,extractISODuration]);} 193var extractISOTimeOnly=combineExtractors(extractISOTime);function parseISOTimeOnly(s){return parse(s,[isoTimeOnly,extractISOTimeOnly]);} 194var sqlYmdWithTimeExtensionRegex=combineRegexes(sqlYmdRegex,sqlTimeExtensionRegex);var sqlTimeCombinedRegex=combineRegexes(sqlTimeRegex);var extractISOTimeOffsetAndIANAZone=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(s){return parse(s,[sqlYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[sqlTimeCombinedRegex,extractISOTimeOffsetAndIANAZone]);} 195var INVALID$2="Invalid Duration";var lowOrderMatrix={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1000},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1000},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1000},minutes:{seconds:60,milliseconds:60*1000},seconds:{milliseconds:1000}},casualMatrix=_extends({years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1000},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1000},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1000}},lowOrderMatrix),daysInYearAccurate=146097.0/400,daysInMonthAccurate=146097.0/4800,accurateMatrix=_extends({years:{quarters:4,months:12,weeks:daysInYearAccurate/7,days:daysInYearAccurate,hours:daysInYearAccurate*24,minutes:daysInYearAccurate*24*60,seconds:daysInYearAccurate*24*60*60,milliseconds:daysInYearAccurate*24*60*60*1000},quarters:{months:3,weeks:daysInYearAccurate/28,days:daysInYearAccurate/4,hours:daysInYearAccurate*24/4,minutes:daysInYearAccurate*24*60/4,seconds:daysInYearAccurate*24*60*60/4,milliseconds:daysInYearAccurate*24*60*60*1000/4},months:{weeks:daysInMonthAccurate/7,days:daysInMonthAccurate,hours:daysInMonthAccurate*24,minutes:daysInMonthAccurate*24*60,seconds:daysInMonthAccurate*24*60*60,milliseconds:daysInMonthAccurate*24*60*60*1000}},lowOrderMatrix);var orderedUnits$1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"];var reverseUnits=orderedUnits$1.slice(0).reverse();function clone$1(dur,alts,clear){if(clear===void 0){clear=false;} 196var conf={values:clear?alts.values:_extends({},dur.values,alts.values||{}),loc:dur.loc.clone(alts.loc),conversionAccuracy:alts.conversionAccuracy||dur.conversionAccuracy};return new Duration(conf);} 197function antiTrunc(n){return n<0?Math.floor(n):Math.ceil(n);} 198function convert(matrix,fromMap,fromUnit,toMap,toUnit){var conv=matrix[toUnit][fromUnit],raw=fromMap[fromUnit]/conv,sameSign=Math.sign(raw)===Math.sign(toMap[toUnit]),added=!sameSign&&toMap[toUnit]!==0&&Math.abs(raw)<=1?antiTrunc(raw):Math.trunc(raw);toMap[toUnit]+=added;fromMap[fromUnit]-=added*conv;} 199function normalizeValues(matrix,vals){reverseUnits.reduce(function(previous,current){if(!isUndefined(vals[current])){if(previous){convert(matrix,vals,previous,vals,current);} 200return current;}else{return previous;}},null);} 201var Duration=function(){function Duration(config){var accurate=config.conversionAccuracy==="longterm"||false;this.values=config.values;this.loc=config.loc||Locale.create();this.conversionAccuracy=accurate?"longterm":"casual";
vendor: 1,550 bytes, lines 201-204
201this.invalid=config.invalid||null;this.matrix=accurate?accurateMatrix:casualMatrix;this.isLuxonDuration=true;} 202Duration.fromMillis=function fromMillis(count,opts){return Duration.fromObject({milliseconds:count},opts);};Duration.fromObject=function fromObject(obj,opts){if(opts===void 0){opts={};} 203if(obj==null||typeof obj!=="object"){throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got "+(obj===null?"null":typeof obj));} 204return new Duration({values:normalizeObject(obj,Duration.normalizeUnit),loc:Locale.fromObject(opts),conversionAccuracy:opts.conversionAccuracy});};Duration.fromDurationLike=function fromDurationLike(durationLike){if(isNumber(durationLike)){return Duration.fromMillis(durationLike);}else if(Duration.isDuration(durationLike)){return durationLike;}else if(typeof durationLike==="object"){return Duration.fromObject(durationLike);}else{throw new InvalidArgumentError("Unknown duration argument "+durationLike+" of type "+typeof durationLike);}};Duration.fromISO=function fromISO(text,opts){var _parseISODuration=parseISODuration(text),parsed=_parseISODuration[0];if(parsed){return Duration.fromObject(parsed,opts);}else{return Duration.invalid("unparsable","the input \""+text+"\" can't be parsed as ISO 8601");}};Duration.fromISOTime=function fromISOTime(text,opts){var _parseISOTimeOnly=parseISOTimeOnly(text),parsed=_parseISOTimeOnly[0];if(parsed){return Duration.fromObject(parsed,opts);}else{return Duration.invalid("unparsable","the input \""+text+"\" can't be parsed as ISO 8601");}};
vendor: 47,150 bytes, lines 204-367
204Duration.invalid=function invalid(reason,explanation){if(explanation===void 0){explanation=null;} 205if(!reason){throw new InvalidArgumentError("need to specify a reason the Duration is invalid");} 206var invalid=reason instanceof Invalid?reason:new Invalid(reason,explanation);if(Settings.throwOnInvalid){throw new InvalidDurationError(invalid);}else{return new Duration({invalid:invalid});}};Duration.normalizeUnit=function normalizeUnit(unit){var normalized={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[unit?unit.toLowerCase():unit];if(!normalized)throw new InvalidUnitError(unit);return normalized;};Duration.isDuration=function isDuration(o){return o&&o.isLuxonDuration||false;};var _proto=Duration.prototype;_proto.toFormat=function toFormat(fmt,opts){if(opts===void 0){opts={};} 207var fmtOpts=_extends({},opts,{floor:opts.round!==false&&opts.floor!==false});return this.isValid?Formatter.create(this.loc,fmtOpts).formatDurationFromString(this,fmt):INVALID$2;};_proto.toHuman=function toHuman(opts){var _this=this;if(opts===void 0){opts={};} 208var l=orderedUnits$1.map(function(unit){var val=_this.values[unit];if(isUndefined(val)){return null;} 209return _this.loc.numberFormatter(_extends({style:"unit",unitDisplay:"long"},opts,{unit:unit.slice(0,-1)})).format(val);}).filter(function(n){return n;});return this.loc.listFormatter(_extends({type:"conjunction",style:opts.listStyle||"narrow"},opts)).format(l);};_proto.toObject=function toObject(){if(!this.isValid)return{};return _extends({},this.values);};_proto.toISO=function toISO(){if(!this.isValid)return null;var s="P";if(this.years!==0)s+=this.years+"Y";if(this.months!==0||this.quarters!==0)s+=this.months+this.quarters*3+"M";if(this.weeks!==0)s+=this.weeks+"W";if(this.days!==0)s+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)s+="T";if(this.hours!==0)s+=this.hours+"H";if(this.minutes!==0)s+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0) 210s+=roundTo(this.seconds+this.milliseconds/1000,3)+"S";if(s==="P")s+="T0S";return s;};_proto.toISOTime=function toISOTime(opts){if(opts===void 0){opts={};} 211if(!this.isValid)return null;var millis=this.toMillis();if(millis<0||millis>=86400000)return null;opts=_extends({suppressMilliseconds:false,suppressSeconds:false,includePrefix:false,format:"extended"},opts);var value=this.shiftTo("hours","minutes","seconds","milliseconds");var fmt=opts.format==="basic"?"hhmm":"hh:mm";if(!opts.suppressSeconds||value.seconds!==0||value.milliseconds!==0){fmt+=opts.format==="basic"?"ss":":ss";if(!opts.suppressMilliseconds||value.milliseconds!==0){fmt+=".SSS";}} 212var str=value.toFormat(fmt);if(opts.includePrefix){str="T"+str;} 213return str;};_proto.toJSON=function toJSON(){return this.toISO();};_proto.toString=function toString(){return this.toISO();};_proto.toMillis=function toMillis(){return this.as("milliseconds");};_proto.valueOf=function valueOf(){return this.toMillis();};_proto.plus=function plus(duration){if(!this.isValid)return this;var dur=Duration.fromDurationLike(duration),result={};for(var _iterator=_createForOfIteratorHelperLoose(orderedUnits$1),_step;!(_step=_iterator()).done;){var k=_step.value;if(hasOwnProperty(dur.values,k)||hasOwnProperty(this.values,k)){result[k]=dur.get(k)+this.get(k);}} 214return clone$1(this,{values:result},true);};_proto.minus=function minus(duration){if(!this.isValid)return this;var dur=Duration.fromDurationLike(duration);return this.plus(dur.negate());};_proto.mapUnits=function mapUnits(fn){if(!this.isValid)return this;var result={};for(var _i=0,_Object$keys=Object.keys(this.values);_i<_Object$keys.length;_i++){var k=_Object$keys[_i];result[k]=asNumber(fn(this.values[k],k));} 215return clone$1(this,{values:result},true);};_proto.get=function get(unit){return this[Duration.normalizeUnit(unit)];};_proto.set=function set(values){if(!this.isValid)return this;var mixed=_extends({},this.values,normalizeObject(values,Duration.normalizeUnit));return clone$1(this,{values:mixed});};_proto.reconfigure=function reconfigure(_temp){var _ref=_temp===void 0?{}:_temp,locale=_ref.locale,numberingSystem=_ref.numberingSystem,conversionAccuracy=_ref.conversionAccuracy;var loc=this.loc.clone({locale:locale,numberingSystem:numberingSystem}),opts={loc:loc};if(conversionAccuracy){opts.conversionAccuracy=conversionAccuracy;} 216return clone$1(this,opts);};_proto.as=function as(unit){return this.isValid?this.shiftTo(unit).get(unit):NaN;};_proto.normalize=function normalize(){if(!this.isValid)return this;var vals=this.toObject();normalizeValues(this.matrix,vals);return clone$1(this,{values:vals},true);};_proto.shiftTo=function shiftTo(){for(var _len=arguments.length,units=new Array(_len),_key=0;_key<_len;_key++){units[_key]=arguments[_key];} 217if(!this.isValid)return this;if(units.length===0){return this;} 218units=units.map(function(u){return Duration.normalizeUnit(u);});var built={},accumulated={},vals=this.toObject();var lastUnit;for(var _iterator2=_createForOfIteratorHelperLoose(orderedUnits$1),_step2;!(_step2=_iterator2()).done;){var k=_step2.value;if(units.indexOf(k)>=0){lastUnit=k;var own=0;for(var ak in accumulated){own+=this.matrix[ak][k]*accumulated[ak];accumulated[ak]=0;} 219if(isNumber(vals[k])){own+=vals[k];} 220var i=Math.trunc(own);built[k]=i;accumulated[k]=(own*1000-i*1000)/1000;for(var down in vals){if(orderedUnits$1.indexOf(down)>orderedUnits$1.indexOf(k)){convert(this.matrix,vals,down,built,k);}}}else if(isNumber(vals[k])){accumulated[k]=vals[k];}} 221for(var key in accumulated){if(accumulated[key]!==0){built[lastUnit]+=key===lastUnit?accumulated[key]:accumulated[key]/this.matrix[lastUnit][key];}} 222return clone$1(this,{values:built},true).normalize();};_proto.negate=function negate(){if(!this.isValid)return this;var negated={};for(var _i2=0,_Object$keys2=Object.keys(this.values);_i2<_Object$keys2.length;_i2++){var k=_Object$keys2[_i2];negated[k]=this.values[k]===0?0:-this.values[k];} 223return clone$1(this,{values:negated},true);};_proto.equals=function equals(other){if(!this.isValid||!other.isValid){return false;} 224if(!this.loc.equals(other.loc)){return false;} 225function eq(v1,v2){if(v1===undefined||v1===0)return v2===undefined||v2===0;return v1===v2;} 226for(var _iterator3=_createForOfIteratorHelperLoose(orderedUnits$1),_step3;!(_step3=_iterator3()).done;){var u=_step3.value;if(!eq(this.values[u],other.values[u])){return false;}} 227return true;};_createClass(Duration,[{key:"locale",get:function get(){return this.isValid?this.loc.locale:null;}},{key:"numberingSystem",get:function get(){return this.isValid?this.loc.numberingSystem:null;}},{key:"years",get:function get(){return this.isValid?this.values.years||0:NaN;}},{key:"quarters",get:function get(){return this.isValid?this.values.quarters||0:NaN;}},{key:"months",get:function get(){return this.isValid?this.values.months||0:NaN;}},{key:"weeks",get:function get(){return this.isValid?this.values.weeks||0:NaN;}},{key:"days",get:function get(){return this.isValid?this.values.days||0:NaN;}},{key:"hours",get:function get(){return this.isValid?this.values.hours||0:NaN;}},{key:"minutes",get:function get(){return this.isValid?this.values.minutes||0:NaN;}},{key:"seconds",get:function get(){return this.isValid?this.values.seconds||0:NaN;}},{key:"milliseconds",get:function get(){return this.isValid?this.values.milliseconds||0:NaN;}},{key:"isValid",get:function get(){return this.invalid===null;}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null;}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null;}}]);return Duration;}();var INVALID$1="Invalid Interval";function validateStartEnd(start,end){if(!start||!start.isValid){return Interval.invalid("missing or invalid start");}else if(!end||!end.isValid){return Interval.invalid("missing or invalid end");}else if(end<start){return Interval.invalid("end before start","The end of an interval must be after its start, but you had start="+start.toISO()+" and end="+end.toISO());}else{return null;}} 228var Interval=function(){function Interval(config){this.s=config.start;this.e=config.end;this.invalid=config.invalid||null;this.isLuxonInterval=true;} 229Interval.invalid=function invalid(reason,explanation){if(explanation===void 0){explanation=null;} 230if(!reason){throw new InvalidArgumentError("need to specify a reason the Interval is invalid");} 231var invalid=reason instanceof Invalid?reason:new Invalid(reason,explanation);if(Settings.throwOnInvalid){throw new InvalidIntervalError(invalid);}else{return new Interval({invalid:invalid});}};Interval.fromDateTimes=function fromDateTimes(start,end){var builtStart=friendlyDateTime(start),builtEnd=friendlyDateTime(end);var validateError=validateStartEnd(builtStart,builtEnd);if(validateError==null){return new Interval({start:builtStart,end:builtEnd});}else{return validateError;}};Interval.after=function after(start,duration){var dur=Duration.fromDurationLike(duration),dt=friendlyDateTime(start);return Interval.fromDateTimes(dt,dt.plus(dur));};Interval.before=function before(end,duration){var dur=Duration.fromDurationLike(duration),dt=friendlyDateTime(end);return Interval.fromDateTimes(dt.minus(dur),dt);};Interval.fromISO=function fromISO(text,opts){var _split=(text||"").split("/",2),s=_split[0],e=_split[1];if(s&&e){var start,startIsValid;try{start=DateTime.fromISO(s,opts);startIsValid=start.isValid;}catch(e){startIsValid=false;} 232var end,endIsValid;try{end=DateTime.fromISO(e,opts);endIsValid=end.isValid;}catch(e){endIsValid=false;} 233if(startIsValid&&endIsValid){return Interval.fromDateTimes(start,end);} 234if(startIsValid){var dur=Duration.fromISO(e,opts);if(dur.isValid){return Interval.after(start,dur);}}else if(endIsValid){var _dur=Duration.fromISO(s,opts);if(_dur.isValid){return Interval.before(end,_dur);}}} 235return Interval.invalid("unparsable","the input \""+text+"\" can't be parsed as ISO 8601");};Interval.isInterval=function isInterval(o){return o&&o.isLuxonInterval||false;};var _proto=Interval.prototype;_proto.length=function length(unit){if(unit===void 0){unit="milliseconds";} 236return this.isValid?this.toDuration.apply(this,[unit]).get(unit):NaN;};_proto.count=function count(unit){if(unit===void 0){unit="milliseconds";} 237if(!this.isValid)return NaN;var start=this.start.startOf(unit),end=this.end.startOf(unit);return Math.floor(end.diff(start,unit).get(unit))+1;};_proto.hasSame=function hasSame(unit){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,unit):false;};_proto.isEmpty=function isEmpty(){return this.s.valueOf()===this.e.valueOf();};_proto.isAfter=function isAfter(dateTime){if(!this.isValid)return false;return this.s>dateTime;};_proto.isBefore=function isBefore(dateTime){if(!this.isValid)return false;return this.e<=dateTime;};_proto.contains=function contains(dateTime){if(!this.isValid)return false;return this.s<=dateTime&&this.e>dateTime;};_proto.set=function set(_temp){var _ref=_temp===void 0?{}:_temp,start=_ref.start,end=_ref.end;if(!this.isValid)return this;return Interval.fromDateTimes(start||this.s,end||this.e);};_proto.splitAt=function splitAt(){var _this=this;if(!this.isValid)return[];for(var _len=arguments.length,dateTimes=new Array(_len),_key=0;_key<_len;_key++){dateTimes[_key]=arguments[_key];} 238var sorted=dateTimes.map(friendlyDateTime).filter(function(d){return _this.contains(d);}).sort(),results=[];var s=this.s,i=0;while(s<this.e){var added=sorted[i]||this.e,next=+added>+this.e?this.e:added;results.push(Interval.fromDateTimes(s,next));s=next;i+=1;} 239return results;};_proto.splitBy=function splitBy(duration){var dur=Duration.fromDurationLike(duration);if(!this.isValid||!dur.isValid||dur.as("milliseconds")===0){return[];} 240var s=this.s,idx=1,next;var results=[];while(s<this.e){var added=this.start.plus(dur.mapUnits(function(x){return x*idx;}));next=+added>+this.e?this.e:added;results.push(Interval.fromDateTimes(s,next));s=next;idx+=1;} 241return results;};_proto.divideEqually=function divideEqually(numberOfParts){if(!this.isValid)return[];return this.splitBy(this.length()/numberOfParts).slice(0,numberOfParts);};_proto.overlaps=function overlaps(other){return this.e>other.s&&this.s<other.e;};_proto.abutsStart=function abutsStart(other){if(!this.isValid)return false;return+this.e===+other.s;};_proto.abutsEnd=function abutsEnd(other){if(!this.isValid)return false;return+other.e===+this.s;};_proto.engulfs=function engulfs(other){if(!this.isValid)return false;return this.s<=other.s&&this.e>=other.e;};_proto.equals=function equals(other){if(!this.isValid||!other.isValid){return false;} 242return this.s.equals(other.s)&&this.e.equals(other.e);};_proto.intersection=function intersection(other){if(!this.isValid)return this;var s=this.s>other.s?this.s:other.s,e=this.e<other.e?this.e:other.e;if(s>=e){return null;}else{return Interval.fromDateTimes(s,e);}};_proto.union=function union(other){if(!this.isValid)return this;var s=this.s<other.s?this.s:other.s,e=this.e>other.e?this.e:other.e;return Interval.fromDateTimes(s,e);};Interval.merge=function merge(intervals){var _intervals$sort$reduc=intervals.sort(function(a,b){return a.s-b.s;}).reduce(function(_ref2,item){var sofar=_ref2[0],current=_ref2[1];if(!current){return[sofar,item];}else if(current.overlaps(item)||current.abutsStart(item)){return[sofar,current.union(item)];}else{return[sofar.concat([current]),item];}},[[],null]),found=_intervals$sort$reduc[0],final=_intervals$sort$reduc[1];if(final){found.push(final);} 243return found;};Interval.xor=function xor(intervals){var _Array$prototype;var start=null,currentCount=0;var results=[],ends=intervals.map(function(i){return[{time:i.s,type:"s"},{time:i.e,type:"e"}];}),flattened=(_Array$prototype=Array.prototype).concat.apply(_Array$prototype,ends),arr=flattened.sort(function(a,b){return a.time-b.time;});for(var _iterator=_createForOfIteratorHelperLoose(arr),_step;!(_step=_iterator()).done;){var i=_step.value;currentCount+=i.type==="s"?1:-1;if(currentCount===1){start=i.time;}else{if(start&&+start!==+i.time){results.push(Interval.fromDateTimes(start,i.time));} 244start=null;}} 245return Interval.merge(results);};_proto.difference=function difference(){var _this2=this;for(var _len2=arguments.length,intervals=new Array(_len2),_key2=0;_key2<_len2;_key2++){intervals[_key2]=arguments[_key2];} 246return Interval.xor([this].concat(intervals)).map(function(i){return _this2.intersection(i);}).filter(function(i){return i&&!i.isEmpty();});};_proto.toString=function toString(){if(!this.isValid)return INVALID$1;return"["+this.s.toISO()+" \u2013 "+this.e.toISO()+")";};_proto.toISO=function toISO(opts){if(!this.isValid)return INVALID$1;return this.s.toISO(opts)+"/"+this.e.toISO(opts);};_proto.toISODate=function toISODate(){if(!this.isValid)return INVALID$1;return this.s.toISODate()+"/"+this.e.toISODate();};_proto.toISOTime=function toISOTime(opts){if(!this.isValid)return INVALID$1;return this.s.toISOTime(opts)+"/"+this.e.toISOTime(opts);};_proto.toFormat=function toFormat(dateFormat,_temp2){var _ref3=_temp2===void 0?{}:_temp2,_ref3$separator=_ref3.separator,separator=_ref3$separator===void 0?" â ":_ref3$separator;if(!this.isValid)return INVALID$1;return""+this.s.toFormat(dateFormat)+separator+this.e.toFormat(dateFormat);};_proto.toDuration=function toDuration(unit,opts){if(!this.isValid){return Duration.invalid(this.invalidReason);} 247return this.e.diff(this.s,unit,opts);};_proto.mapEndpoints=function mapEndpoints(mapFn){return Interval.fromDateTimes(mapFn(this.s),mapFn(this.e));};_createClass(Interval,[{key:"start",get:function get(){return this.isValid?this.s:null;}},{key:"end",get:function get(){return this.isValid?this.e:null;}},{key:"isValid",get:function get(){return this.invalidReason===null;}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null;}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null;}}]);return Interval;}();var Info=function(){function Info(){} 248Info.hasDST=function hasDST(zone){if(zone===void 0){zone=Settings.defaultZone;} 249var proto=DateTime.now().setZone(zone).set({month:12});return!zone.isUniversal&&proto.offset!==proto.set({month:6}).offset;};Info.isValidIANAZone=function isValidIANAZone(zone){return IANAZone.isValidZone(zone);};Info.normalizeZone=function normalizeZone$1(input){return normalizeZone(input,Settings.defaultZone);};Info.months=function months(length,_temp){if(length===void 0){length="long";} 250var _ref=_temp===void 0?{}:_temp,_ref$locale=_ref.locale,locale=_ref$locale===void 0?null:_ref$locale,_ref$numberingSystem=_ref.numberingSystem,numberingSystem=_ref$numberingSystem===void 0?null:_ref$numberingSystem,_ref$locObj=_ref.locObj,locObj=_ref$locObj===void 0?null:_ref$locObj,_ref$outputCalendar=_ref.outputCalendar,outputCalendar=_ref$outputCalendar===void 0?"gregory":_ref$outputCalendar;return(locObj||Locale.create(locale,numberingSystem,outputCalendar)).months(length);};Info.monthsFormat=function monthsFormat(length,_temp2){if(length===void 0){length="long";} 251var _ref2=_temp2===void 0?{}:_temp2,_ref2$locale=_ref2.locale,locale=_ref2$locale===void 0?null:_ref2$locale,_ref2$numberingSystem=_ref2.numberingSystem,numberingSystem=_ref2$numberingSystem===void 0?null:_ref2$numberingSystem,_ref2$locObj=_ref2.locObj,locObj=_ref2$locObj===void 0?null:_ref2$locObj,_ref2$outputCalendar=_ref2.outputCalendar,outputCalendar=_ref2$outputCalendar===void 0?"gregory":_ref2$outputCalendar;return(locObj||Locale.create(locale,numberingSystem,outputCalendar)).months(length,true);};Info.weekdays=function weekdays(length,_temp3){if(length===void 0){length="long";} 252var _ref3=_temp3===void 0?{}:_temp3,_ref3$locale=_ref3.locale,locale=_ref3$locale===void 0?null:_ref3$locale,_ref3$numberingSystem=_ref3.numberingSystem,numberingSystem=_ref3$numberingSystem===void 0?null:_ref3$numberingSystem,_ref3$locObj=_ref3.locObj,locObj=_ref3$locObj===void 0?null:_ref3$locObj;return(locObj||Locale.create(locale,numberingSystem,null)).weekdays(length);};Info.weekdaysFormat=function weekdaysFormat(length,_temp4){if(length===void 0){length="long";} 253var _ref4=_temp4===void 0?{}:_temp4,_ref4$locale=_ref4.locale,locale=_ref4$locale===void 0?null:_ref4$locale,_ref4$numberingSystem=_ref4.numberingSystem,numberingSystem=_ref4$numberingSystem===void 0?null:_ref4$numberingSystem,_ref4$locObj=_ref4.locObj,locObj=_ref4$locObj===void 0?null:_ref4$locObj;return(locObj||Locale.create(locale,numberingSystem,null)).weekdays(length,true);};Info.meridiems=function meridiems(_temp5){var _ref5=_temp5===void 0?{}:_temp5,_ref5$locale=_ref5.locale,locale=_ref5$locale===void 0?null:_ref5$locale;return Locale.create(locale).meridiems();};Info.eras=function eras(length,_temp6){if(length===void 0){length="short";} 254var _ref6=_temp6===void 0?{}:_temp6,_ref6$locale=_ref6.locale,locale=_ref6$locale===void 0?null:_ref6$locale;return Locale.create(locale,null,"gregory").eras(length);};Info.features=function features(){return{relative:hasRelative()};};return Info;}();function dayDiff(earlier,later){var utcDayStart=function utcDayStart(dt){return dt.toUTC(0,{keepLocalTime:true}).startOf("day").valueOf();},ms=utcDayStart(later)-utcDayStart(earlier);return Math.floor(Duration.fromMillis(ms).as("days"));} 255function highOrderDiffs(cursor,later,units){var differs=[["years",function(a,b){return b.year-a.year;}],["quarters",function(a,b){return b.quarter-a.quarter;}],["months",function(a,b){return b.month-a.month+(b.year-a.year)*12;}],["weeks",function(a,b){var days=dayDiff(a,b);return(days-days%7)/7;}],["days",dayDiff]];var results={};var lowestOrder,highWater;for(var _i=0,_differs=differs;_i<_differs.length;_i++){var _differs$_i=_differs[_i],unit=_differs$_i[0],differ=_differs$_i[1];if(units.indexOf(unit)>=0){var _cursor$plus;lowestOrder=unit;var delta=differ(cursor,later);highWater=cursor.plus((_cursor$plus={},_cursor$plus[unit]=delta,_cursor$plus));if(highWater>later){var _cursor$plus2;cursor=cursor.plus((_cursor$plus2={},_cursor$plus2[unit]=delta-1,_cursor$plus2));delta-=1;}else{cursor=highWater;} 256results[unit]=delta;}} 257return[cursor,results,highWater,lowestOrder];} 258function _diff(earlier,later,units,opts){var _highOrderDiffs=highOrderDiffs(earlier,later,units),cursor=_highOrderDiffs[0],results=_highOrderDiffs[1],highWater=_highOrderDiffs[2],lowestOrder=_highOrderDiffs[3];var remainingMillis=later-cursor;var lowerOrderUnits=units.filter(function(u){return["hours","minutes","seconds","milliseconds"].indexOf(u)>=0;});if(lowerOrderUnits.length===0){if(highWater<later){var _cursor$plus3;highWater=cursor.plus((_cursor$plus3={},_cursor$plus3[lowestOrder]=1,_cursor$plus3));} 259if(highWater!==cursor){results[lowestOrder]=(results[lowestOrder]||0)+remainingMillis/(highWater-cursor);}} 260var duration=Duration.fromObject(results,opts);if(lowerOrderUnits.length>0){var _Duration$fromMillis;return(_Duration$fromMillis=Duration.fromMillis(remainingMillis,opts)).shiftTo.apply(_Duration$fromMillis,lowerOrderUnits).plus(duration);}else{return duration;}} 261var numberingSystems={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[ã|ä¸|äº|ä¸|å|äº|å |ä¸|å «|ä¹]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"};var numberingSystemsUTF16={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]};var hanidecChars=numberingSystems.hanidec.replace(/[\[|\]]/g,"").split("");function parseDigits(str){var value=parseInt(str,10);if(isNaN(value)){value="";for(var i=0;i<str.length;i++){var code=str.charCodeAt(i);if(str[i].search(numberingSystems.hanidec)!==-1){value+=hanidecChars.indexOf(str[i]);}else{for(var key in numberingSystemsUTF16){var _numberingSystemsUTF=numberingSystemsUTF16[key],min=_numberingSystemsUTF[0],max=_numberingSystemsUTF[1];if(code>=min&&code<=max){value+=code-min;}}}} 262return parseInt(value,10);}else{return value;}} 263function digitRegex(_ref,append){var numberingSystem=_ref.numberingSystem;if(append===void 0){append="";} 264return new RegExp(""+numberingSystems[numberingSystem||"latn"]+append);} 265var MISSING_FTP="missing Intl.DateTimeFormat.formatToParts support";function intUnit(regex,post){if(post===void 0){post=function post(i){return i;};} 266return{regex:regex,deser:function deser(_ref){var s=_ref[0];return post(parseDigits(s));}};} 267var NBSP=String.fromCharCode(160);var spaceOrNBSP="[ "+NBSP+"]";var spaceOrNBSPRegExp=new RegExp(spaceOrNBSP,"g");function fixListRegex(s){return s.replace(/\./g,"\\.?").replace(spaceOrNBSPRegExp,spaceOrNBSP);} 268function stripInsensitivities(s){return s.replace(/\./g,"").replace(spaceOrNBSPRegExp," ").toLowerCase();} 269function oneOf(strings,startIndex){if(strings===null){return null;}else{return{regex:RegExp(strings.map(fixListRegex).join("|")),deser:function deser(_ref2){var s=_ref2[0];return strings.findIndex(function(i){return stripInsensitivities(s)===stripInsensitivities(i);})+startIndex;}};}} 270function offset(regex,groups){return{regex:regex,deser:function deser(_ref3){var h=_ref3[1],m=_ref3[2];return signedOffset(h,m);},groups:groups};} 271function simple(regex){return{regex:regex,deser:function deser(_ref4){var s=_ref4[0];return s;}};} 272function escapeToken(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");} 273function unitForToken(token,loc){var one=digitRegex(loc),two=digitRegex(loc,"{2}"),three=digitRegex(loc,"{3}"),four=digitRegex(loc,"{4}"),six=digitRegex(loc,"{6}"),oneOrTwo=digitRegex(loc,"{1,2}"),oneToThree=digitRegex(loc,"{1,3}"),oneToSix=digitRegex(loc,"{1,6}"),oneToNine=digitRegex(loc,"{1,9}"),twoToFour=digitRegex(loc,"{2,4}"),fourToSix=digitRegex(loc,"{4,6}"),literal=function literal(t){return{regex:RegExp(escapeToken(t.val)),deser:function deser(_ref5){var s=_ref5[0];return s;},literal:true};},unitate=function unitate(t){if(token.literal){return literal(t);} 274switch(t.val){case"G":return oneOf(loc.eras("short",false),0);case"GG":return oneOf(loc.eras("long",false),0);case"y":return intUnit(oneToSix);case"yy":return intUnit(twoToFour,untruncateYear);case"yyyy":return intUnit(four);case"yyyyy":return intUnit(fourToSix);case"yyyyyy":return intUnit(six);case"M":return intUnit(oneOrTwo);case"MM":return intUnit(two);case"MMM":return oneOf(loc.months("short",true,false),1);case"MMMM":return oneOf(loc.months("long",true,false),1);case"L":return intUnit(oneOrTwo);case"LL":return intUnit(two);case"LLL":return oneOf(loc.months("short",false,false),1);case"LLLL":return oneOf(loc.months("long",false,false),1);case"d":return intUnit(oneOrTwo);case"dd":return intUnit(two);case"o":return intUnit(oneToThree);case"ooo":return intUnit(three);case"HH":return intUnit(two);case"H":return intUnit(oneOrTwo);case"hh":return intUnit(two);case"h":return intUnit(oneOrTwo);case"mm":return intUnit(two);case"m":return intUnit(oneOrTwo);case"q":return intUnit(oneOrTwo);case"qq":return intUnit(two);case"s":return intUnit(oneOrTwo);case"ss":return intUnit(two);case"S":return intUnit(oneToThree);case"SSS":return intUnit(three);case"u":return simple(oneToNine);case"uu":return simple(oneOrTwo);case"uuu":return intUnit(one);case"a":return oneOf(loc.meridiems(),0);case"kkkk":return intUnit(four);case"kk":return intUnit(twoToFour,untruncateYear);case"W":return intUnit(oneOrTwo);case"WW":return intUnit(two);case"E":case"c":return intUnit(one);case"EEE":return oneOf(loc.weekdays("short",false,false),1);case"EEEE":return oneOf(loc.weekdays("long",false,false),1);case"ccc":return oneOf(loc.weekdays("short",true,false),1);case"cccc":return oneOf(loc.weekdays("long",true,false),1);case"Z":case"ZZ":return offset(new RegExp("([+-]"+oneOrTwo.source+")(?::("+two.source+"))?"),2);case"ZZZ":return offset(new RegExp("([+-]"+oneOrTwo.source+")("+two.source+")?"),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);default:return literal(t);}};var unit=unitate(token)||{invalidReason:MISSING_FTP};unit.token=token;return unit;} 275var partTypeStyleToTokenVal={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function tokenForPart(part,locale,formatOpts){var type=part.type,value=part.value;if(type==="literal"){return{literal:true,val:value};} 276var style=formatOpts[type];var val=partTypeStyleToTokenVal[type];if(typeof val==="object"){val=val[style];} 277if(val){return{literal:false,val:val};} 278return undefined;} 279function buildRegex(units){var re=units.map(function(u){return u.regex;}).reduce(function(f,r){return f+"("+r.source+")";},"");return["^"+re+"$",units];} 280function match(input,regex,handlers){var matches=input.match(regex);if(matches){var all={};var matchIndex=1;for(var i in handlers){if(hasOwnProperty(handlers,i)){var h=handlers[i],groups=h.groups?h.groups+1:1;if(!h.literal&&h.token){all[h.token.val[0]]=h.deser(matches.slice(matchIndex,matchIndex+groups));} 281matchIndex+=groups;}} 282return[matches,all];}else{return[matches,{}];}} 283function dateTimeFromMatches(matches){var toField=function toField(token){switch(token){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null;}};var zone=null;var specificOffset;if(!isUndefined(matches.z)){zone=IANAZone.create(matches.z);} 284if(!isUndefined(matches.Z)){if(!zone){zone=new FixedOffsetZone(matches.Z);} 285specificOffset=matches.Z;} 286if(!isUndefined(matches.q)){matches.M=(matches.q-1)*3+1;} 287if(!isUndefined(matches.h)){if(matches.h<12&&matches.a===1){matches.h+=12;}else if(matches.h===12&&matches.a===0){matches.h=0;}} 288if(matches.G===0&&matches.y){matches.y=-matches.y;} 289if(!isUndefined(matches.u)){matches.S=parseMillis(matches.u);} 290var vals=Object.keys(matches).reduce(function(r,k){var f=toField(k);if(f){r[f]=matches[k];} 291return r;},{});return[vals,zone,specificOffset];} 292var dummyDateTimeCache=null;function getDummyDateTime(){if(!dummyDateTimeCache){dummyDateTimeCache=DateTime.fromMillis(1555555555555);} 293return dummyDateTimeCache;} 294function maybeExpandMacroToken(token,locale){if(token.literal){return token;} 295var formatOpts=Formatter.macroTokenToFormatOpts(token.val);var tokens=formatOptsToTokens(formatOpts,locale);if(tokens==null||tokens.includes(undefined)){return token;} 296return tokens;} 297function expandMacroTokens(tokens,locale){var _Array$prototype;return(_Array$prototype=Array.prototype).concat.apply(_Array$prototype,tokens.map(function(t){return maybeExpandMacroToken(t,locale);}));} 298function explainFromTokens(locale,input,format){var tokens=expandMacroTokens(Formatter.parseFormat(format),locale),units=tokens.map(function(t){return unitForToken(t,locale);}),disqualifyingUnit=units.find(function(t){return t.invalidReason;});if(disqualifyingUnit){return{input:input,tokens:tokens,invalidReason:disqualifyingUnit.invalidReason};}else{var _buildRegex=buildRegex(units),regexString=_buildRegex[0],handlers=_buildRegex[1],regex=RegExp(regexString,"i"),_match=match(input,regex,handlers),rawMatches=_match[0],matches=_match[1],_ref6=matches?dateTimeFromMatches(matches):[null,null,undefined],result=_ref6[0],zone=_ref6[1],specificOffset=_ref6[2];if(hasOwnProperty(matches,"a")&&hasOwnProperty(matches,"H")){throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");} 299return{input:input,tokens:tokens,regex:regex,rawMatches:rawMatches,matches:matches,result:result,zone:zone,specificOffset:specificOffset};}} 300function parseFromTokens(locale,input,format){var _explainFromTokens=explainFromTokens(locale,input,format),result=_explainFromTokens.result,zone=_explainFromTokens.zone,specificOffset=_explainFromTokens.specificOffset,invalidReason=_explainFromTokens.invalidReason;return[result,zone,specificOffset,invalidReason];} 301function formatOptsToTokens(formatOpts,locale){if(!formatOpts){return null;} 302var formatter=Formatter.create(locale,formatOpts);var parts=formatter.formatDateTimeParts(getDummyDateTime());return parts.map(function(p){return tokenForPart(p,locale,formatOpts);});} 303var nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(unit,value){return new Invalid("unit out of range","you specified "+value+" (of type "+typeof value+") as a "+unit+", which is invalid");} 304function dayOfWeek(year,month,day){var d=new Date(Date.UTC(year,month-1,day));if(year<100&&year>=0){d.setUTCFullYear(d.getUTCFullYear()-1900);} 305var js=d.getUTCDay();return js===0?7:js;} 306function computeOrdinal(year,month,day){return day+(isLeapYear(year)?leapLadder:nonLeapLadder)[month-1];} 307function uncomputeOrdinal(year,ordinal){var table=isLeapYear(year)?leapLadder:nonLeapLadder,month0=table.findIndex(function(i){return i<ordinal;}),day=ordinal-table[month0];return{month:month0+1,day:day};} 308function gregorianToWeek(gregObj){var year=gregObj.year,month=gregObj.month,day=gregObj.day,ordinal=computeOrdinal(year,month,day),weekday=dayOfWeek(year,month,day);var weekNumber=Math.floor((ordinal-weekday+10)/7),weekYear;if(weekNumber<1){weekYear=year-1;weekNumber=weeksInWeekYear(weekYear);}else if(weekNumber>weeksInWeekYear(year)){weekYear=year+1;weekNumber=1;}else{weekYear=year;} 309return _extends({weekYear:weekYear,weekNumber:weekNumber,weekday:weekday},timeObject(gregObj));} 310function weekToGregorian(weekData){var weekYear=weekData.weekYear,weekNumber=weekData.weekNumber,weekday=weekData.weekday,weekdayOfJan4=dayOfWeek(weekYear,1,4),yearInDays=daysInYear(weekYear);var ordinal=weekNumber*7+weekday-weekdayOfJan4-3,year;if(ordinal<1){year=weekYear-1;ordinal+=daysInYear(year);}else if(ordinal>yearInDays){year=weekYear+1;ordinal-=daysInYear(weekYear);}else{year=weekYear;} 311var _uncomputeOrdinal=uncomputeOrdinal(year,ordinal),month=_uncomputeOrdinal.month,day=_uncomputeOrdinal.day;return _extends({year:year,month:month,day:day},timeObject(weekData));} 312function gregorianToOrdinal(gregData){var year=gregData.year,month=gregData.month,day=gregData.day;var ordinal=computeOrdinal(year,month,day);return _extends({year:year,ordinal:ordinal},timeObject(gregData));} 313function ordinalToGregorian(ordinalData){var year=ordinalData.year,ordinal=ordinalData.ordinal;var _uncomputeOrdinal2=uncomputeOrdinal(year,ordinal),month=_uncomputeOrdinal2.month,day=_uncomputeOrdinal2.day;return _extends({year:year,month:month,day:day},timeObject(ordinalData));} 314function hasInvalidWeekData(obj){var validYear=isInteger(obj.weekYear),validWeek=integerBetween(obj.weekNumber,1,weeksInWeekYear(obj.weekYear)),validWeekday=integerBetween(obj.weekday,1,7);if(!validYear){return unitOutOfRange("weekYear",obj.weekYear);}else if(!validWeek){return unitOutOfRange("week",obj.week);}else if(!validWeekday){return unitOutOfRange("weekday",obj.weekday);}else return false;} 315function hasInvalidOrdinalData(obj){var validYear=isInteger(obj.year),validOrdinal=integerBetween(obj.ordinal,1,daysInYear(obj.year));if(!validYear){return unitOutOfRange("year",obj.year);}else if(!validOrdinal){return unitOutOfRange("ordinal",obj.ordinal);}else return false;} 316function hasInvalidGregorianData(obj){var validYear=isInteger(obj.year),validMonth=integerBetween(obj.month,1,12),validDay=integerBetween(obj.day,1,daysInMonth(obj.year,obj.month));if(!validYear){return unitOutOfRange("year",obj.year);}else if(!validMonth){return unitOutOfRange("month",obj.month);}else if(!validDay){return unitOutOfRange("day",obj.day);}else return false;} 317function hasInvalidTimeData(obj){var hour=obj.hour,minute=obj.minute,second=obj.second,millisecond=obj.millisecond;var validHour=integerBetween(hour,0,23)||hour===24&&minute===0&&second===0&&millisecond===0,validMinute=integerBetween(minute,0,59),validSecond=integerBetween(second,0,59),validMillisecond=integerBetween(millisecond,0,999);if(!validHour){return unitOutOfRange("hour",hour);}else if(!validMinute){return unitOutOfRange("minute",minute);}else if(!validSecond){return unitOutOfRange("second",second);}else if(!validMillisecond){return unitOutOfRange("millisecond",millisecond);}else return false;} 318var INVALID="Invalid DateTime";var MAX_DATE=8.64e15;function unsupportedZone(zone){return new Invalid("unsupported zone","the zone \""+zone.name+"\" is not supported");} 319function possiblyCachedWeekData(dt){if(dt.weekData===null){dt.weekData=gregorianToWeek(dt.c);} 320return dt.weekData;} 321function clone(inst,alts){var current={ts:inst.ts,zone:inst.zone,c:inst.c,o:inst.o,loc:inst.loc,invalid:inst.invalid};return new DateTime(_extends({},current,alts,{old:current}));} 322function fixOffset(localTS,o,tz){var utcGuess=localTS-o*60*1000;var o2=tz.offset(utcGuess);if(o===o2){return[utcGuess,o];} 323utcGuess-=(o2-o)*60*1000;var o3=tz.offset(utcGuess);if(o2===o3){return[utcGuess,o2];} 324return[localTS-Math.min(o2,o3)*60*1000,Math.max(o2,o3)];} 325function tsToObj(ts,offset){ts+=offset*60*1000;var d=new Date(ts);return{year:d.getUTCFullYear(),month:d.getUTCMonth()+1,day:d.getUTCDate(),hour:d.getUTCHours(),minute:d.getUTCMinutes(),second:d.getUTCSeconds(),millisecond:d.getUTCMilliseconds()};} 326function objToTS(obj,offset,zone){return fixOffset(objToLocalTS(obj),offset,zone);} 327function adjustTime(inst,dur){var oPre=inst.o,year=inst.c.year+Math.trunc(dur.years),month=inst.c.month+Math.trunc(dur.months)+Math.trunc(dur.quarters)*3,c=_extends({},inst.c,{year:year,month:month,day:Math.min(inst.c.day,daysInMonth(year,month))+Math.trunc(dur.days)+Math.trunc(dur.weeks)*7}),millisToAdd=Duration.fromObject({years:dur.years-Math.trunc(dur.years),quarters:dur.quarters-Math.trunc(dur.quarters),months:dur.months-Math.trunc(dur.months),weeks:dur.weeks-Math.trunc(dur.weeks),days:dur.days-Math.trunc(dur.days),hours:dur.hours,minutes:dur.minutes,seconds:dur.seconds,milliseconds:dur.milliseconds}).as("milliseconds"),localTS=objToLocalTS(c);var _fixOffset=fixOffset(localTS,oPre,inst.zone),ts=_fixOffset[0],o=_fixOffset[1];if(millisToAdd!==0){ts+=millisToAdd;o=inst.zone.offset(ts);} 328return{ts:ts,o:o};} 329function parseDataToDateTime(parsed,parsedZone,opts,format,text,specificOffset){var setZone=opts.setZone,zone=opts.zone;if(parsed&&Object.keys(parsed).length!==0){var interpretationZone=parsedZone||zone,inst=DateTime.fromObject(parsed,_extends({},opts,{zone:interpretationZone,specificOffset:specificOffset}));return setZone?inst:inst.setZone(zone);}else{return DateTime.invalid(new Invalid("unparsable","the input \""+text+"\" can't be parsed as "+format));}} 330function toTechFormat(dt,format,allowZ){if(allowZ===void 0){allowZ=true;} 331return dt.isValid?Formatter.create(Locale.create("en-US"),{allowZ:allowZ,forceSimple:true}).formatDateTimeFromString(dt,format):null;} 332function _toISODate(o,extended){var longFormat=o.c.year>9999||o.c.year<0;var c="";if(longFormat&&o.c.year>=0)c+="+";c+=padStart(o.c.year,longFormat?6:4);if(extended){c+="-";c+=padStart(o.c.month);c+="-";c+=padStart(o.c.day);}else{c+=padStart(o.c.month);c+=padStart(o.c.day);} 333return c;} 334function _toISOTime(o,extended,suppressSeconds,suppressMilliseconds,includeOffset,extendedZone){var c=padStart(o.c.hour);if(extended){c+=":";c+=padStart(o.c.minute);if(o.c.second!==0||!suppressSeconds){c+=":";}}else{c+=padStart(o.c.minute);} 335if(o.c.second!==0||!suppressSeconds){c+=padStart(o.c.second);if(o.c.millisecond!==0||!suppressMilliseconds){c+=".";c+=padStart(o.c.millisecond,3);}} 336if(includeOffset){if(o.isOffsetFixed&&o.offset===0&&!extendedZone){c+="Z";}else if(o.o<0){c+="-";c+=padStart(Math.trunc(-o.o/60));c+=":";c+=padStart(Math.trunc(-o.o%60));}else{c+="+";c+=padStart(Math.trunc(o.o/60));c+=":";c+=padStart(Math.trunc(o.o%60));}} 337if(extendedZone){c+="["+o.zone.ianaName+"]";} 338return c;} 339var defaultUnitValues={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},defaultWeekUnitValues={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},defaultOrdinalUnitValues={ordinal:1,hour:0,minute:0,second:0,millisecond:0};var orderedUnits=["year","month","day","hour","minute","second","millisecond"],orderedWeekUnits=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],orderedOrdinalUnits=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(unit){var normalized={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[unit.toLowerCase()];if(!normalized)throw new InvalidUnitError(unit);return normalized;} 340function quickDT(obj,opts){var zone=normalizeZone(opts.zone,Settings.defaultZone),loc=Locale.fromObject(opts),tsNow=Settings.now();var ts,o;if(!isUndefined(obj.year)){for(var _iterator=_createForOfIteratorHelperLoose(orderedUnits),_step;!(_step=_iterator()).done;){var u=_step.value;if(isUndefined(obj[u])){obj[u]=defaultUnitValues[u];}} 341var invalid=hasInvalidGregorianData(obj)||hasInvalidTimeData(obj);if(invalid){return DateTime.invalid(invalid);} 342var offsetProvis=zone.offset(tsNow);var _objToTS=objToTS(obj,offsetProvis,zone);ts=_objToTS[0];o=_objToTS[1];}else{ts=tsNow;} 343return new DateTime({ts:ts,zone:zone,loc:loc,o:o});} 344function diffRelative(start,end,opts){var round=isUndefined(opts.round)?true:opts.round,format=function format(c,unit){c=roundTo(c,round||opts.calendary?0:2,true);var formatter=end.loc.clone(opts).relFormatter(opts);return formatter.format(c,unit);},differ=function differ(unit){if(opts.calendary){if(!end.hasSame(start,unit)){return end.startOf(unit).diff(start.startOf(unit),unit).get(unit);}else return 0;}else{return end.diff(start,unit).get(unit);}};if(opts.unit){return format(differ(opts.unit),opts.unit);} 345for(var _iterator2=_createForOfIteratorHelperLoose(opts.units),_step2;!(_step2=_iterator2()).done;){var unit=_step2.value;var count=differ(unit);if(Math.abs(count)>=1){return format(count,unit);}} 346return format(start>end?-0:0,opts.units[opts.units.length-1]);} 347function lastOpts(argList){var opts={},args;if(argList.length>0&&typeof argList[argList.length-1]==="object"){opts=argList[argList.length-1];args=Array.from(argList).slice(0,argList.length-1);}else{args=Array.from(argList);} 348return[opts,args];} 349var DateTime=function(){function DateTime(config){var zone=config.zone||Settings.defaultZone;var invalid=config.invalid||(Number.isNaN(config.ts)?new Invalid("invalid input"):null)||(!zone.isValid?unsupportedZone(zone):null);this.ts=isUndefined(config.ts)?Settings.now():config.ts;var c=null,o=null;if(!invalid){var unchanged=config.old&&config.old.ts===this.ts&&config.old.zone.equals(zone);if(unchanged){var _ref=[config.old.c,config.old.o];c=_ref[0];o=_ref[1];}else{var ot=zone.offset(this.ts);c=tsToObj(this.ts,ot);invalid=Number.isNaN(c.year)?new Invalid("invalid input"):null;c=invalid?null:c;o=invalid?null:ot;}} 350this._zone=zone;this.loc=config.loc||Locale.create();this.invalid=invalid;this.weekData=null;this.c=c;this.o=o;this.isLuxonDateTime=true;} 351DateTime.now=function now(){return new DateTime({});};DateTime.local=function local(){var _lastOpts=lastOpts(arguments),opts=_lastOpts[0],args=_lastOpts[1],year=args[0],month=args[1],day=args[2],hour=args[3],minute=args[4],second=args[5],millisecond=args[6];return quickDT({year:year,month:month,day:day,hour:hour,minute:minute,second:second,millisecond:millisecond},opts);};DateTime.utc=function utc(){var _lastOpts2=lastOpts(arguments),opts=_lastOpts2[0],args=_lastOpts2[1],year=args[0],month=args[1],day=args[2],hour=args[3],minute=args[4],second=args[5],millisecond=args[6];opts.zone=FixedOffsetZone.utcInstance;return quickDT({year:year,month:month,day:day,hour:hour,minute:minute,second:second,millisecond:millisecond},opts);};DateTime.fromJSDate=function fromJSDate(date,options){if(options===void 0){options={};} 352var ts=isDate(date)?date.valueOf():NaN;if(Number.isNaN(ts)){return DateTime.invalid("invalid input");} 353var zoneToUse=normalizeZone(options.zone,Settings.defaultZone);if(!zoneToUse.isValid){return DateTime.invalid(unsupportedZone(zoneToUse));} 354return new DateTime({ts:ts,zone:zoneToUse,loc:Locale.fromObject(options)});};DateTime.fromMillis=function fromMillis(milliseconds,options){if(options===void 0){options={};} 355if(!isNumber(milliseconds)){throw new InvalidArgumentError("fromMillis requires a numerical input, but received a "+typeof milliseconds+" with value "+milliseconds);}else if(milliseconds<-MAX_DATE||milliseconds>MAX_DATE){return DateTime.invalid("Timestamp out of range");}else{return new DateTime({ts:milliseconds,zone:normalizeZone(options.zone,Settings.defaultZone),loc:Locale.fromObject(options)});}};DateTime.fromSeconds=function fromSeconds(seconds,options){if(options===void 0){options={};} 356if(!isNumber(seconds)){throw new InvalidArgumentError("fromSeconds requires a numerical input");}else{return new DateTime({ts:seconds*1000,zone:normalizeZone(options.zone,Settings.defaultZone),loc:Locale.fromObject(options)});}};DateTime.fromObject=function fromObject(obj,opts){if(opts===void 0){opts={};} 357obj=obj||{};var zoneToUse=normalizeZone(opts.zone,Settings.defaultZone);if(!zoneToUse.isValid){return DateTime.invalid(unsupportedZone(zoneToUse));} 358var tsNow=Settings.now(),offsetProvis=!isUndefined(opts.specificOffset)?opts.specificOffset:zoneToUse.offset(tsNow),normalized=normalizeObject(obj,normalizeUnit),containsOrdinal=!isUndefined(normalized.ordinal),containsGregorYear=!isUndefined(normalized.year),containsGregorMD=!isUndefined(normalized.month)||!isUndefined(normalized.day),containsGregor=containsGregorYear||containsGregorMD,definiteWeekDef=normalized.weekYear||normalized.weekNumber,loc=Locale.fromObject(opts);if((containsGregor||containsOrdinal)&&definiteWeekDef){throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");} 359if(containsGregorMD&&containsOrdinal){throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");} 360var useWeekData=definiteWeekDef||normalized.weekday&&!containsGregor;var units,defaultValues,objNow=tsToObj(tsNow,offsetProvis);if(useWeekData){units=orderedWeekUnits;defaultValues=defaultWeekUnitValues;objNow=gregorianToWeek(objNow);}else if(containsOrdinal){units=orderedOrdinalUnits;defaultValues=defaultOrdinalUnitValues;objNow=gregorianToOrdinal(objNow);}else{units=orderedUnits;defaultValues=defaultUnitValues;} 361var foundFirst=false;for(var _iterator3=_createForOfIteratorHelperLoose(units),_step3;!(_step3=_iterator3()).done;){var u=_step3.value;var v=normalized[u];if(!isUndefined(v)){foundFirst=true;}else if(foundFirst){normalized[u]=defaultValues[u];}else{normalized[u]=objNow[u];}} 362var higherOrderInvalid=useWeekData?hasInvalidWeekData(normalized):containsOrdinal?hasInvalidOrdinalData(normalized):hasInvalidGregorianData(normalized),invalid=higherOrderInvalid||hasInvalidTimeData(normalized);if(invalid){return DateTime.invalid(invalid);} 363var gregorian=useWeekData?weekToGregorian(normalized):containsOrdinal?ordinalToGregorian(normalized):normalized,_objToTS2=objToTS(gregorian,offsetProvis,zoneToUse),tsFinal=_objToTS2[0],offsetFinal=_objToTS2[1],inst=new DateTime({ts:tsFinal,zone:zoneToUse,o:offsetFinal,loc:loc});if(normalized.weekday&&containsGregor&&obj.weekday!==inst.weekday){return DateTime.invalid("mismatched weekday","you can't specify both a weekday of "+normalized.weekday+" and a date of "+inst.toISO());} 364return inst;};DateTime.fromISO=function fromISO(text,opts){if(opts===void 0){opts={};} 365var _parseISODate=parseISODate(text),vals=_parseISODate[0],parsedZone=_parseISODate[1];return parseDataToDateTime(vals,parsedZone,opts,"ISO 8601",text);};DateTime.fromRFC2822=function fromRFC2822(text,opts){if(opts===void 0){opts={};} 366var _parseRFC2822Date=parseRFC2822Date(text),vals=_parseRFC2822Date[0],parsedZone=_parseRFC2822Date[1];return parseDataToDateTime(vals,parsedZone,opts,"RFC 2822",text);};DateTime.fromHTTP=function fromHTTP(text,opts){if(opts===void 0){opts={};} 367var _parseHTTPDate=parseHTTPDate(text),vals=_parseHTTPDate[0],parsedZone=_parseHTTPDate[1];return parseDataToDateTime(vals,parsedZone,opts,"HTTP",opts);};
vendor: 1,152 bytes, lines 367-371
367DateTime.fromFormat=function fromFormat(text,fmt,opts){if(opts===void 0){opts={};} 368if(isUndefined(text)||isUndefined(fmt)){throw new InvalidArgumentError("fromFormat requires an input string and a format");} 369var _opts=opts,_opts$locale=_opts.locale,locale=_opts$locale===void 0?null:_opts$locale,_opts$numberingSystem=_opts.numberingSystem,numberingSystem=_opts$numberingSystem===void 0?null:_opts$numberingSystem,localeToUse=Locale.fromOpts({locale:locale,numberingSystem:numberingSystem,defaultToEN:true}),_parseFromTokens=parseFromTokens(localeToUse,text,fmt),vals=_parseFromTokens[0],parsedZone=_parseFromTokens[1],specificOffset=_parseFromTokens[2],invalid=_parseFromTokens[3];if(invalid){return DateTime.invalid(invalid);}else{return parseDataToDateTime(vals,parsedZone,opts,"format "+fmt,text,specificOffset);}};DateTime.fromString=function fromString(text,fmt,opts){if(opts===void 0){opts={};} 370return DateTime.fromFormat(text,fmt,opts);};DateTime.fromSQL=function fromSQL(text,opts){if(opts===void 0){opts={};} 371var _parseSQL=parseSQL(text),vals=_parseSQL[0],parsedZone=_parseSQL[1];return parseDataToDateTime(vals,parsedZone,opts,"SQL",text);};
vendor: 14,923 bytes, lines 371-412
371DateTime.invalid=function invalid(reason,explanation){if(explanation===void 0){explanation=null;} 372if(!reason){throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");} 373var invalid=reason instanceof Invalid?reason:new Invalid(reason,explanation);if(Settings.throwOnInvalid){throw new InvalidDateTimeError(invalid);}else{return new DateTime({invalid:invalid});}};DateTime.isDateTime=function isDateTime(o){return o&&o.isLuxonDateTime||false;};DateTime.parseFormatForOpts=function parseFormatForOpts(formatOpts,localeOpts){if(localeOpts===void 0){localeOpts={};} 374var tokenList=formatOptsToTokens(formatOpts,Locale.fromObject(localeOpts));return!tokenList?null:tokenList.map(function(t){return t?t.val:null;}).join("");};var _proto=DateTime.prototype;_proto.get=function get(unit){return this[unit];};_proto.resolvedLocaleOptions=function resolvedLocaleOptions(opts){if(opts===void 0){opts={};} 375var _Formatter$create$res=Formatter.create(this.loc.clone(opts),opts).resolvedOptions(this),locale=_Formatter$create$res.locale,numberingSystem=_Formatter$create$res.numberingSystem,calendar=_Formatter$create$res.calendar;return{locale:locale,numberingSystem:numberingSystem,outputCalendar:calendar};};_proto.toUTC=function toUTC(offset,opts){if(offset===void 0){offset=0;} 376if(opts===void 0){opts={};} 377return this.setZone(FixedOffsetZone.instance(offset),opts);};_proto.toLocal=function toLocal(){return this.setZone(Settings.defaultZone);};_proto.setZone=function setZone(zone,_temp){var _ref2=_temp===void 0?{}:_temp,_ref2$keepLocalTime=_ref2.keepLocalTime,keepLocalTime=_ref2$keepLocalTime===void 0?false:_ref2$keepLocalTime,_ref2$keepCalendarTim=_ref2.keepCalendarTime,keepCalendarTime=_ref2$keepCalendarTim===void 0?false:_ref2$keepCalendarTim;zone=normalizeZone(zone,Settings.defaultZone);if(zone.equals(this.zone)){return this;}else if(!zone.isValid){return DateTime.invalid(unsupportedZone(zone));}else{var newTS=this.ts;if(keepLocalTime||keepCalendarTime){var offsetGuess=zone.offset(this.ts);var asObj=this.toObject();var _objToTS3=objToTS(asObj,offsetGuess,zone);newTS=_objToTS3[0];} 378return clone(this,{ts:newTS,zone:zone});}};_proto.reconfigure=function reconfigure(_temp2){var _ref3=_temp2===void 0?{}:_temp2,locale=_ref3.locale,numberingSystem=_ref3.numberingSystem,outputCalendar=_ref3.outputCalendar;var loc=this.loc.clone({locale:locale,numberingSystem:numberingSystem,outputCalendar:outputCalendar});return clone(this,{loc:loc});};_proto.setLocale=function setLocale(locale){return this.reconfigure({locale:locale});};_proto.set=function set(values){if(!this.isValid)return this;var normalized=normalizeObject(values,normalizeUnit),settingWeekStuff=!isUndefined(normalized.weekYear)||!isUndefined(normalized.weekNumber)||!isUndefined(normalized.weekday),containsOrdinal=!isUndefined(normalized.ordinal),containsGregorYear=!isUndefined(normalized.year),containsGregorMD=!isUndefined(normalized.month)||!isUndefined(normalized.day),containsGregor=containsGregorYear||containsGregorMD,definiteWeekDef=normalized.weekYear||normalized.weekNumber;if((containsGregor||containsOrdinal)&&definiteWeekDef){throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");} 379if(containsGregorMD&&containsOrdinal){throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");} 380var mixed;if(settingWeekStuff){mixed=weekToGregorian(_extends({},gregorianToWeek(this.c),normalized));}else if(!isUndefined(normalized.ordinal)){mixed=ordinalToGregorian(_extends({},gregorianToOrdinal(this.c),normalized));}else{mixed=_extends({},this.toObject(),normalized);if(isUndefined(normalized.day)){mixed.day=Math.min(daysInMonth(mixed.year,mixed.month),mixed.day);}} 381var _objToTS4=objToTS(mixed,this.o,this.zone),ts=_objToTS4[0],o=_objToTS4[1];return clone(this,{ts:ts,o:o});};_proto.plus=function plus(duration){if(!this.isValid)return this;var dur=Duration.fromDurationLike(duration);return clone(this,adjustTime(this,dur));};_proto.minus=function minus(duration){if(!this.isValid)return this;var dur=Duration.fromDurationLike(duration).negate();return clone(this,adjustTime(this,dur));};_proto.startOf=function startOf(unit){if(!this.isValid)return this;var o={},normalizedUnit=Duration.normalizeUnit(unit);switch(normalizedUnit){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break;} 382if(normalizedUnit==="weeks"){o.weekday=1;} 383if(normalizedUnit==="quarters"){var q=Math.ceil(this.month/3);o.month=(q-1)*3+1;} 384return this.set(o);};_proto.endOf=function endOf(unit){var _this$plus;return this.isValid?this.plus((_this$plus={},_this$plus[unit]=1,_this$plus)).startOf(unit).minus(1):this;};_proto.toFormat=function toFormat(fmt,opts){if(opts===void 0){opts={};} 385return this.isValid?Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this,fmt):INVALID;};_proto.toLocaleString=function toLocaleString(formatOpts,opts){if(formatOpts===void 0){formatOpts=DATE_SHORT;} 386if(opts===void 0){opts={};} 387return this.isValid?Formatter.create(this.loc.clone(opts),formatOpts).formatDateTime(this):INVALID;};_proto.toLocaleParts=function toLocaleParts(opts){if(opts===void 0){opts={};} 388return this.isValid?Formatter.create(this.loc.clone(opts),opts).formatDateTimeParts(this):[];};_proto.toISO=function toISO(_temp3){var _ref4=_temp3===void 0?{}:_temp3,_ref4$format=_ref4.format,format=_ref4$format===void 0?"extended":_ref4$format,_ref4$suppressSeconds=_ref4.suppressSeconds,suppressSeconds=_ref4$suppressSeconds===void 0?false:_ref4$suppressSeconds,_ref4$suppressMillise=_ref4.suppressMilliseconds,suppressMilliseconds=_ref4$suppressMillise===void 0?false:_ref4$suppressMillise,_ref4$includeOffset=_ref4.includeOffset,includeOffset=_ref4$includeOffset===void 0?true:_ref4$includeOffset,_ref4$extendedZone=_ref4.extendedZone,extendedZone=_ref4$extendedZone===void 0?false:_ref4$extendedZone;if(!this.isValid){return null;} 389var ext=format==="extended";var c=_toISODate(this,ext);c+="T";c+=_toISOTime(this,ext,suppressSeconds,suppressMilliseconds,includeOffset,extendedZone);return c;};_proto.toISODate=function toISODate(_temp4){var _ref5=_temp4===void 0?{}:_temp4,_ref5$format=_ref5.format,format=_ref5$format===void 0?"extended":_ref5$format;if(!this.isValid){return null;} 390return _toISODate(this,format==="extended");};_proto.toISOWeekDate=function toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c");};_proto.toISOTime=function toISOTime(_temp5){var _ref6=_temp5===void 0?{}:_temp5,_ref6$suppressMillise=_ref6.suppressMilliseconds,suppressMilliseconds=_ref6$suppressMillise===void 0?false:_ref6$suppressMillise,_ref6$suppressSeconds=_ref6.suppressSeconds,suppressSeconds=_ref6$suppressSeconds===void 0?false:_ref6$suppressSeconds,_ref6$includeOffset=_ref6.includeOffset,includeOffset=_ref6$includeOffset===void 0?true:_ref6$includeOffset,_ref6$includePrefix=_ref6.includePrefix,includePrefix=_ref6$includePrefix===void 0?false:_ref6$includePrefix,_ref6$extendedZone=_ref6.extendedZone,extendedZone=_ref6$extendedZone===void 0?false:_ref6$extendedZone,_ref6$format=_ref6.format,format=_ref6$format===void 0?"extended":_ref6$format;if(!this.isValid){return null;} 391var c=includePrefix?"T":"";return c+_toISOTime(this,format==="extended",suppressSeconds,suppressMilliseconds,includeOffset,extendedZone);};_proto.toRFC2822=function toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",false);};_proto.toHTTP=function toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'");};_proto.toSQLDate=function toSQLDate(){if(!this.isValid){return null;} 392return _toISODate(this,true);};_proto.toSQLTime=function toSQLTime(_temp6){var _ref7=_temp6===void 0?{}:_temp6,_ref7$includeOffset=_ref7.includeOffset,includeOffset=_ref7$includeOffset===void 0?true:_ref7$includeOffset,_ref7$includeZone=_ref7.includeZone,includeZone=_ref7$includeZone===void 0?false:_ref7$includeZone,_ref7$includeOffsetSp=_ref7.includeOffsetSpace,includeOffsetSpace=_ref7$includeOffsetSp===void 0?true:_ref7$includeOffsetSp;var fmt="HH:mm:ss.SSS";if(includeZone||includeOffset){if(includeOffsetSpace){fmt+=" ";} 393if(includeZone){fmt+="z";}else if(includeOffset){fmt+="ZZ";}} 394return toTechFormat(this,fmt,true);};_proto.toSQL=function toSQL(opts){if(opts===void 0){opts={};} 395if(!this.isValid){return null;} 396return this.toSQLDate()+" "+this.toSQLTime(opts);};_proto.toString=function toString(){return this.isValid?this.toISO():INVALID;};_proto.valueOf=function valueOf(){return this.toMillis();};_proto.toMillis=function toMillis(){return this.isValid?this.ts:NaN;};_proto.toSeconds=function toSeconds(){return this.isValid?this.ts/1000:NaN;};_proto.toUnixInteger=function toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN;};_proto.toJSON=function toJSON(){return this.toISO();};_proto.toBSON=function toBSON(){return this.toJSDate();};_proto.toObject=function toObject(opts){if(opts===void 0){opts={};} 397if(!this.isValid)return{};var base=_extends({},this.c);if(opts.includeConfig){base.outputCalendar=this.outputCalendar;base.numberingSystem=this.loc.numberingSystem;base.locale=this.loc.locale;} 398return base;};_proto.toJSDate=function toJSDate(){return new Date(this.isValid?this.ts:NaN);};_proto.diff=function diff(otherDateTime,unit,opts){if(unit===void 0){unit="milliseconds";} 399if(opts===void 0){opts={};} 400if(!this.isValid||!otherDateTime.isValid){return Duration.invalid("created by diffing an invalid DateTime");} 401var durOpts=_extends({locale:this.locale,numberingSystem:this.numberingSystem},opts);var units=maybeArray(unit).map(Duration.normalizeUnit),otherIsLater=otherDateTime.valueOf()>this.valueOf(),earlier=otherIsLater?this:otherDateTime,later=otherIsLater?otherDateTime:this,diffed=_diff(earlier,later,units,durOpts);return otherIsLater?diffed.negate():diffed;};_proto.diffNow=function diffNow(unit,opts){if(unit===void 0){unit="milliseconds";} 402if(opts===void 0){opts={};} 403return this.diff(DateTime.now(),unit,opts);};_proto.until=function until(otherDateTime){return this.isValid?Interval.fromDateTimes(this,otherDateTime):this;};_proto.hasSame=function hasSame(otherDateTime,unit){if(!this.isValid)return false;var inputMs=otherDateTime.valueOf();var adjustedToZone=this.setZone(otherDateTime.zone,{keepLocalTime:true});return adjustedToZone.startOf(unit)<=inputMs&&inputMs<=adjustedToZone.endOf(unit);};_proto.equals=function equals(other){return this.isValid&&other.isValid&&this.valueOf()===other.valueOf()&&this.zone.equals(other.zone)&&this.loc.equals(other.loc);};_proto.toRelative=function toRelative(options){if(options===void 0){options={};} 404if(!this.isValid)return null;var base=options.base||DateTime.fromObject({},{zone:this.zone}),padding=options.padding?this<base?-options.padding:options.padding:0;var units=["years","months","days","hours","minutes","seconds"];var unit=options.unit;if(Array.isArray(options.unit)){units=options.unit;unit=undefined;} 405return diffRelative(base,this.plus(padding),_extends({},options,{numeric:"always",units:units,unit:unit}));};_proto.toRelativeCalendar=function toRelativeCalendar(options){if(options===void 0){options={};} 406if(!this.isValid)return null;return diffRelative(options.base||DateTime.fromObject({},{zone:this.zone}),this,_extends({},options,{numeric:"auto",units:["years","months","days"],calendary:true}));};DateTime.min=function min(){for(var _len=arguments.length,dateTimes=new Array(_len),_key=0;_key<_len;_key++){dateTimes[_key]=arguments[_key];} 407if(!dateTimes.every(DateTime.isDateTime)){throw new InvalidArgumentError("min requires all arguments be DateTimes");} 408return bestBy(dateTimes,function(i){return i.valueOf();},Math.min);};DateTime.max=function max(){for(var _len2=arguments.length,dateTimes=new Array(_len2),_key2=0;_key2<_len2;_key2++){dateTimes[_key2]=arguments[_key2];} 409if(!dateTimes.every(DateTime.isDateTime)){throw new InvalidArgumentError("max requires all arguments be DateTimes");} 410return bestBy(dateTimes,function(i){return i.valueOf();},Math.max);};DateTime.fromFormatExplain=function fromFormatExplain(text,fmt,options){if(options===void 0){options={};} 411var _options=options,_options$locale=_options.locale,locale=_options$locale===void 0?null:_options$locale,_options$numberingSys=_options.numberingSystem,numberingSystem=_options$numberingSys===void 0?null:_options$numberingSys,localeToUse=Locale.fromOpts({locale:locale,numberingSystem:numberingSystem,defaultToEN:true});return explainFromTokens(localeToUse,text,fmt);};DateTime.fromStringExplain=function fromStringExplain(text,fmt,options){if(options===void 0){options={};} 412return DateTime.fromFormatExplain(text,fmt,options);};_createClass(DateTime,[{key:"isValid",get:function get(){return this.invalid===null;}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null;}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null;}},{key:"locale",get:function get(){return this.isValid?this.loc.locale:null;}},{key:"numberingSystem",get:function get(){return this.isValid?this.loc.numberingSystem:null;}},{key:"outputCalendar",get:function get(){return this.isValid?this.loc.outputCalendar:null;}},{key:"zone",get:function get(){return this._zone;}},{key:"zoneName",get:function get(){return this.isValid?this.zone.name:null;}},{key:"year",get:function get(){return this.isValid?this.c.year:NaN;}},{key:"quarter",get:function get(){return this.isValid?Math.ceil(this.c.month/3):NaN;}},{key:"month",get:function get(){return this.isValid?this.c.month:NaN;}},{key:"day",get:function get(){return this.isValid?this.c.day:NaN;}},{key:"hour",get:function get(){return this.isValid?this.c.hour:NaN;}},{key:"minute",get:function get(){return this.isValid?this.c.minute:NaN;}},{key:"second",get:function get(){return this.isValid?this.c.second:NaN;}},{key:"millisecond",get:function get(){return this.isValid?this.c.millisecond:NaN;}},{key:"weekYear",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN;}},{key:"weekNumber",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN;}},{key:"weekday",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN;}},{key:"ordinal",get:function get(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN;}},{key:"monthShort",get:function get(){return this.isValid?Info.months("short",{locObj:this.loc})[this.month-1]:null;}},{key:"monthLong",get:function get(){return this.isValid?Info.months("long",{locObj:this.loc})[this.month-1]:null;}},{key:"weekdayShort",get:function get(){return this.isValid?Info.weekdays("short",{locObj:this.loc})[this.weekday-1]:null;}},{key:"weekdayLong",get:function get(){return this.isValid?Info.weekdays("long",{locObj:this.loc})[this.weekday-1]:null;}},{key:"offset",get:function get(){return this.isValid?+this.o:NaN;}}
412,{key:"offsetNameShort",get:function get(){if(this.isValid){return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});}else{return null;}}},{key:"offsetNameLong",get:function get(){if(this.isValid){return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});}else{return null;}}},{key:"isOffsetFixed",get:function get(){return this.isValid?this.zone.isUniversal:null;}},{key:"isInDST",get:function get(){if(this.isOffsetFixed){return false;}else{return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset;}}},{key:"isInLeapYear",get:function get(){return isLeapYear(this.year);}},{key:"daysInMonth",get:function get(){return daysInMonth(this.year,this.month);}},{key:"daysInYear",get:function get(){return this.isValid?daysInYear(this.year):NaN;}},{key:"weeksInWeekYear",get:function get(){return this.isValid?weeksInWeekYear(this.weekYear):NaN;}}],[{key:"DATE_SHORT",get:function get(){return DATE_SHORT;}},{key:"DATE_MED",get:function get(){return DATE_MED;}},{key:"DATE_MED_WITH_WEEKDAY",get:function get(){return DATE_MED_WITH_WEEKDAY;}},{key:"DATE_FULL",get:function get(){return DATE_FULL;}},{key:"DATE_HUGE",get:function get(){return DATE_HUGE;}},{key:"TIME_SIMPLE",get:function get(){return TIME_SIMPLE;}},{key:"TIME_WITH_SECONDS",get:function get(){return TIME_WITH_SECONDS;}},{key:"TIME_WITH_SHORT_OFFSET",get:function get(){return TIME_WITH_SHORT_OFFSET;}},{key:"TIME_WITH_LONG_OFFSET",get:function get(){return TIME_WITH_LONG_OFFSET;}},{key:"TIME_24_SIMPLE",get:function get(){return TIME_24_SIMPLE;}},{key:"TIME_24_WITH_SECONDS",get:function get(){return TIME_24_WITH_SECONDS;}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function get(){return TIME_24_WITH_SHORT_OFFSET;}},{key:"TIME_24_WITH_LONG_OFFSET",get:function get(){return TIME_24_WITH_LONG_OFFSET;}},{key:"DATETIME_SHORT",get:function get(){return DATETIME_SHORT;}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function get(){return DATETIME_SHORT_WITH_SECONDS;}},{key:"DATETIME_MED",get:function get(){return DATETIME_MED;}},{key:"DATETIME_MED_WITH_SECONDS",get:function get(){return DATETIME_MED_WITH_SECONDS;}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function get(){return DATETIME_MED_WITH_WEEKDAY;}},{key:"DATETIME_FULL",get:function get(){return DATETIME_FULL;}},{key:"DATETIME_FULL_WITH_SECONDS",get:function get(){return DATETIME_FULL_WITH_SECONDS;}},{key:"DATETIME_HUGE",get:function get(){return DATETIME_HUGE;}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function get(){return DATETIME_HUGE_WITH_SECONDS;}}]);return DateTime;}();function friendlyDateTime(dateTimeish){if(DateTime.isDateTime(dateTimeish)){return dateTimeish;}else if(dateTimeish&&dateTimeish.valueOf&&isNumber(dateTimeish.valueOf())){return DateTime.fromJSDate(dateTimeish);}else if(dateTimeish&&typeof dateTimeish==="object"){return DateTime.fromObject(dateTimeish);}else{throw new InvalidArgumentError("Unknown datetime argument: "+dateTimeish+", of type "+typeof dateTimeish);}} 413var VERSION="3.0.1";exports.DateTime=DateTime;exports.Duration=Duration;exports.FixedOffsetZone=FixedOffsetZone;exports.IANAZone=IANAZone;exports.Info=Info;exports.Interval=Interval;exports.InvalidZone=InvalidZone;exports.Settings=Settings;exports.SystemZone=SystemZone;exports.VERSION=VERSION;exports.Zone=Zone;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});luxon.DateTime.prototype[Symbol.toStringTag]="LuxonDateTime";luxon.Duration.prototype[Symbol.toStringTag]="LuxonDuration";luxon.Interval.prototype[Symbol.toStringTag]="LuxonInterval";luxon.Settings.prototype[Symbol.toStringTag]="LuxonSettings";luxon.Info.prototype[Symbol.toStringTag]="LuxonInfo";luxon.Zone.prototype[Symbol.toStringTag]="LuxonZone";; 414 415/* /web_editor/static/src/js/frontend/loader_loading.js */ 416(function(){'use strict';document.addEventListener('DOMContentLoaded',()=>{var textareaEls=document.querySelectorAll('textarea.o_wysiwyg_loader');for(var i=0;i<textareaEls.length;i++){var textarea=textareaEls[i];var wrapper=document.createElement('div');wrapper.classList.add('position-relative','o_wysiwyg_textarea_wrapper');var loadingElement=document.createElement('div');loadingElement.classList.add('o_wysiwyg_loading');var loadingIcon=document.createElement('i');loadingIcon.classList.add('text-600','text-center','fa','fa-circle-o-notch','fa-spin','fa-2x');loadingElement.appendChild(loadingIcon);wrapper.appendChild(loadingElement);textarea.parentNode.insertBefore(wrapper,textarea);wrapper.insertBefore(textarea,loadingElement);}});})();; 417 418/* /web/static/lib/underscore/underscore.js */ 419(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define('underscore',factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,(function(){var current=global._;var exports=global._=factory();exports.noConflict=function(){global._=current;return exports;};}()));}(this,(function(){var VERSION='1.13.2';var root=typeof self=='object'&&self.self===self&&self||typeof global=='object'&&global.global===global&&global||Function('return this')()||{};var ArrayProto=Array.prototype,ObjProto=Object.prototype;var SymbolProto=typeof Symbol!=='undefined'?Symbol.prototype:null;var push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var supportsArrayBuffer=typeof ArrayBuffer!=='undefined',supportsD
vendor: 29,629 bytes, lines 419-591
419ataView=typeof DataView!=='undefined';var nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView;var _isNaN=isNaN,_isFinite=isFinite;var hasEnumBug=!{toString:null}.propertyIsEnumerable('toString');var nonEnumerableProps=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'];var MAX_ARRAY_INDEX=Math.pow(2,53)-1;function restArguments(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0),rest=Array(length),index=0;for(;index<length;index++){rest[index]=arguments[index+startIndex];} 420switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);case 2:return func.call(this,arguments[0],arguments[1],rest);} 421var args=Array(startIndex+1);for(index=0;index<startIndex;index++){args[index]=arguments[index];} 422args[startIndex]=rest;return func.apply(this,args);};} 423function isObject(obj){var type=typeof obj;return type==='function'||type==='object'&&!!obj;} 424function isNull(obj){return obj===null;} 425function isUndefined(obj){return obj===void 0;} 426function isBoolean(obj){return obj===true||obj===false||toString.call(obj)==='[object Boolean]';} 427function isElement(obj){return!!(obj&&obj.nodeType===1);} 428function tagTester(name){var tag='[object '+name+']';return function(obj){return toString.call(obj)===tag;};} 429var isString=tagTester('String');var isNumber=tagTester('Number');var isDate=tagTester('Date');var isRegExp=tagTester('RegExp');var isError=tagTester('Error');var isSymbol=tagTester('Symbol');var isArrayBuffer=tagTester('ArrayBuffer');var isFunction=tagTester('Function');var nodelist=root.document&&root.document.childNodes;if(typeof/./!='function'&&typeof Int8Array!='object'&&typeof nodelist!='function'){isFunction=function(obj){return typeof obj=='function'||false;};} 430var isFunction$1=isFunction;var hasObjectTag=tagTester('Object');var hasStringTagBug=(supportsDataView&&hasObjectTag(new DataView(new ArrayBuffer(8)))),isIE11=(typeof Map!=='undefined'&&hasObjectTag(new Map));var isDataView=tagTester('DataView');function ie10IsDataView(obj){return obj!=null&&isFunction$1(obj.getInt8)&&isArrayBuffer(obj.buffer);} 431var isDataView$1=(hasStringTagBug?ie10IsDataView:isDataView);var isArray=nativeIsArray||tagTester('Array');function has$1(obj,key){return obj!=null&&hasOwnProperty.call(obj,key);} 432var isArguments=tagTester('Arguments');(function(){if(!isArguments(arguments)){isArguments=function(obj){return has$1(obj,'callee');};}}());var isArguments$1=isArguments;function isFinite$1(obj){return!isSymbol(obj)&&_isFinite(obj)&&!isNaN(parseFloat(obj));} 433function isNaN$1(obj){return isNumber(obj)&&_isNaN(obj);} 434function constant(value){return function(){return value;};} 435function createSizePropertyCheck(getSizeProperty){return function(collection){var sizeProperty=getSizeProperty(collection);return typeof sizeProperty=='number'&&sizeProperty>=0&&sizeProperty<=MAX_ARRAY_INDEX;}} 436function shallowProperty(key){return function(obj){return obj==null?void 0:obj[key];};} 437var getByteLength=shallowProperty('byteLength');var isBufferLike=createSizePropertyCheck(getByteLength);var typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray(obj){return nativeIsView?(nativeIsView(obj)&&!isDataView$1(obj)):isBufferLike(obj)&&typedArrayPattern.test(toString.call(obj));} 438var isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(false);var getLength=shallowProperty('length');function emulatedSet(keys){var hash={};for(var l=keys.length,i=0;i<l;++i)hash[keys[i]]=true;return{contains:function(key){return hash[key]===true;},push:function(key){hash[key]=true;return keys.push(key);}};} 439function collectNonEnumProps(obj,keys){keys=emulatedSet(keys);var nonEnumIdx=nonEnumerableProps.length;var constructor=obj.constructor;var proto=isFunction$1(constructor)&&constructor.prototype||ObjProto;var prop='constructor';if(has$1(obj,prop)&&!keys.contains(prop))keys.push(prop);while(nonEnumIdx--){prop=nonEnumerableProps[nonEnumIdx];if(prop in obj&&obj[prop]!==proto[prop]&&!keys.contains(prop)){keys.push(prop);}}} 440function keys(obj){if(!isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)if(has$1(obj,key))keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys;} 441function isEmpty(obj){if(obj==null)return true;var length=getLength(obj);if(typeof length=='number'&&(isArray(obj)||isString(obj)||isArguments$1(obj)))return length===0;return getLength(keys(obj))===0;} 442function isMatch(object,attrs){var _keys=keys(attrs),length=_keys.length;if(object==null)return!length;var obj=Object(object);for(var i=0;i<length;i++){var key=_keys[i];if(attrs[key]!==obj[key]||!(key in obj))return false;} 443return true;} 444function _$1(obj){if(obj instanceof _$1)return obj;if(!(this instanceof _$1))return new _$1(obj);this._wrapped=obj;} 445_$1.VERSION=VERSION;_$1.prototype.value=function(){return this._wrapped;};_$1.prototype.valueOf=_$1.prototype.toJSON=_$1.prototype.value;_$1.prototype.toString=function(){return String(this._wrapped);};function toBufferView(bufferSource){return new Uint8Array(bufferSource.buffer||bufferSource,bufferSource.byteOffset||0,getByteLength(bufferSource));} 446var tagDataView='[object DataView]';function eq(a,b,aStack,bStack){if(a===b)return a!==0||1/a===1/b;if(a==null||b==null)return false;if(a!==a)return b!==b;var type=typeof a;if(type!=='function'&&type!=='object'&&typeof b!='object')return false;return deepEq(a,b,aStack,bStack);} 447function deepEq(a,b,aStack,bStack){if(a instanceof _$1)a=a._wrapped;if(b instanceof _$1)b=b._wrapped;var className=toString.call(a);if(className!==toString.call(b))return false;if(hasStringTagBug&&className=='[object Object]'&&isDataView$1(a)){if(!isDataView$1(b))return false;className=tagDataView;} 448switch(className){case'[object RegExp]':case'[object String]':return''+a===''+b;case'[object Number]':if(+a!==+a)return+b!==+b;return+a===0?1/+a===1/b:+a===+b;case'[object Date]':case'[object Boolean]':return+a===+b;case'[object Symbol]':return SymbolProto.valueOf.call(a)===SymbolProto.valueOf.call(b);case'[object ArrayBuffer]':case tagDataView:return deepEq(toBufferView(a),toBufferView(b),aStack,bStack);} 449var areArrays=className==='[object Array]';if(!areArrays&&isTypedArray$1(a)){var byteLength=getByteLength(a);if(byteLength!==getByteLength(b))return false;if(a.buffer===b.buffer&&a.byteOffset===b.byteOffset)return true;areArrays=true;} 450if(!areArrays){if(typeof a!='object'||typeof b!='object')return false;var aCtor=a.constructor,bCtor=b.constructor;if(aCtor!==bCtor&&!(isFunction$1(aCtor)&&aCtor instanceof aCtor&&isFunction$1(bCtor)&&bCtor instanceof bCtor)&&('constructor'in a&&'constructor'in b)){return false;}} 451aStack=aStack||[];bStack=bStack||[];var length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;} 452aStack.push(a);bStack.push(b);if(areArrays){length=a.length;if(length!==b.length)return false;while(length--){if(!eq(a[length],b[length],aStack,bStack))return false;}}else{var _keys=keys(a),key;length=_keys.length;if(keys(b).length!==length)return false;while(length--){key=_keys[length];if(!(has$1(b,key)&&eq(a[key],b[key],aStack,bStack)))return false;}} 453aStack.pop();bStack.pop();return true;} 454function isEqual(a,b){return eq(a,b);} 455function allKeys(obj){if(!isObject(obj))return[];var keys=[];for(var key in obj)keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys;} 456function ie11fingerprint(methods){var length=getLength(methods);return function(obj){if(obj==null)return false;var keys=allKeys(obj);if(getLength(keys))return false;for(var i=0;i<length;i++){if(!isFunction$1(obj[methods[i]]))return false;} 457return methods!==weakMapMethods||!isFunction$1(obj[forEachName]);};} 458var forEachName='forEach',hasName='has',commonInit=['clear','delete'],mapTail=['get',hasName,'set'];var mapMethods=commonInit.concat(forEachName,mapTail),weakMapMethods=commonInit.concat(mapTail),setMethods=['add'].concat(commonInit,forEachName,hasName);var isMap=isIE11?ie11fingerprint(mapMethods):tagTester('Map');var isWeakMap=isIE11?ie11fingerprint(weakMapMethods):tagTester('WeakMap');var isSet=isIE11?ie11fingerprint(setMethods):tagTester('Set');var isWeakSet=tagTester('WeakSet');function values(obj){var _keys=keys(obj);var length=_keys.length;var values=Array(length);for(var i=0;i<length;i++){values[i]=obj[_keys[i]];} 459return values;} 460function pairs(obj){var _keys=keys(obj);var length=_keys.length;var pairs=Array(length);for(var i=0;i<length;i++){pairs[i]=[_keys[i],obj[_keys[i]]];} 461return pairs;} 462function invert(obj){var result={};var _keys=keys(obj);for(var i=0,length=_keys.length;i<length;i++){result[obj[_keys[i]]]=_keys[i];} 463return result;} 464function functions(obj){var names=[];for(var key in obj){if(isFunction$1(obj[key]))names.push(key);} 465return names.sort();} 466function createAssigner(keysFunc,defaults){return function(obj){var length=arguments.length;if(defaults)obj=Object(obj);if(length<2||obj==null)return obj;for(var index=1;index<length;index++){var source=arguments[index],keys=keysFunc(source),l=keys.length;for(var i=0;i<l;i++){var key=keys[i];if(!defaults||obj[key]===void 0)obj[key]=source[key];}} 467return obj;};} 468var extend=createAssigner(allKeys);var extendOwn=createAssigner(keys);var defaults=createAssigner(allKeys,true);function ctor(){return function(){};} 469function baseCreate(prototype){if(!isObject(prototype))return{};if(nativeCreate)return nativeCreate(prototype);var Ctor=ctor();Ctor.prototype=prototype;var result=new Ctor;Ctor.prototype=null;return result;} 470function create(prototype,props){var result=baseCreate(prototype);if(props)extendOwn(result,props);return result;} 471function clone(obj){if(!isObject(obj))return obj;return isArray(obj)?obj.slice():extend({},obj);} 472function tap(obj,interceptor){interceptor(obj);return obj;} 473function toPath$1(path){return isArray(path)?path:[path];} 474_$1.toPath=toPath$1;function toPath(path){return _$1.toPath(path);} 475function deepGet(obj,path){var length=path.length;for(var i=0;i<length;i++){if(obj==null)return void 0;obj=obj[path[i]];} 476return length?obj:void 0;} 477function get(object,path,defaultValue){var value=deepGet(object,toPath(path));return isUndefined(value)?defaultValue:value;} 478function has(obj,path){path=toPath(path);var length=path.length;for(var i=0;i<length;i++){var key=path[i];if(!has$1(obj,key))return false;obj=obj[key];} 479return!!length;} 480function identity(value){return value;} 481function matcher(attrs){attrs=extendOwn({},attrs);return function(obj){return isMatch(obj,attrs);};} 482function property(path){path=toPath(path);return function(obj){return deepGet(obj,path);};} 483function optimizeCb(func,context,argCount){if(context===void 0)return func;switch(argCount==null?3:argCount){case 1:return function(value){return func.call(context,value);};case 3:return function(value,index,collection){return func.call(context,value,index,collection);};case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection);};} 484return function(){return func.apply(context,arguments);};} 485function baseIteratee(value,context,argCount){if(value==null)return identity;if(isFunction$1(value))return optimizeCb(value,context,argCount);if(isObject(value)&&!isArray(value))return matcher(value);return property(value);} 486function iteratee(value,context){return baseIteratee(value,context,Infinity);} 487_$1.iteratee=iteratee;function cb(value,context,argCount){if(_$1.iteratee!==iteratee)return _$1.iteratee(value,context);return baseIteratee(value,context,argCount);} 488function mapObject(obj,iteratee,context){iteratee=cb(iteratee,context);var _keys=keys(obj),length=_keys.length,results={};for(var index=0;index<length;index++){var currentKey=_keys[index];results[currentKey]=iteratee(obj[currentKey],currentKey,obj);} 489return results;} 490function noop(){} 491function propertyOf(obj){if(obj==null)return noop;return function(path){return get(obj,path);};} 492function times(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=optimizeCb(iteratee,context,1);for(var i=0;i<n;i++)accum[i]=iteratee(i);return accum;} 493function random(min,max){if(max==null){max=min;min=0;} 494return min+Math.floor(Math.random()*(max-min+1));} 495var now=Date.now||function(){return new Date().getTime();};function createEscaper(map){var escaper=function(match){return map[match];};var source='(?:'+keys(map).join('|')+')';var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,'g');return function(string){string=string==null?'':''+string;return testRegexp.test(string)?string.replace(replaceRegexp,escaper):string;};} 496var escapeMap={'&':'&','<':'<','>':'>','"':'"',"'":''','`':'`'};var _escape=createEscaper(escapeMap);var unescapeMap=invert(escapeMap);var _unescape=createEscaper(unescapeMap);var templateSettings=_$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'};var escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(match){return'\\'+escapes[match];} 497var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=defaults({},settings,_$1.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join('|')+'|$','g');var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escapeRegExp,escapeChar);index=offset+match.length;if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'";}else if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'";}else if(evaluate){source+="';\n"+evaluate+"\n__p+='";} 498return match;});source+="';\n";var argument=settings.variable;if(argument){if(!bareIdentifier.test(argument))throw new Error('variable is not a bare identifier: '+argument);}else{source='with(obj||{}){\n'+source+'}\n';argument='obj';} 499source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+ 500source+'return __p;\n';var render;try{render=new Function(argument,'_',source);}catch(e){e.source=source;throw e;} 501var template=function(data){return render.call(this,data,_$1);};template.source='function('+argument+'){\n'+source+'}';return template;} 502function result(obj,path,fallback){path=toPath(path);var length=path.length;if(!length){return isFunction$1(fallback)?fallback.call(obj):fallback;} 503for(var i=0;i<length;i++){var prop=obj==null?void 0:obj[path[i]];if(prop===void 0){prop=fallback;i=length;} 504obj=isFunction$1(prop)?prop.call(obj):prop;} 505return obj;} 506var idCounter=0;function uniqueId(prefix){var id=++idCounter+'';return prefix?prefix+id:id;} 507function chain(obj){var instance=_$1(obj);instance._chain=true;return instance;} 508function executeBound(sourceFunc,boundFunc,context,callingContext,args){if(!(callingContext instanceof boundFunc))return sourceFunc.apply(context,args);var self=baseCreate(sourceFunc.prototype);var result=sourceFunc.apply(self,args);if(isObject(result))return result;return self;} 509var partial=restArguments(function(func,boundArgs){var placeholder=partial.placeholder;var bound=function(){var position=0,length=boundArgs.length;var args=Array(length);for(var i=0;i<length;i++){args[i]=boundArgs[i]===placeholder?arguments[position++]:boundArgs[i];} 510while(position<arguments.length)args.push(arguments[position++]);return executeBound(func,bound,this,this,args);};return bound;});partial.placeholder=_$1;var bind=restArguments(function(func,context,args){if(!isFunction$1(func))throw new TypeError('Bind must be called on a function');var bound=restArguments(function(callArgs){return executeBound(func,bound,context,this,args.concat(callArgs));});return bound;});var isArrayLike=createSizePropertyCheck(getLength);function flatten$1(input,depth,strict,output){output=output||[];if(!depth&&depth!==0){depth=Infinity;}else if(depth<=0){return output.concat(input);} 511var idx=output.length;for(var i=0,length=getLength(input);i<length;i++){var value=input[i];if(isArrayLike(value)&&(isArray(value)||isArguments$1(value))){if(depth>1){flatten$1(value,depth-1,strict,output);idx=output.length;}else{var j=0,len=value.length;while(j<len)output[idx++]=value[j++];}}else if(!strict){output[idx++]=value;}} 512return output;} 513var bindAll=restArguments(function(obj,keys){keys=flatten$1(keys,false,false);var index=keys.length;if(index<1)throw new Error('bindAll must be passed function names');while(index--){var key=keys[index];obj[key]=bind(obj[key],obj);} 514return obj;});function memoize(func,hasher){var memoize=function(key){var cache=memoize.cache;var address=''+(hasher?hasher.apply(this,arguments):key);if(!has$1(cache,address))cache[address]=func.apply(this,arguments);return cache[address];};memoize.cache={};return memoize;} 515var delay=restArguments(function(func,wait,args){return setTimeout(function(){return func.apply(null,args);},wait);});var defer=partial(delay,_$1,1);function throttle(func,wait,options){var timeout,context,args,result;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:now();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null;};var throttled=function(){var _now=now();if(!previous&&options.leading===false)previous=_now;var remaining=wait-(_now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){if(timeout){clearTimeout(timeout);timeout=null;} 516previous=_now;result=func.apply(context,args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);} 517return result;};throttled.cancel=function(){clearTimeout(timeout);previous=0;timeout=context=args=null;};return throttled;} 518function debounce(func,wait,immediate){var timeout,previous,args,result,context;var later=function(){var passed=now()-previous;if(wait>passed){timeout=setTimeout(later,wait-passed);}else{timeout=null;if(!immediate)result=func.apply(context,args);if(!timeout)args=context=null;}};var debounced=restArguments(function(_args){context=this;args=_args;previous=now();if(!timeout){timeout=setTimeout(later,wait);if(immediate)result=func.apply(context,args);} 519return result;});debounced.cancel=function(){clearTimeout(timeout);timeout=args=context=null;};return debounced;} 520function wrap(func,wrapper){return partial(wrapper,func);} 521function negate(predicate){return function(){return!predicate.apply(this,arguments);};} 522function compose(){var args=arguments;var start=args.length-1;return function(){var i=start;var result=args[start].apply(this,arguments);while(i--)result=args[i].call(this,result);return result;};} 523function after(times,func){return function(){if(--times<1){return func.apply(this,arguments);}};} 524function before(times,func){var memo;return function(){if(--times>0){memo=func.apply(this,arguments);} 525if(times<=1)func=null;return memo;};} 526var once=partial(before,2);function findKey(obj,predicate,context){predicate=cb(predicate,context);var _keys=keys(obj),key;for(var i=0,length=_keys.length;i<length;i++){key=_keys[i];if(predicate(obj[key],key,obj))return key;}} 527function createPredicateIndexFinder(dir){return function(array,predicate,context){predicate=cb(predicate,context);var length=getLength(array);var index=dir>0?0:length-1;for(;index>=0&&index<length;index+=dir){if(predicate(array[index],index,array))return index;} 528return-1;};} 529var findIndex=createPredicateIndexFinder(1);var findLastIndex=createPredicateIndexFinder(-1);function sortedIndex(array,obj,iteratee,context){iteratee=cb(iteratee,context,1);var value=iteratee(obj);var low=0,high=getLength(array);while(low<high){var mid=Math.floor((low+high)/2);if(iteratee(array[mid])<value)low=mid+1;else high=mid;} 530return low;} 531function createIndexFinder(dir,predicateFind,sortedIndex){return function(array,item,idx){var i=0,length=getLength(array);if(typeof idx=='number'){if(dir>0){i=idx>=0?idx:Math.max(idx+length,i);}else{length=idx>=0?Math.min(idx+1,length):idx+length+1;}}else if(sortedIndex&&idx&&length){idx=sortedIndex(array,item);return array[idx]===item?idx:-1;} 532if(item!==item){idx=predicateFind(slice.call(array,i,length),isNaN$1);return idx>=0?idx+i:-1;} 533for(idx=dir>0?i:length-1;idx>=0&&idx<length;idx+=dir){if(array[idx]===item)return idx;} 534return-1;};} 535var indexOf=createIndexFinder(1,findIndex,sortedIndex);var lastIndexOf=createIndexFinder(-1,findLastIndex);function find(obj,predicate,context){var keyFinder=isArrayLike(obj)?findIndex:findKey;var key=keyFinder(obj,predicate,context);if(key!==void 0&&key!==-1)return obj[key];} 536function findWhere(obj,attrs){return find(obj,matcher(attrs));} 537function each(obj,iteratee,context){iteratee=optimizeCb(iteratee,context);var i,length;if(isArrayLike(obj)){for(i=0,length=obj.length;i<length;i++){iteratee(obj[i],i,obj);}}else{var _keys=keys(obj);for(i=0,length=_keys.length;i<length;i++){iteratee(obj[_keys[i]],_keys[i],obj);}} 538return obj;} 539function map(obj,iteratee,context){iteratee=cb(iteratee,context);var _keys=!isArrayLike(obj)&&keys(obj),length=(_keys||obj).length,results=Array(length);for(var index=0;index<length;index++){var currentKey=_keys?_keys[index]:index;results[index]=iteratee(obj[currentKey],currentKey,obj);} 540return results;} 541function createReduce(dir){var reducer=function(obj,iteratee,memo,initial){var _keys=!isArrayLike(obj)&&keys(obj),length=(_keys||obj).length,index=dir>0?0:length-1;if(!initial){memo=obj[_keys?_keys[index]:index];index+=dir;} 542for(;index>=0&&index<length;index+=dir){var currentKey=_keys?_keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj);} 543return memo;};return function(obj,iteratee,memo,context){var initial=arguments.length>=3;return reducer(obj,optimizeCb(iteratee,context,4),memo,initial);};} 544var reduce=createReduce(1);var reduceRight=createReduce(-1);function filter(obj,predicate,context){var results=[];predicate=cb(predicate,context);each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value);});return results;} 545function reject(obj,predicate,context){return filter(obj,negate(cb(predicate)),context);} 546function every(obj,predicate,context){predicate=cb(predicate,context);var _keys=!isArrayLike(obj)&&keys(obj),length=(_keys||obj).length;for(var index=0;index<length;index++){var currentKey=_keys?_keys[index]:index;if(!predicate(obj[currentKey],currentKey,obj))return false;} 547return true;} 548function some(obj,predicate,context){predicate=cb(predicate,context);var _keys=!isArrayLike(obj)&&keys(obj),length=(_keys||obj).length;for(var index=0;index<length;index++){var currentKey=_keys?_keys[index]:index;if(predicate(obj[currentKey],currentKey,obj))return true;} 549return false;} 550function contains(obj,item,fromIndex,guard){if(!isArrayLike(obj))obj=values(obj);if(typeof fromIndex!='number'||guard)fromIndex=0;return indexOf(obj,item,fromIndex)>=0;} 551var invoke=restArguments(function(obj,path,args){var contextPath,func;if(isFunction$1(path)){func=path;}else{path=toPath(path);contextPath=path.slice(0,-1);path=path[path.length-1];} 552return map(obj,function(context){var method=func;if(!method){if(contextPath&&contextPath.length){context=deepGet(context,contextPath);} 553if(context==null)return void 0;method=context[path];} 554return method==null?method:method.apply(context,args);});});function pluck(obj,key){return map(obj,property(key));} 555function where(obj,attrs){return filter(obj,matcher(attrs));} 556function max(obj,iteratee,context){var result=-Infinity,lastComputed=-Infinity,value,computed;if(iteratee==null||typeof iteratee=='number'&&typeof obj[0]!='object'&&obj!=null){obj=isArrayLike(obj)?obj:values(obj);for(var i=0,length=obj.length;i<length;i++){value=obj[i];if(value!=null&&value>result){result=value;}}}else{iteratee=cb(iteratee,context);each(obj,function(v,index,list){computed=iteratee(v,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=v;lastComputed=computed;}});} 557return result;} 558function min(obj,iteratee,context){var result=Infinity,lastComputed=Infinity,value,computed;if(iteratee==null||typeof iteratee=='number'&&typeof obj[0]!='object'&&obj!=null){obj=isArrayLike(obj)?obj:values(obj);for(var i=0,length=obj.length;i<length;i++){value=obj[i];if(value!=null&&value<result){result=value;}}}else{iteratee=cb(iteratee,context);each(obj,function(v,index,list){computed=iteratee(v,index,list);if(computed<lastComputed||computed===Infinity&&result===Infinity){result=v;lastComputed=computed;}});} 559return result;} 560var reStrSymbol=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function toArray(obj){if(!obj)return[];if(isArray(obj))return slice.call(obj);if(isString(obj)){return obj.match(reStrSymbol);} 561if(isArrayLike(obj))return map(obj,identity);return values(obj);} 562function sample(obj,n,guard){if(n==null||guard){if(!isArrayLike(obj))obj=values(obj);return obj[random(obj.length-1)];} 563var sample=toArray(obj);var length=getLength(sample);n=Math.max(Math.min(n,length),0);var last=length-1;for(var index=0;index<n;index++){var rand=random(index,last);var temp=sample[index];sample[index]=sample[rand];sample[rand]=temp;} 564return sample.slice(0,n);} 565function shuffle(obj){return sample(obj,Infinity);} 566function sortBy(obj,iteratee,context){var index=0;iteratee=cb(iteratee,context);return pluck(map(obj,function(value,key,list){return{value:value,index:index++,criteria:iteratee(value,key,list)};}).sort(function(left,right){var a=left.criteria;var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)return-1;} 567return left.index-right.index;}),'value');} 568function group(behavior,partition){return function(obj,iteratee,context){var result=partition?[[],[]]:{};iteratee=cb(iteratee,context);each(obj,function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key);});return result;};} 569var groupBy=group(function(result,value,key){if(has$1(result,key))result[key].push(value);else result[key]=[value];});var indexBy=group(function(result,value,key){result[key]=value;});var countBy=group(function(result,value,key){if(has$1(result,key))result[key]++;else result[key]=1;});var partition=group(function(result,value,pass){result[pass?0:1].push(value);},true);function size(obj){if(obj==null)return 0;return isArrayLike(obj)?obj.length:keys(obj).length;} 570function keyInObj(value,key,obj){return key in obj;} 571var pick=restArguments(function(obj,keys){var result={},iteratee=keys[0];if(obj==null)return result;if(isFunction$1(iteratee)){if(keys.length>1)iteratee=optimizeCb(iteratee,keys[1]);keys=allKeys(obj);}else{iteratee=keyInObj;keys=flatten$1(keys,false,false);obj=Object(obj);} 572for(var i=0,length=keys.length;i<length;i++){var key=keys[i];var value=obj[key];if(iteratee(value,key,obj))result[key]=value;} 573return result;});var omit=restArguments(function(obj,keys){var iteratee=keys[0],context;if(isFunction$1(iteratee)){iteratee=negate(iteratee);if(keys.length>1)context=keys[1];}else{keys=map(flatten$1(keys,false,false),String);iteratee=function(value,key){return!contains(keys,key);};} 574return pick(obj,iteratee,context);});function initial(array,n,guard){return slice.call(array,0,Math.max(0,array.length-(n==null||guard?1:n)));} 575function first(array,n,guard){if(array==null||array.length<1)return n==null||guard?void 0:[];if(n==null||guard)return array[0];return initial(array,array.length-n);} 576function rest(array,n,guard){return slice.call(array,n==null||guard?1:n);} 577function last(array,n,guard){if(array==null||array.length<1)return n==null||guard?void 0:[];if(n==null||guard)return array[array.length-1];return rest(array,Math.max(0,array.length-n));} 578function compact(array){return filter(array,Boolean);} 579function flatten(array,depth){return flatten$1(array,depth,false);} 580var difference=restArguments(function(array,rest){rest=flatten$1(rest,true,true);return filter(array,function(value){return!contains(rest,value);});});var without=restArguments(function(array,otherArrays){return difference(array,otherArrays);});function uniq(array,isSorted,iteratee,context){if(!isBoolean(isSorted)){context=iteratee;iteratee=isSorted;isSorted=false;} 581if(iteratee!=null)iteratee=cb(iteratee,context);var result=[];var seen=[];for(var i=0,length=getLength(array);i<length;i++){var value=array[i],computed=iteratee?iteratee(value,i,array):value;if(isSorted&&!iteratee){if(!i||seen!==computed)result.push(value);seen=computed;}else if(iteratee){if(!contains(seen,computed)){seen.push(computed);result.push(value);}}else if(!contains(result,value)){result.push(value);}} 582return result;} 583var union=restArguments(function(arrays){return uniq(flatten$1(arrays,true,true));});function intersection(array){var result=[];var argsLength=arguments.length;for(var i=0,length=getLength(array);i<length;i++){var item=array[i];if(contains(result,item))continue;var j;for(j=1;j<argsLength;j++){if(!contains(arguments[j],item))break;} 584if(j===argsLength)result.push(item);} 585return result;} 586function unzip(array){var length=array&&max(array,getLength).length||0;var result=Array(length);for(var index=0;index<length;index++){result[index]=pluck(array,index);} 587return result;} 588var zip=restArguments(unzip);function object(list,values){var result={};for(var i=0,length=getLength(list);i<length;i++){if(values){result[list[i]]=values[i];}else{result[list[i][0]]=list[i][1];}} 589return result;} 590function range(start,stop,step){if(stop==null){stop=start||0;start=0;} 591if(!step){step=stop<start?-1:1;}
592var length=Math.max(Math.ceil((stop-start)/step),0);var range=Array(length);for(var idx=0;idx<length;idx++,start+=step){range[idx]=start;} 593return range;} 594function chunk(array,count){if(count==null||count<1)return[];var result=[];var i=0,length=array.length;while(i<length){result.push(slice.call(array,i,i+=count));} 595return result;} 596function chainResult(instance,obj){return instance._chain?_$1(obj).chain():obj;} 597function mixin(obj){each(functions(obj),function(name){var func=_$1[name]=obj[name];_$1.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return chainResult(this,func.apply(_$1,args));};});return _$1;} 598each(['pop','push','reverse','shift','sort','splice','unshift'],function(name){var method=ArrayProto[name];_$1.prototype[name]=function(){var obj=this._wrapped;if(obj!=null){method.apply(obj,arguments);if((name==='shift'||name==='splice')&&obj.length===0){delete obj[0];}} 599return chainResult(this,obj);};});each(['concat','join','slice'],function(name){var method=ArrayProto[name];_$1.prototype[name]=function(){var obj=this._wrapped;if(obj!=null)obj=method.apply(obj,arguments);return chainResult(this,obj);};});var allExports={__proto__:null,VERSION:VERSION,restArguments:restArguments,isObject:isObject,isNull:isNull,isUndefined:isUndefined,isBoolean:isBoolean,isElement:isElement,isString:isString,isNumber:isNumber,isDate:isDate,isRegExp:isRegExp,isError:isError,isSymbol:isSymbol,isArrayBuffer:isArrayBuffer,isDataView:isDataView$1,isArray:isArray,isFunction:isFunction$1,isArguments:isArguments$1,isFinite:isFinite$1,isNaN:isNaN$1,isTypedArray:isTypedArray$1,isEmpty:isEmpty,isMatch:isMatch,isEqual:isEqual,isMap:isMap,isWeakMap:isWeakMap,isSet:isSet,isWeakSet:isWeakSet,keys:keys,allKeys:allKeys,values:values,pairs:pairs,invert:invert,functions:functions,methods:functions,extend:extend,extendOwn:extendOwn,assign:extendOwn,defaults:defaults,create:create,clone:clone,tap:tap,get:get,has:has,mapObject:mapObject,identity:identity,constant:constant,noop:noop,toPath:toPath$1,property:property,propertyOf:propertyOf,matcher:matcher,matches:matcher,times:times,random:random,now:now,escape:_escape,unescape:_unescape,templateSettings:templateSettings,template:template,result:result,uniqueId:uniqueId,chain:chain,iteratee:iteratee,partial:partial,bind:bind,bindAll:bindAll,memoize:memoize,delay:delay,defer:defer,throttle:throttle,debounce:debounce,wrap:wrap,negate:negate,compose:compose,after:after,before:before,once:once,findKey:findKey,findIndex:findIndex,findLastIndex:findLastIndex,sortedIndex:sortedIndex,indexOf:indexOf,lastIndexOf:lastIndexOf,find:find,detect:find,findWhere:findWhere,each:each,forEach:each,map:map,collect:map,reduce:reduce,foldl:reduce,inject:reduce,reduceRight:reduceRight,foldr:reduceRight,filter:filter,select:filter,reject:reject,every:every,all:every,some:some,any:some,contains:contains,includes:contains,include:contains,invoke:invoke,pluck:pluck,where:where,max:max,min:min,shuffle:shuffle,sample:sample,sortBy:sortBy,groupBy:groupBy,indexBy:indexBy,countBy:countBy,partition:partition,toArray:toArray,size:size,pick:pick,omit:omit,first:first,head:first,take:first,initial:initial,last:last,rest:rest,tail:rest,drop:rest,compact:compact,flatten:flatten,without:without,uniq:uniq,unique:uniq,union:union,intersection:intersection,difference:difference,unzip:unzip,transpose:unzip,zip:zip,object:object,range:range,chunk:chunk,mixin:mixin,'default':_$1};var _=mixin(allExports);_._=_;return _;})));; 600 601/* /web/static/lib/underscore.string/lib/underscore.string.js */ 602!function(root,String){'use strict';var nativeTrim=String.prototype.trim;var nativeTrimRight=String.prototype.trimRight;var nativeTrimLeft=String.prototype.trimLeft;var parseNumber=function(source){return source*1||0;};var strRepeat=function(str,qty){if(qty<1)return'';var result='';while(qty>0){if(qty&1)result+=str;qty>>=1,str+=str;} 603return result;};var slice=[].slice;var defaultToWhiteSpace=function(characters){if(characters==null) 604return'\\s';else if(characters.source) 605return characters.source;else 606return'['+_s.escapeRegExp(characters)+']';};function boolMatch(s,matchers){var i,matcher,down=s.toLowerCase();matchers=[].concat(matchers);for(i=0;i<matchers.length;i+=1){matcher=matchers[i];if(!matcher)continue;if(matcher.test&&matcher.test(s))return true;if(matcher.toLowerCase()===down)return true;}} 607var escapeChars={lt:'<',gt:'>',quot:'"',amp:'&',apos:"'"};var reversedEscapeChars={};for(var key in escapeChars)reversedEscapeChars[escapeChars[key]]=key;reversedEscapeChars["'"]='#39';var sprintf=(function(){function get_type(variable){return Object.prototype.toString.call(variable).slice(8,-1).toLowerCase();} 608var str_repeat=strRepeat;var str_format=function(){if(!str_format.cache.hasOwnProperty(arguments[0])){str_format.cache[arguments[0]]=str_format.parse(arguments[0]);} 609return str_format.format.call(null,str_format.cache[arguments[0]],arguments);};str_format.format=function(parse_tree,argv){var cursor=1,tree_length=parse_tree.length,node_type='',arg,output=[],i,k,match,pad,pad_character,pad_length;for(i=0;i<tree_length;i++){node_type=get_type(parse_tree[i]);if(node_type==='string'){output.push(parse_tree[i]);} 610else if(node_type==='array'){match=parse_tree[i];if(match[2]){arg=argv[cursor];for(k=0;k<match[2].length;k++){if(!arg.hasOwnProperty(match[2][k])){throw new Error(sprintf('[_.sprintf] property "%s" does not exist',match[2][k]));} 611arg=arg[match[2][k]];}}else if(match[1]){arg=argv[match[1]];} 612else{arg=argv[cursor++];} 613if(/[^s]/.test(match[8])&&(get_type(arg)!='number')){throw new Error(sprintf('[_.sprintf] expecting number but found %s',get_type(arg)));} 614switch(match[8]){case'b':arg=arg.toString(2);break;case'c':arg=String.fromCharCode(arg);break;case'd':arg=parseInt(arg,10);break;case'e':arg=match[7]?arg.toExponential(match[7]):arg.toExponential();break;case'f':arg=match[7]?parseFloat(arg).toFixed(match[7]):parseFloat(arg);break;case'o':arg=arg.toString(8);break;case's':arg=((arg=String(arg))&&match[7]?arg.substring(0,match[7]):arg);break;case'u':arg=Math.abs(arg);break;case'x':arg=arg.toString(16);break;case'X':arg=arg.toString(16).toUpperCase();break;} 615arg=(/[def]/.test(match[8])&&match[3]&&arg>=0?'+'+arg:arg);pad_character=match[4]?match[4]=='0'?'0':match[4].charAt(1):' ';pad_length=match[6]-String(arg).length;pad=match[6]?str_repeat(pad_character,pad_length):'';output.push(match[5]?arg+pad:pad+arg);}} 616return output.join('');};str_format.cache={};str_format.parse=function(fmt){var _fmt=fmt,match=[],parse_tree=[],arg_names=0;while(_fmt){if((match=/^[^\x25]+/.exec(_fmt))!==null){parse_tree.push(match[0]);} 617else if((match=/^\x25{2}/.exec(_fmt))!==null){parse_tree.push('%');} 618else if((match=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt))!==null){if(match[2]){arg_names|=1;var field_list=[],replacement_field=match[2],field_match=[];if((field_match=/^([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);while((replacement_field=replacement_field.substring(field_match[0].length))!==''){if((field_match=/^\.([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);} 619else if((field_match=/^\[(\d+)\]/.exec(replacement_field))!==null){field_list.push(field_match[1]);} 620else{throw new Error('[_.sprintf] huh?');}}} 621else{throw new Error('[_.sprintf] huh?');} 622match[2]=field_list;} 623else{arg_names|=2;} 624if(arg_names===3){throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported');} 625parse_tree.push(match);} 626else{throw new Error('[_.sprintf] huh?');} 627_fmt=_fmt.substring(match[0].length);} 628return parse_tree;};return str_format;})();var _s={VERSION:'2.3.0',isBlank:function(str){if(str==null)str='';return(/^\s*$/).test(str);},stripTags:function(str){if(str==null)return'';return String(str).replace(/<\/?[^>]+>/g,'');},capitalize:function(str){str=str==null?'':String(str);return str.charAt(0).toUpperCase()+str.slice(1);},chop:function(str,step){if(str==null)return[];str=String(str);step=~~step;return step>0?str.match(new RegExp('.{1,'+step+'}','g')):[str];},clean:function(str){return _s.strip(str).replace(/\s+/g,' ');}
628,count:function(str,substr){if(str==null||substr==null)return 0;str=String(str);substr=String(substr);var count=0,pos=0,length=substr.length;while(true){pos=str.indexOf(substr,pos);if(pos===-1)break;count++;pos+=length;} 629return count;},chars:function(str){if(str==null)return[];return String(str).split('');},swapCase:function(str){if(str==null)return'';return String(str).replace(/\S/g,function(c){return c===c.toUpperCase()?c.toLowerCase():c.toUpperCase();});},escapeHTML:function(str){if(str==null)return'';return String(str).replace(/[&<>"']/g,function(m){return'&'+reversedEscapeChars[m]+';';});},unescapeHTML:function(str){if(str==null)return'';return String(str).replace(/\&([^;]+);/g,function(entity,entityCode){var match;if(entityCode in escapeChars){return escapeChars[entityCode];}else if(match=entityCode.match(/^#x([\da-fA-F]+)$/)){return String.fromCharCode(parseInt(match[1],16));}else if(match=entityCode.match(/^#(\d+)$/)){return String.fromCharCode(~~match[1]);}else{return entity;}});},escapeRegExp:function(str){if(str==null)return'';return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');},splice:function(str,i,howmany,substr){var arr=_s.chars(str);arr.splice(~~i,~~howmany,substr);return arr.join('');},insert:function(str,i,substr){return _s.splice(str,i,0,substr);},include:function(str,needle){if(needle==='')return true;if(str==null)return false;return String(str).indexOf(needle)!==-1;},join:function(){var args=slice.call(arguments),separator=args.shift();if(separator==null)separator='';return args.join(separator);},lines:function(str){if(str==null)return[];return String(str).split("\n");},reverse:function(str){return _s.chars(str).reverse().join('');},startsWith:function(str,starts){if(starts==='')return true;if(str==null||starts==null)return false;str=String(str);starts=String(starts);return str.length>=starts.length&&str.slice(0,starts.length)===starts;},endsWith:function(str,ends){if(ends==='')return true;if(str==null||ends==null)return false;str=String(str);ends=String(ends);return str.length>=ends.length&&str.slice(str.length-ends.length)===ends;},succ:function(str){if(str==null)return'';str=String(str);return str.slice(0,-1)+String.fromCharCode(str.charCodeAt(str.length-1)+1);},titleize:function(str){if(str==null)return'';str=String(str).toLowerCase();return str.replace(/(?:^|\s|-)\S/g,function(c){return c.toUpperCase();});},camelize:function(str){return _s.trim(str).replace(/[-_\s]+(.)?/g,function(match,c){return c?c.toUpperCase():"";});},underscored:function(str){return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g,'$1_$2').replace(/[-\s]+/g,'_').toLowerCase();},dasherize:function(str){return _s.trim(str).replace(/([A-Z])/g,'-$1').replace(/[-_\s]+/g,'-').toLowerCase();},classify:function(str){return _s.titleize(String(str).replace(/[\W_]/g,' ')).replace(/\s/g,'');},humanize:function(str){return _s.capitalize(_s.underscored(str).replace(/_id$/,'').replace(/_/g,' '));},trim:function(str,characters){if(str==null)return'';if(!characters&&nativeTrim)return nativeTrim.call(str);characters=defaultToWhiteSpace(characters);return String(str).replace(new RegExp('\^'+characters+'+|'+characters+'+$','g'),'');},ltrim:function(str,characters){if(str==null)return'';if(!characters&&nativeTrimLeft)return nativeTrimLeft.call(str);characters=defaultToWhiteSpace(characters);return String(str).replace(new RegExp('^'+characters+'+'),'');},rtrim:function(str,characters){if(str==null)return'';if(!characters&&nativeTrimRight)return nativeTrimRight.call(str);characters=defaultToWhiteSpace(characters);return String(str).replace(new RegExp(characters+'+$'),'');},truncate:function(str,length,truncateStr){if(str==null)return'';str=String(str);truncateStr=truncateStr||'...';length=~~length;return str.length>length?str.slice(0,length)+truncateStr:str;},prune:function(str,length,pruneStr){if(str==null)return'';str=String(str);length=~~length;pruneStr=pruneStr!=null?String(pruneStr):'...';if(str.length<=length)return str;var tmpl=function(c){return c.toUpperCase()!==c.toLowerCase()?'A':' ';},template=str.slice(0,length+1).replace(/.(?=\W*\w*$)/g,tmpl);if(template.slice(template.length-2).match(/\w\w/)) 630template=template.replace(/\s*\S+$/,'');else 631template=_s.rtrim(template.slice(0,template.length-1));return(template+pruneStr).length>
631str.length?str:str.slice(0,template.length)+pruneStr;},words:function(str,delimiter){if(_s.isBlank(str))return[];return _s.trim(str,delimiter).split(delimiter||/\s+/);},pad:function(str,length,padStr,type){str=str==null?'':String(str);length=~~length;var padlen=0;if(!padStr) 632padStr=' ';else if(padStr.length>1) 633padStr=padStr.charAt(0);switch(type){case'right':padlen=length-str.length;return str+strRepeat(padStr,padlen);case'both':padlen=length-str.length;return strRepeat(padStr,Math.ceil(padlen/2))+str 634+strRepeat(padStr,Math.floor(padlen/2));default:padlen=length-str.length;return strRepeat(padStr,padlen)+str;}},lpad:function(str,length,padStr){return _s.pad(str,length,padStr);},rpad:function(str,length,padStr){return _s.pad(str,length,padStr,'right');},lrpad:function(str,length,padStr){return _s.pad(str,length,padStr,'both');},sprintf:sprintf,vsprintf:function(fmt,argv){argv.unshift(fmt);return sprintf.apply(null,argv);},toNumber:function(str,decimals){if(!str)return 0;str=_s.trim(str);if(!str.match(/^-?\d+(?:\.\d+)?$/))return NaN;return parseNumber(parseNumber(str).toFixed(~~decimals));},numberFormat:function(number,dec,dsep,tsep){if(isNaN(number)||number==null)return'';number=number.toFixed(~~dec);tsep=typeof tsep=='string'?tsep:',';var parts=number.split('.'),fnums=parts[0],decimals=parts[1]?(dsep||'.')+parts[1]:'';return fnums.replace(/(\d)(?=(?:\d{3})+$)/g,'$1'+tsep)+decimals;},strRight:function(str,sep){if(str==null)return'';str=String(str);sep=sep!=null?String(sep):sep;var pos=!sep?-1:str.indexOf(sep);return~pos?str.slice(pos+sep.length,str.length):str;},strRightBack:function(str,sep){if(str==null)return'';str=String(str);sep=sep!=null?String(sep):sep;var pos=!sep?-1:str.lastIndexOf(sep);return~pos?str.slice(pos+sep.length,str.length):str;},strLeft:function(str,sep){if(str==null)return'';str=String(str);sep=sep!=null?String(sep):sep;var pos=!sep?-1:str.indexOf(sep);return~pos?str.slice(0,pos):str;},strLeftBack:function(str,sep){if(str==null)return'';str+='';sep=sep!=null?''+sep:sep;var pos=str.lastIndexOf(sep);return~pos?str.slice(0,pos):str;},toSentence:function(array,separator,lastSeparator,serial){separator=separator||', ';lastSeparator=lastSeparator||' and ';var a=array.slice(),lastMember=a.pop();if(array.length>2&&serial)lastSeparator=_s.rtrim(separator)+lastSeparator;return a.length?a.join(separator)+lastSeparator+lastMember:lastMember;},toSentenceSerial:function(){var args=slice.call(arguments);args[3]=true;return _s.toSentence.apply(_s,args);},slugify:function(str){if(str==null)return'';var from="Ä Ã Ã¡Ã¤Ã¢Ã£Ã¥Ã¦ÄÄÄèéëêìÃïîÅÅòóöôõøÅÈÈùúüûñçżź",to="aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",regex=new RegExp(defaultToWhiteSpace(from),'g');str=String(str).toLowerCase().replace(regex,function(c){var index=from.indexOf(c);return to.charAt(index)||'-';});return _s.dasherize(str.replace(/[^\w\s-]/g,''));},surround:function(str,wrapper){return[wrapper,str,wrapper].join('');},quote:function(str,quoteChar){return _s.surround(str,quoteChar||'"');},unquote:function(str,quoteChar){quoteChar=quoteChar||'"';if(str[0]===quoteChar&&str[str.length-1]===quoteChar) 635return str.slice(1,str.length-1);else return str;},exports:function(){var result={};for(var prop in this){if(!this.hasOwnProperty(prop)||prop.match(/^(?:include|contains|reverse)$/))continue;result[prop]=this[prop];} 636return result;},repeat:function(str,qty,separator){if(str==null)return'';qty=~~qty;if(separator==null)return strRepeat(String(str),qty);for(var repeat=[];qty>0;repeat[--qty]=str){} 637return repeat.join(separator);},naturalCmp:function(str1,str2){if(str1==str2)return 0;if(!str1)return-1;if(!str2)return 1;var cmpRegex=/(\.\d+)|(\d+)|(\D+)/g,tokens1=String(str1).toLowerCase().match(cmpRegex),tokens2=String(str2).toLowerCase().match(cmpRegex),count=Math.min(tokens1.length,tokens2.length);for(var i=0;i<count;i++){var a=tokens1[i],b=tokens2[i];if(a!==b){var num1=parseInt(a,10);if(!isNaN(num1)){var num2=parseInt(b,10);if(!isNaN(num2)&&num1-num2) 638return num1-num2;} 639return a<b?-1:1;}} 640if(tokens1.length===tokens2.length) 641return tokens1.length-tokens2.length;return str1<str2?-1:1;},levenshtein:function(str1,str2){if(str1==null&&str2==null)return 0;if(str1==null)return String(str2).length;if(str2==null)return String(str1).length;str1=String(str1);str2=String(str2);var current=[],prev,value;for(var i=0;i<=str2.length;i++) 642for(var j=0;j<=str1.length;j++){if(i&&j) 643if(str1.charAt(j-1)===str2.charAt(i-1)) 644value=prev;else 645value=Math.min(current[j],current[j-1],prev)+1;else 646value=i+j;prev=current[j];current[j]=value;} 647return current.pop();},toBoolean:function(str,trueValues,falseValues){if(typeof str==="number")str=""+str;if(typeof str!=="string")return!!str;str=_s.trim(str);if(boolMatch(str,trueValues||["true","1"]))return true;if(boolMatch(str,falseValues||["false","0"]))return false;}};_s.strip=_s.trim;_s.lstrip=_s.ltrim;_s.rstrip=_s.rtrim;_s.center=_s.lrpad;_s.rjust=_s.lpad;_s.ljust=_s.rpad;
vendor: 7,936 bytes, lines 647-723
647_s.contains=_s.include;_s.q=_s.quote;_s.toBool=_s.toBoolean;if(typeof exports!=='undefined'){if(typeof module!=='undefined'&&module.exports) 648module.exports=_s;exports._s=_s;} 649if(typeof define==='function'&&define.amd) 650define('underscore.string',[],function(){return _s;});root._=root._||{};root._.string=root._.str=_s;}(this,String);; 651 652/* /web/static/lib/moment/moment.js */ 653;(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):global.moment=factory()}(this,(function(){'use strict';var hookCallback;function hooks(){return hookCallback.apply(null,arguments);} 654function setHookCallback(callback){hookCallback=callback;} 655function isArray(input){return input instanceof Array||Object.prototype.toString.call(input)==='[object Array]';} 656function isObject(input){return input!=null&&Object.prototype.toString.call(input)==='[object Object]';} 657function isObjectEmpty(obj){if(Object.getOwnPropertyNames){return(Object.getOwnPropertyNames(obj).length===0);}else{var k;for(k in obj){if(obj.hasOwnProperty(k)){return false;}} 658return true;}} 659function isUndefined(input){return input===void 0;} 660function isNumber(input){return typeof input==='number'||Object.prototype.toString.call(input)==='[object Number]';} 661function isDate(input){return input instanceof Date||Object.prototype.toString.call(input)==='[object Date]';} 662function map(arr,fn){var res=[],i;for(i=0;i<arr.length;++i){res.push(fn(arr[i],i));} 663return res;} 664function hasOwnProp(a,b){return Object.prototype.hasOwnProperty.call(a,b);} 665function extend(a,b){for(var i in b){if(hasOwnProp(b,i)){a[i]=b[i];}} 666if(hasOwnProp(b,'toString')){a.toString=b.toString;} 667if(hasOwnProp(b,'valueOf')){a.valueOf=b.valueOf;} 668return a;} 669function createUTC(input,format,locale,strict){return createLocalOrUTC(input,format,locale,strict,true).utc();} 670function defaultParsingFlags(){return{empty:false,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:false,invalidMonth:null,invalidFormat:false,userInvalidated:false,iso:false,parsedDateParts:[],meridiem:null,rfc2822:false,weekdayMismatch:false};} 671function getParsingFlags(m){if(m._pf==null){m._pf=defaultParsingFlags();} 672return m._pf;} 673var some;if(Array.prototype.some){some=Array.prototype.some;}else{some=function(fun){var t=Object(this);var len=t.length>>>0;for(var i=0;i<len;i++){if(i in t&&fun.call(this,t[i],i,t)){return true;}} 674return false;};} 675function isValid(m){if(m._isValid==null){var flags=getParsingFlags(m);var parsedParts=some.call(flags.parsedDateParts,function(i){return i!=null;});var isNowValid=!isNaN(m._d.getTime())&&flags.overflow<0&&!flags.empty&&!flags.invalidMonth&&!flags.invalidWeekday&&!flags.weekdayMismatch&&!flags.nullInput&&!flags.invalidFormat&&!flags.userInvalidated&&(!flags.meridiem||(flags.meridiem&&parsedParts));if(m._strict){isNowValid=isNowValid&&flags.charsLeftOver===0&&flags.unusedTokens.length===0&&flags.bigHour===undefined;} 676if(Object.isFrozen==null||!Object.isFrozen(m)){m._isValid=isNowValid;} 677else{return isNowValid;}} 678return m._isValid;} 679function createInvalid(flags){var m=createUTC(NaN);if(flags!=null){extend(getParsingFlags(m),flags);} 680else{getParsingFlags(m).userInvalidated=true;} 681return m;} 682var momentProperties=hooks.momentProperties=[];function copyConfig(to,from){var i,prop,val;if(!isUndefined(from._isAMomentObject)){to._isAMomentObject=from._isAMomentObject;} 683if(!isUndefined(from._i)){to._i=from._i;} 684if(!isUndefined(from._f)){to._f=from._f;} 685if(!isUndefined(from._l)){to._l=from._l;} 686if(!isUndefined(from._strict)){to._strict=from._strict;} 687if(!isUndefined(from._tzm)){to._tzm=from._tzm;} 688if(!isUndefined(from._isUTC)){to._isUTC=from._isUTC;} 689if(!isUndefined(from._offset)){to._offset=from._offset;} 690if(!isUndefined(from._pf)){to._pf=getParsingFlags(from);} 691if(!isUndefined(from._locale)){to._locale=from._locale;} 692if(momentProperties.length>0){for(i=0;i<momentProperties.length;i++){prop=momentProperties[i];val=from[prop];if(!isUndefined(val)){to[prop]=val;}}} 693return to;} 694var updateInProgress=false;function Moment(config){copyConfig(this,config);this._d=new Date(config._d!=null?config._d.getTime():NaN);if(!this.isValid()){this._d=new Date(NaN);} 695if(updateInProgress===false){updateInProgress=true;hooks.updateOffset(this);updateInProgress=false;}} 696function isMoment(obj){return obj instanceof Moment||(obj!=null&&obj._isAMomentObject!=null);} 697function absFloor(number){if(number<0){return Math.ceil(number)||0;}else{return Math.floor(number);}} 698function toInt(argumentForCoercion){var coercedNumber=+argumentForCoercion,value=0;if(coercedNumber!==0&&isFinite(coercedNumber)){value=absFloor(coercedNumber);} 699return value;} 700function compareArrays(array1,array2,dontConvert){var len=Math.min(array1.length,array2.length),lengthDiff=Math.abs(array1.length-array2.length),diffs=0,i;for(i=0;i<len;i++){if((dontConvert&&array1[i]!==array2[i])||(!dontConvert&&toInt(array1[i])!==toInt(array2[i]))){diffs++;}} 701return diffs+lengthDiff;} 702function warn(msg){if(hooks.suppressDeprecationWarnings===false&&(typeof console!=='undefined')&&console.warn){console.warn('Deprecation warning: '+msg);}} 703function deprecate(msg,fn){var firstTime=true;return extend(function(){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(null,msg);} 704if(firstTime){var args=[];var arg;for(var i=0;i<arguments.length;i++){arg='';if(typeof arguments[i]==='object'){arg+='\n['+i+'] ';for(var key in arguments[0]){arg+=key+': '+arguments[0][key]+', ';} 705arg=arg.slice(0,-2);}else{arg=arguments[i];} 706args.push(arg);} 707warn(msg+'\nArguments: '+Array.prototype.slice.call(args).join('')+'\n'+(new Error()).stack);firstTime=false;} 708return fn.apply(this,arguments);},fn);} 709var deprecations={};function deprecateSimple(name,msg){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(name,msg);} 710if(!deprecations[name]){warn(msg);deprecations[name]=true;}} 711hooks.suppressDeprecationWarnings=false;hooks.deprecationHandler=null;function isFunction(input){return input instanceof Function||Object.prototype.toString.call(input)==='[object Function]';} 712function set(config){var prop,i;for(i in config){prop=config[i];if(isFunction(prop)){this[i]=prop;}else{this['_'+i]=prop;}} 713this._config=config;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+'|'+(/\d{1,2}/).source);} 714function mergeConfigs(parentConfig,childConfig){var res=extend({},parentConfig),prop;for(prop in childConfig){if(hasOwnProp(childConfig,prop)){if(isObject(parentConfig[prop])&&isObject(childConfig[prop])){res[prop]={};extend(res[prop],parentConfig[prop]);extend(res[prop],childConfig[prop]);}else if(childConfig[prop]!=null){res[prop]=childConfig[prop];}else{delete res[prop];}}} 715for(prop in parentConfig){if(hasOwnProp(parentConfig,prop)&&!hasOwnProp(childConfig,prop)&&isObject(parentConfig[prop])){res[prop]=extend({},res[prop]);}} 716return res;} 717function Locale(config){if(config!=null){this.set(config);}} 718var keys;if(Object.keys){keys=Object.keys;}else{keys=function(obj){var i,res=[];for(i in obj){if(hasOwnProp(obj,i)){res.push(i);}} 719return res;};} 720var defaultCalendar={sameDay:'[Today at] LT',nextDay:'[Tomorrow at] LT',nextWeek:'dddd [at] LT',lastDay:'[Yesterday at] LT',lastWeek:'[Last] dddd [at] LT',sameElse:'L'};function calendar(key,mom,now){var output=this._calendar[key]||this._calendar['sameElse'];return isFunction(output)?output.call(mom,now):output;} 721var defaultLongDateFormat={LTS:'h:mm:ss A',LT:'h:mm A',L:'MM/DD/YYYY',LL:'MMMM D, YYYY',LLL:'MMMM D, YYYY h:mm A',LLLL:'dddd, MMMM D, YYYY h:mm A'};function longDateFormat(key){var format=this._longDateFormat[key],formatUpper=this._longDateFormat[key.toUpperCase()];if(format||!formatUpper){return format;} 722this._longDateFormat[key]=formatUpper.replace(/MMMM|MM|DD|dddd/g,function(val){return val.slice(1);});return this._longDateFormat[key];} 723var defaultInvalidDate='Invalid date';
vendor: 10,194 bytes, lines 723-780
723function invalidDate(){return this._invalidDate;} 724var defaultOrdinal='%d';var defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(number){return this._ordinal.replace('%d',number);} 725var defaultRelativeTime={future:'in %s',past:'%s ago',s:'a few seconds',ss:'%d seconds',m:'a minute',mm:'%d minutes',h:'an hour',hh:'%d hours',d:'a day',dd:'%d days',M:'a month',MM:'%d months',y:'a year',yy:'%d years'};function relativeTime(number,withoutSuffix,string,isFuture){var output=this._relativeTime[string];return(isFunction(output))?output(number,withoutSuffix,string,isFuture):output.replace(/%d/i,number);} 726function pastFuture(diff,output){var format=this._relativeTime[diff>0?'future':'past'];return isFunction(format)?format(output):format.replace(/%s/i,output);} 727var aliases={};function addUnitAlias(unit,shorthand){var lowerCase=unit.toLowerCase();aliases[lowerCase]=aliases[lowerCase+'s']=aliases[shorthand]=unit;} 728function normalizeUnits(units){return typeof units==='string'?aliases[units]||aliases[units.toLowerCase()]:undefined;} 729function normalizeObjectUnits(inputObject){var normalizedInput={},normalizedProp,prop;for(prop in inputObject){if(hasOwnProp(inputObject,prop)){normalizedProp=normalizeUnits(prop);if(normalizedProp){normalizedInput[normalizedProp]=inputObject[prop];}}} 730return normalizedInput;} 731var priorities={};function addUnitPriority(unit,priority){priorities[unit]=priority;} 732function getPrioritizedUnits(unitsObj){var units=[];for(var u in unitsObj){units.push({unit:u,priority:priorities[u]});} 733units.sort(function(a,b){return a.priority-b.priority;});return units;} 734function zeroFill(number,targetLength,forceSign){var absNumber=''+Math.abs(number),zerosToFill=targetLength-absNumber.length,sign=number>=0;return(sign?(forceSign?'+':''):'-')+ 735Math.pow(10,Math.max(0,zerosToFill)).toString().substr(1)+absNumber;} 736var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;var localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;var formatFunctions={};var formatTokenFunctions={};function addFormatToken(token,padded,ordinal,callback){var func=callback;if(typeof callback==='string'){func=function(){return this[callback]();};} 737if(token){formatTokenFunctions[token]=func;} 738if(padded){formatTokenFunctions[padded[0]]=function(){return zeroFill(func.apply(this,arguments),padded[1],padded[2]);};} 739if(ordinal){formatTokenFunctions[ordinal]=function(){return this.localeData().ordinal(func.apply(this,arguments),token);};}} 740function removeFormattingTokens(input){if(input.match(/\[[\s\S]/)){return input.replace(/^\[|\]$/g,'');} 741return input.replace(/\\/g,'');} 742function makeFormatFunction(format){var array=format.match(formattingTokens),i,length;for(i=0,length=array.length;i<length;i++){if(formatTokenFunctions[array[i]]){array[i]=formatTokenFunctions[array[i]];}else{array[i]=removeFormattingTokens(array[i]);}} 743return function(mom){var output='',i;for(i=0;i<length;i++){output+=isFunction(array[i])?array[i].call(mom,format):array[i];} 744return output;};} 745function formatMoment(m,format){if(!m.isValid()){return m.localeData().invalidDate();} 746format=expandFormat(format,m.localeData());formatFunctions[format]=formatFunctions[format]||makeFormatFunction(format);return formatFunctions[format](m);} 747function expandFormat(format,locale){var i=5;function replaceLongDateFormatTokens(input){return locale.longDateFormat(input)||input;} 748localFormattingTokens.lastIndex=0;while(i>=0&&localFormattingTokens.test(format)){format=format.replace(localFormattingTokens,replaceLongDateFormatTokens);localFormattingTokens.lastIndex=0;i-=1;} 749return format;} 750var match1=/\d/;var match2=/\d\d/;var match3=/\d{3}/;var match4=/\d{4}/;var match6=/[+-]?\d{6}/;var match1to2=/\d\d?/;var match3to4=/\d\d\d\d?/;var match5to6=/\d\d\d\d\d\d?/;var match1to3=/\d{1,3}/;var match1to4=/\d{1,4}/;var match1to6=/[+-]?\d{1,6}/;var matchUnsigned=/\d+/;var matchSigned=/[+-]?\d+/;var matchOffset=/Z|[+-]\d\d:?\d\d/gi;var matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi;var matchTimestamp=/[+-]?\d+(\.\d{1,3})?/;var matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;var regexes={};function addRegexToken(token,regex,strictRegex){regexes[token]=isFunction(regex)?regex:function(isStrict,localeData){return(isStrict&&strictRegex)?strictRegex:regex;};} 751function getParseRegexForToken(token,config){if(!hasOwnProp(regexes,token)){return new RegExp(unescapeFormat(token));} 752return regexes[token](config._strict,config._locale);} 753function unescapeFormat(s){return regexEscape(s.replace('\\','').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(matched,p1,p2,p3,p4){return p1||p2||p3||p4;}));} 754function regexEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&');} 755var tokens={};function addParseToken(token,callback){var i,func=callback;if(typeof token==='string'){token=[token];} 756if(isNumber(callback)){func=function(input,array){array[callback]=toInt(input);};} 757for(i=0;i<token.length;i++){tokens[token[i]]=func;}} 758function addWeekParseToken(token,callback){addParseToken(token,function(input,array,config,token){config._w=config._w||{};callback(input,config._w,config,token);});} 759function addTimeToArrayFromToken(token,input,config){if(input!=null&&hasOwnProp(tokens,token)){tokens[token](input,config._a,config,token);}} 760var YEAR=0;var MONTH=1;var DATE=2;var HOUR=3;var MINUTE=4;var SECOND=5;var MILLISECOND=6;var WEEK=7;var WEEKDAY=8;addFormatToken('Y',0,0,function(){var y=this.year();return y<=9999?''+y:'+'+y;});addFormatToken(0,['YY',2],0,function(){return this.year()%100;});addFormatToken(0,['YYYY',4],0,'year');addFormatToken(0,['YYYYY',5],0,'year');addFormatToken(0,['YYYYYY',6,true],0,'year');addUnitAlias('year','y');addUnitPriority('year',1);addRegexToken('Y',matchSigned);addRegexToken('YY',match1to2,match2);addRegexToken('YYYY',match1to4,match4);addRegexToken('YYYYY',match1to6,match6);addRegexToken('YYYYYY',match1to6,match6);addParseToken(['YYYYY','YYYYYY'],YEAR);addParseToken('YYYY',function(input,array){array[YEAR]=input.length===2?hooks.parseTwoDigitYear(input):toInt(input);});addParseToken('YY',function(input,array){array[YEAR]=hooks.parseTwoDigitYear(input);});addParseToken('Y',function(input,array){array[YEAR]=parseInt(input,10);});function daysInYear(year){return isLeapYear(year)?366:365;} 761function isLeapYear(year){return(year%4===0&&year%100!==0)||year%400===0;} 762hooks.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2000);};var getSetYear=makeGetSet('FullYear',true);function getIsLeapYear(){return isLeapYear(this.year());} 763function makeGetSet(unit,keepTime){return function(value){if(value!=null){set$1(this,unit,value);hooks.updateOffset(this,keepTime);return this;}else{return get(this,unit);}};} 764function get(mom,unit){return mom.isValid()?mom._d['get'+(mom._isUTC?'UTC':'')+unit]():NaN;} 765function set$1(mom,unit,value){if(mom.isValid()&&!isNaN(value)){if(unit==='FullYear'&&isLeapYear(mom.year())&&mom.month()===1&&mom.date()===29){mom._d['set'+(mom._isUTC?'UTC':'')+unit](value,mom.month(),daysInMonth(value,mom.month()));} 766else{mom._d['set'+(mom._isUTC?'UTC':'')+unit](value);}}} 767function stringGet(units){units=normalizeUnits(units);if(isFunction(this[units])){return this[units]();} 768return this;} 769function stringSet(units,value){if(typeof units==='object'){units=normalizeObjectUnits(units);var prioritized=getPrioritizedUnits(units);for(var i=0;i<prioritized.length;i++){this[prioritized[i].unit](units[prioritized[i].unit]);}}else{units=normalizeUnits(units);if(isFunction(this[units])){return this[units](value);}} 770return this;} 771function mod(n,x){return((n%x)+x)%x;} 772var indexOf;if(Array.prototype.indexOf){indexOf=Array.prototype.indexOf;}else{indexOf=function(o){var i;for(i=0;i<this.length;++i){if(this[i]===o){return i;}} 773return-1;};} 774function daysInMonth(year,month){if(isNaN(year)||isNaN(month)){return NaN;} 775var modMonth=mod(month,12);year+=(month-modMonth)/12;return modMonth===1?(isLeapYear(year)?29:28):(31-modMonth%7%2);} 776addFormatToken('M',['MM',2],'Mo',function(){return this.month()+1;});addFormatToken('MMM',0,0,function(format){return this.localeData().monthsShort(this,format);});addFormatToken('MMMM',0,0,function(format){return this.localeData().months(this,format);});addUnitAlias('month','M');addUnitPriority('month',8);addRegexToken('M',match1to2);addRegexToken('MM',match1to2,match2);addRegexToken('MMM',function(isStrict,locale){return locale.monthsShortRegex(isStrict);});addRegexToken('MMMM',function(isStrict,locale){return locale.monthsRegex(isStrict);});addParseToken(['M','MM'],function(input,array){array[MONTH]=toInt(input)-1;});addParseToken(['MMM','MMMM'],function(input,array,config,token){var month=config._locale.monthsParse(input,token,config._strict);if(month!=null){array[MONTH]=month;}else{getParsingFlags(config).invalidMonth=input;}});var MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;var defaultLocaleMonths='January_February_March_April_May_June_July_August_September_October_November_December'.split('_');function localeMonths(m,format){if(!m){return isArray(this._months)?this._months:this._months['standalone'];} 777return isArray(this._months)?this._months[m.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(format)?'format':'standalone'][m.month()];} 778var defaultLocaleMonthsShort='Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');function localeMonthsShort(m,format){if(!m){return isArray(this._monthsShort)?this._monthsShort:this._monthsShort['standalone'];} 779return isArray(this._monthsShort)?this._monthsShort[m.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(format)?'format':'standalone'][m.month()];} 780function handleStrictParse(monthName,format,strict){var i,ii,mom,llc=monthName.toLocaleLowerCase();if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[];for(i=0;i<12;++i){mom=createUTC([2000,i]);this._shortMonthsParse[i]=this.monthsShort(mom,'').toLocaleLowerCase();this._longMonthsParse[i]=this.months(mom,'').toLocaleLowerCase();}}
vendor: 1,141 bytes, lines 781-787
781if(strict){if(format==='MMM'){ii=indexOf.call(this._shortMonthsParse,llc);return ii!==-1?ii:null;}else{ii=indexOf.call(this._longMonthsParse,llc);return ii!==-1?ii:null;}}else{if(format==='MMM'){ii=indexOf.call(this._shortMonthsParse,llc);if(ii!==-1){return ii;} 782ii=indexOf.call(this._longMonthsParse,llc);return ii!==-1?ii:null;}else{ii=indexOf.call(this._longMonthsParse,llc);if(ii!==-1){return ii;} 783ii=indexOf.call(this._shortMonthsParse,llc);return ii!==-1?ii:null;}}} 784function localeMonthsParse(monthName,format,strict){var i,mom,regex;if(this._monthsParseExact){return handleStrictParse.call(this,monthName,format,strict);} 785if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[];} 786for(i=0;i<12;i++){mom=createUTC([2000,i]);if(strict&&!this._longMonthsParse[i]){this._longMonthsParse[i]=new RegExp('^'+this.months(mom,'').replace('.','')+'$','i');this._shortMonthsParse[i]=new RegExp('^'+this.monthsShort(mom,'').replace('.','')+'$','i');} 787if(!strict&&!this._monthsParse[i]){regex='^'+this.months(mom,'')+'|^'+this.monthsShort(mom,'');this._monthsParse[i]=new RegExp(regex.replace('.',''),'i');}
vendor: 62,661 bytes, lines 788-1150
788if(strict&&format==='MMMM'&&this._longMonthsParse[i].test(monthName)){return i;}else if(strict&&format==='MMM'&&this._shortMonthsParse[i].test(monthName)){return i;}else if(!strict&&this._monthsParse[i].test(monthName)){return i;}}} 789function setMonth(mom,value){var dayOfMonth;if(!mom.isValid()){return mom;} 790if(typeof value==='string'){if(/^\d+$/.test(value)){value=toInt(value);}else{value=mom.localeData().monthsParse(value);if(!isNumber(value)){return mom;}}} 791dayOfMonth=Math.min(mom.date(),daysInMonth(mom.year(),value));mom._d['set'+(mom._isUTC?'UTC':'')+'Month'](value,dayOfMonth);return mom;} 792function getSetMonth(value){if(value!=null){setMonth(this,value);hooks.updateOffset(this,true);return this;}else{return get(this,'Month');}} 793function getDaysInMonth(){return daysInMonth(this.year(),this.month());} 794var defaultMonthsShortRegex=matchWord;function monthsShortRegex(isStrict){if(this._monthsParseExact){if(!hasOwnProp(this,'_monthsRegex')){computeMonthsParse.call(this);} 795if(isStrict){return this._monthsShortStrictRegex;}else{return this._monthsShortRegex;}}else{if(!hasOwnProp(this,'_monthsShortRegex')){this._monthsShortRegex=defaultMonthsShortRegex;} 796return this._monthsShortStrictRegex&&isStrict?this._monthsShortStrictRegex:this._monthsShortRegex;}} 797var defaultMonthsRegex=matchWord;function monthsRegex(isStrict){if(this._monthsParseExact){if(!hasOwnProp(this,'_monthsRegex')){computeMonthsParse.call(this);} 798if(isStrict){return this._monthsStrictRegex;}else{return this._monthsRegex;}}else{if(!hasOwnProp(this,'_monthsRegex')){this._monthsRegex=defaultMonthsRegex;} 799return this._monthsStrictRegex&&isStrict?this._monthsStrictRegex:this._monthsRegex;}} 800function computeMonthsParse(){function cmpLenRev(a,b){return b.length-a.length;} 801var shortPieces=[],longPieces=[],mixedPieces=[],i,mom;for(i=0;i<12;i++){mom=createUTC([2000,i]);shortPieces.push(this.monthsShort(mom,''));longPieces.push(this.months(mom,''));mixedPieces.push(this.months(mom,''));mixedPieces.push(this.monthsShort(mom,''));} 802shortPieces.sort(cmpLenRev);longPieces.sort(cmpLenRev);mixedPieces.sort(cmpLenRev);for(i=0;i<12;i++){shortPieces[i]=regexEscape(shortPieces[i]);longPieces[i]=regexEscape(longPieces[i]);} 803for(i=0;i<24;i++){mixedPieces[i]=regexEscape(mixedPieces[i]);} 804this._monthsRegex=new RegExp('^('+mixedPieces.join('|')+')','i');this._monthsShortRegex=this._monthsRegex;this._monthsStrictRegex=new RegExp('^('+longPieces.join('|')+')','i');this._monthsShortStrictRegex=new RegExp('^('+shortPieces.join('|')+')','i');} 805function createDate(y,m,d,h,M,s,ms){var date=new Date(y,m,d,h,M,s,ms);if(y<100&&y>=0&&isFinite(date.getFullYear())){date.setFullYear(y);} 806return date;} 807function createUTCDate(y){var date=new Date(Date.UTC.apply(null,arguments));if(y<100&&y>=0&&isFinite(date.getUTCFullYear())){date.setUTCFullYear(y);} 808return date;} 809function firstWeekOffset(year,dow,doy){var 810fwd=7+dow-doy,fwdlw=(7+createUTCDate(year,0,fwd).getUTCDay()-dow)%7;return-fwdlw+fwd-1;} 811function dayOfYearFromWeeks(year,week,weekday,dow,doy){var localWeekday=(7+weekday-dow)%7,weekOffset=firstWeekOffset(year,dow,doy),dayOfYear=1+7*(week-1)+localWeekday+weekOffset,resYear,resDayOfYear;if(dayOfYear<=0){resYear=year-1;resDayOfYear=daysInYear(resYear)+dayOfYear;}else if(dayOfYear>daysInYear(year)){resYear=year+1;resDayOfYear=dayOfYear-daysInYear(year);}else{resYear=year;resDayOfYear=dayOfYear;} 812return{year:resYear,dayOfYear:resDayOfYear};} 813function weekOfYear(mom,dow,doy){var weekOffset=firstWeekOffset(mom.year(),dow,doy),week=Math.floor((mom.dayOfYear()-weekOffset-1)/7)+1,resWeek,resYear;if(week<1){resYear=mom.year()-1;resWeek=week+weeksInYear(resYear,dow,doy);}else if(week>weeksInYear(mom.year(),dow,doy)){resWeek=week-weeksInYear(mom.year(),dow,doy);resYear=mom.year()+1;}else{resYear=mom.year();resWeek=week;} 814return{week:resWeek,year:resYear};} 815function weeksInYear(year,dow,doy){var weekOffset=firstWeekOffset(year,dow,doy),weekOffsetNext=firstWeekOffset(year+1,dow,doy);return(daysInYear(year)-weekOffset+weekOffsetNext)/7;} 816addFormatToken('w',['ww',2],'wo','week');addFormatToken('W',['WW',2],'Wo','isoWeek');addUnitAlias('week','w');addUnitAlias('isoWeek','W');addUnitPriority('week',5);addUnitPriority('isoWeek',5);addRegexToken('w',match1to2);addRegexToken('ww',match1to2,match2);addRegexToken('W',match1to2);addRegexToken('WW',match1to2,match2);addWeekParseToken(['w','ww','W','WW'],function(input,week,config,token){week[token.substr(0,1)]=toInt(input);});function localeWeek(mom){return weekOfYear(mom,this._week.dow,this._week.doy).week;} 817var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow;} 818function localeFirstDayOfYear(){return this._week.doy;} 819function getSetWeek(input){var week=this.localeData().week(this);return input==null?week:this.add((input-week)*7,'d');} 820function getSetISOWeek(input){var week=weekOfYear(this,1,4).week;return input==null?week:this.add((input-week)*7,'d');} 821addFormatToken('d',0,'do','day');addFormatToken('dd',0,0,function(format){return this.localeData().weekdaysMin(this,format);});addFormatToken('ddd',0,0,function(format){return this.localeData().weekdaysShort(this,format);});addFormatToken('dddd',0,0,function(format){return this.localeData().weekdays(this,format);});addFormatToken('e',0,0,'weekday');addFormatToken('E',0,0,'isoWeekday');addUnitAlias('day','d');addUnitAlias('weekday','e');addUnitAlias('isoWeekday','E');addUnitPriority('day',11);addUnitPriority('weekday',11);addUnitPriority('isoWeekday',11);addRegexToken('d',match1to2);addRegexToken('e',match1to2);addRegexToken('E',match1to2);addRegexToken('dd',function(isStrict,locale){return locale.weekdaysMinRegex(isStrict);});addRegexToken('ddd',function(isStrict,locale){return locale.weekdaysShortRegex(isStrict);});addRegexToken('dddd',function(isStrict,locale){return locale.weekdaysRegex(isStrict);});addWeekParseToken(['dd','ddd','dddd'],function(input,week,config,token){var weekday=config._locale.weekdaysParse(input,token,config._strict);if(weekday!=null){week.d=weekday;}else{getParsingFlags(config).invalidWeekday=input;}});addWeekParseToken(['d','e','E'],function(input,week,config,token){week[token]=toInt(input);});function parseWeekday(input,locale){if(typeof input!=='string'){return input;} 822if(!isNaN(input)){return parseInt(input,10);} 823input=locale.weekdaysParse(input);if(typeof input==='number'){return input;} 824return null;} 825function parseIsoWeekday(input,locale){if(typeof input==='string'){return locale.weekdaysParse(input)%7||7;} 826return isNaN(input)?null:input;} 827var defaultLocaleWeekdays='Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');function localeWeekdays(m,format){if(!m){return isArray(this._weekdays)?this._weekdays:this._weekdays['standalone'];} 828return isArray(this._weekdays)?this._weekdays[m.day()]:this._weekdays[this._weekdays.isFormat.test(format)?'format':'standalone'][m.day()];} 829var defaultLocaleWeekdaysShort='Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');function localeWeekdaysShort(m){return(m)?this._weekdaysShort[m.day()]:this._weekdaysShort;} 830var defaultLocaleWeekdaysMin='Su_Mo_Tu_We_Th_Fr_Sa'.split('_');function localeWeekdaysMin(m){return(m)?this._weekdaysMin[m.day()]:this._weekdaysMin;} 831function handleStrictParse$1(weekdayName,format,strict){var i,ii,mom,llc=weekdayName.toLocaleLowerCase();if(!this._weekdaysParse){this._weekdaysParse=[];this._shortWeekdaysParse=[];this._minWeekdaysParse=[];for(i=0;i<7;++i){mom=createUTC([2000,1]).day(i);this._minWeekdaysParse[i]=this.weekdaysMin(mom,'').toLocaleLowerCase();this._shortWeekdaysParse[i]=this.weekdaysShort(mom,'').toLocaleLowerCase();this._weekdaysParse[i]=this.weekdays(mom,'').toLocaleLowerCase();}} 832if(strict){if(format==='dddd'){ii=indexOf.call(this._weekdaysParse,llc);return ii!==-1?ii:null;}else if(format==='ddd'){ii=indexOf.call(this._shortWeekdaysParse,llc);return ii!==-1?ii:null;}else{ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null;}}else{if(format==='dddd'){ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii;} 833ii=indexOf.call(this._shortWeekdaysParse,llc);if(ii!==-1){return ii;} 834ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null;}else if(format==='ddd'){ii=indexOf.call(this._shortWeekdaysParse,llc);if(ii!==-1){return ii;} 835ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii;} 836ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null;}else{ii=indexOf.call(this._minWeekdaysParse,llc);if(ii!==-1){return ii;} 837ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii;} 838ii=indexOf.call(this._shortWeekdaysParse,llc);return ii!==-1?ii:null;}}} 839function localeWeekdaysParse(weekdayName,format,strict){var i,mom,regex;if(this._weekdaysParseExact){return handleStrictParse$1.call(this,weekdayName,format,strict);} 840if(!this._weekdaysParse){this._weekdaysParse=[];this._minWeekdaysParse=[];this._shortWeekdaysParse=[];this._fullWeekdaysParse=[];} 841for(i=0;i<7;i++){mom=createUTC([2000,1]).day(i);if(strict&&!this._fullWeekdaysParse[i]){this._fullWeekdaysParse[i]=new RegExp('^'+this.weekdays(mom,'').replace('.','\.?')+'$','i');this._shortWeekdaysParse[i]=new RegExp('^'+this.weekdaysShort(mom,'').replace('.','\.?')+'$','i');this._minWeekdaysParse[i]=new RegExp('^'+this.weekdaysMin(mom,'').replace('.','\.?')+'$','i');} 842if(!this._weekdaysParse[i]){regex='^'+this.weekdays(mom,'')+'|^'+this.weekdaysShort(mom,'')+'|^'+this.weekdaysMin(mom,'');this._weekdaysParse[i]=new RegExp(regex.replace('.',''),'i');} 843if(strict&&format==='dddd'&&this._fullWeekdaysParse[i].test(weekdayName)){return i;}else if(strict&&format==='ddd'&&this._shortWeekdaysParse[i].test(weekdayName)){return i;}else if(strict&&format==='dd'&&this._minWeekdaysParse[i].test(weekdayName)){return i;}else if(!strict&&this._weekdaysParse[i].test(weekdayName)){return i;}}} 844function getSetDayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN;} 845var day=this._isUTC?this._d.getUTCDay():this._d.getDay();if(input!=null){input=parseWeekday(input,this.localeData());return this.add(input-day,'d');}else{return day;}} 846function getSetLocaleDayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN;} 847var weekday=(this.day()+7-this.localeData()._week.dow)%7;return input==null?weekday:this.add(input-weekday,'d');} 848function getSetISODayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN;} 849if(input!=null){var weekday=parseIsoWeekday(input,this.localeData());return this.day(this.day()%7?weekday:weekday-7);}else{return this.day()||7;}} 850var defaultWeekdaysRegex=matchWord;function weekdaysRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,'_weekdaysRegex')){computeWeekdaysParse.call(this);} 851if(isStrict){return this._weekdaysStrictRegex;}else{return this._weekdaysRegex;}}else{if(!hasOwnProp(this,'_weekdaysRegex')){this._weekdaysRegex=defaultWeekdaysRegex;} 852return this._weekdaysStrictRegex&&isStrict?this._weekdaysStrictRegex:this._weekdaysRegex;}} 853var defaultWeekdaysShortRegex=matchWord;function weekdaysShortRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,'_weekdaysRegex')){computeWeekdaysParse.call(this);} 854if(isStrict){return this._weekdaysShortStrictRegex;}else{return this._weekdaysShortRegex;}}else{if(!hasOwnProp(this,'_weekdaysShortRegex')){this._weekdaysShortRegex=defaultWeekdaysShortRegex;} 855return this._weekdaysShortStrictRegex&&isStrict?this._weekdaysShortStrictRegex:this._weekdaysShortRegex;}} 856var defaultWeekdaysMinRegex=matchWord;function weekdaysMinRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,'_weekdaysRegex')){computeWeekdaysParse.call(this);} 857if(isStrict){return this._weekdaysMinStrictRegex;}else{return this._weekdaysMinRegex;}}else{if(!hasOwnProp(this,'_weekdaysMinRegex')){this._weekdaysMinRegex=defaultWeekdaysMinRegex;} 858return this._weekdaysMinStrictRegex&&isStrict?this._weekdaysMinStrictRegex:this._weekdaysMinRegex;}} 859function computeWeekdaysParse(){function cmpLenRev(a,b){return b.length-a.length;} 860var minPieces=[],shortPieces=[],longPieces=[],mixedPieces=[],i,mom,minp,shortp,longp;for(i=0;i<7;i++){mom=createUTC([2000,1]).day(i);minp=this.weekdaysMin(mom,'');shortp=this.weekdaysShort(mom,'');longp=this.weekdays(mom,'');minPieces.push(minp);shortPieces.push(shortp);longPieces.push(longp);mixedPieces.push(minp);mixedPieces.push(shortp);mixedPieces.push(longp);} 861minPieces.sort(cmpLenRev);shortPieces.sort(cmpLenRev);longPieces.sort(cmpLenRev);mixedPieces.sort(cmpLenRev);for(i=0;i<7;i++){shortPieces[i]=regexEscape(shortPieces[i]);longPieces[i]=regexEscape(longPieces[i]);mixedPieces[i]=regexEscape(mixedPieces[i]);} 862this._weekdaysRegex=new RegExp('^('+mixedPieces.join('|')+')','i');this._weekdaysShortRegex=this._weekdaysRegex;this._weekdaysMinRegex=this._weekdaysRegex;this._weekdaysStrictRegex=new RegExp('^('+longPieces.join('|')+')','i');this._weekdaysShortStrictRegex=new RegExp('^('+shortPieces.join('|')+')','i');this._weekdaysMinStrictRegex=new RegExp('^('+minPieces.join('|')+')','i');} 863function hFormat(){return this.hours()%12||12;} 864function kFormat(){return this.hours()||24;} 865addFormatToken('H',['HH',2],0,'hour');addFormatToken('h',['hh',2],0,hFormat);addFormatToken('k',['kk',2],0,kFormat);addFormatToken('hmm',0,0,function(){return''+hFormat.apply(this)+zeroFill(this.minutes(),2);});addFormatToken('hmmss',0,0,function(){return''+hFormat.apply(this)+zeroFill(this.minutes(),2)+ 866zeroFill(this.seconds(),2);});addFormatToken('Hmm',0,0,function(){return''+this.hours()+zeroFill(this.minutes(),2);});addFormatToken('Hmmss',0,0,function(){return''+this.hours()+zeroFill(this.minutes(),2)+ 867zeroFill(this.seconds(),2);});function meridiem(token,lowercase){addFormatToken(token,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),lowercase);});} 868meridiem('a',true);meridiem('A',false);addUnitAlias('hour','h');addUnitPriority('hour',13);function matchMeridiem(isStrict,locale){return locale._meridiemParse;} 869addRegexToken('a',matchMeridiem);addRegexToken('A',matchMeridiem);addRegexToken('H',match1to2);addRegexToken('h',match1to2);addRegexToken('k',match1to2);addRegexToken('HH',match1to2,match2);addRegexToken('hh',match1to2,match2);addRegexToken('kk',match1to2,match2);addRegexToken('hmm',match3to4);addRegexToken('hmmss',match5to6);addRegexToken('Hmm',match3to4);addRegexToken('Hmmss',match5to6);addParseToken(['H','HH'],HOUR);addParseToken(['k','kk'],function(input,array,config){var kInput=toInt(input);array[HOUR]=kInput===24?0:kInput;});addParseToken(['a','A'],function(input,array,config){config._isPm=config._locale.isPM(input);config._meridiem=input;});addParseToken(['h','hh'],function(input,array,config){array[HOUR]=toInt(input);getParsingFlags(config).bigHour=true;});addParseToken('hmm',function(input,array,config){var pos=input.length-2;array[HOUR]=toInt(input.substr(0,pos));array[MINUTE]=toInt(input.substr(pos));getParsingFlags(config).bigHour=true;});addParseToken('hmmss',function(input,array,config){var pos1=input.length-4;var pos2=input.length-2;array[HOUR]=toInt(input.substr(0,pos1));array[MINUTE]=toInt(input.substr(pos1,2));array[SECOND]=toInt(input.substr(pos2));getParsingFlags(config).bigHour=true;});addParseToken('Hmm',function(input,array,config){var pos=input.length-2;array[HOUR]=toInt(input.substr(0,pos));array[MINUTE]=toInt(input.substr(pos));});addParseToken('Hmmss',function(input,array,config){var pos1=input.length-4;var pos2=input.length-2;array[HOUR]=toInt(input.substr(0,pos1));array[MINUTE]=toInt(input.substr(pos1,2));array[SECOND]=toInt(input.substr(pos2));});function localeIsPM(input){return((input+'').toLowerCase().charAt(0)==='p');} 870var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i;function localeMeridiem(hours,minutes,isLower){if(hours>11){return isLower?'pm':'PM';}else{return isLower?'am':'AM';}} 871var getSetHour=makeGetSet('Hours',true);var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse};var locales={};var localeFamilies={};var globalLocale;function normalizeLocale(key){return key?key.toLowerCase().replace('_','-'):key;} 872function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split('-');j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split('-'):null;while(j>0){locale=loadLocale(split.slice(0,j).join('-'));if(locale){return locale;} 873if(next&&next.length>=j&&compareArrays(split,next,true)>=j-1){break;} 874j--;} 875i++;} 876return null;} 877function loadLocale(name){var oldLocale=null;if(!locales[name]&&(typeof module!=='undefined')&&module&&module.exports){try{oldLocale=globalLocale._abbr;var aliasedRequire=require;aliasedRequire('./locale/'+name);getSetGlobalLocale(oldLocale);}catch(e){}} 878return locales[name];} 879function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);} 880else{data=defineLocale(key,values);} 881if(data){globalLocale=data;}} 882return globalLocale._abbr;} 883function defineLocale(name,config){if(config!==null){var parentConfig=baseConfig;config.abbr=name;if(locales[name]!=null){deprecateSimple('defineLocaleOverride','use moment.updateLocale(localeName, config) to change '+'an existing locale. moment.defineLocale(localeName, '+'config) should only be used for creating a new locale '+'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');parentConfig=locales[name]._config;}else if(config.parentLocale!=null){if(locales[config.parentLocale]!=null){parentConfig=locales[config.parentLocale]._config;}else{if(!localeFamilies[config.parentLocale]){localeFamilies[config.parentLocale]=[];} 884localeFamilies[config.parentLocale].push({name:name,config:config});return null;}} 885locales[name]=new Locale(mergeConfigs(parentConfig,config));if(localeFamilies[name]){localeFamilies[name].forEach(function(x){defineLocale(x.name,x.config);});} 886getSetGlobalLocale(name);return locales[name];}else{delete locales[name];return null;}} 887function updateLocale(name,config){if(config!=null){var locale,tmpLocale,parentConfig=baseConfig;tmpLocale=loadLocale(name);if(tmpLocale!=null){parentConfig=tmpLocale._config;} 888config=mergeConfigs(parentConfig,config);locale=new Locale(config);locale.parentLocale=locales[name];locales[name]=locale;getSetGlobalLocale(name);}else{if(locales[name]!=null){if(locales[name].parentLocale!=null){locales[name]=locales[name].parentLocale;}else if(locales[name]!=null){delete locales[name];}}} 889return locales[name];} 890function getLocale(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr;} 891if(!key){return globalLocale;} 892if(!isArray(key)){locale=loadLocale(key);if(locale){return locale;} 893key=[key];} 894return chooseLocale(key);} 895function listLocales(){return keys(locales);} 896function checkOverflow(m){var overflow;var a=m._a;if(a&&getParsingFlags(m).overflow===-2){overflow=a[MONTH]<0||a[MONTH]>11?MONTH:a[DATE]<1||a[DATE]>daysInMonth(a[YEAR],a[MONTH])?DATE:a[HOUR]<0||a[HOUR]>24||(a[HOUR]===24&&(a[MINUTE]!==0||a[SECOND]!==0||a[MILLISECOND]!==0))?HOUR:a[MINUTE]<0||a[MINUTE]>59?MINUTE:a[SECOND]<0||a[SECOND]>59?SECOND:a[MILLISECOND]<0||a[MILLISECOND]>999?MILLISECOND:-1;if(getParsingFlags(m)._overflowDayOfYear&&(overflow<YEAR||overflow>DATE)){overflow=DATE;} 897if(getParsingFlags(m)._overflowWeeks&&overflow===-1){overflow=WEEK;} 898if(getParsingFlags(m)._overflowWeekday&&overflow===-1){overflow=WEEKDAY;} 899getParsingFlags(m).overflow=overflow;} 900return m;} 901function defaults(a,b,c){if(a!=null){return a;} 902if(b!=null){return b;} 903return c;} 904function currentDateArray(config){var nowValue=new Date(hooks.now());if(config._useUTC){return[nowValue.getUTCFullYear(),nowValue.getUTCMonth(),nowValue.getUTCDate()];} 905return[nowValue.getFullYear(),nowValue.getMonth(),nowValue.getDate()];} 906function configFromArray(config){var i,date,input=[],currentDate,yearToUse;if(config._d){return;} 907currentDate=currentDateArray(config);if(config._w&&config._a[DATE]==null&&config._a[MONTH]==null){dayOfYearFromWeekInfo(config);} 908if(config._dayOfYear!=null){yearToUse=defaults(config._a[YEAR],currentDate[YEAR]);if(config._dayOfYear>daysInYear(yearToUse)||config._dayOfYear===0){getParsingFlags(config)._overflowDayOfYear=true;} 909date=createUTCDate(yearToUse,0,config._dayOfYear);config._a[MONTH]=date.getUTCMonth();config._a[DATE]=date.getUTCDate();} 910for(i=0;i<3&&config._a[i]==null;++i){config._a[i]=input[i]=currentDate[i];} 911for(;i<7;i++){config._a[i]=input[i]=(config._a[i]==null)?(i===2?1:0):config._a[i];} 912if(config._a[HOUR]===24&&config._a[MINUTE]===0&&config._a[SECOND]===0&&config._a[MILLISECOND]===0){config._nextDay=true;config._a[HOUR]=0;} 913config._d=(config._useUTC?createUTCDate:createDate).apply(null,input);if(config._tzm!=null){config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm);} 914if(config._nextDay){config._a[HOUR]=24;} 915if(config._w&&typeof config._w.d!=='undefined'&&config._w.d!==config._d.getDay()){getParsingFlags(config).weekdayMismatch=true;}} 916function dayOfYearFromWeekInfo(config){var w,weekYear,week,weekday,dow,doy,temp,weekdayOverflow;w=config._w;if(w.GG!=null||w.W!=null||w.E!=null){dow=1;doy=4;weekYear=defaults(w.GG,config._a[YEAR],weekOfYear(createLocal(),1,4).year);week=defaults(w.W,1);weekday=defaults(w.E,1);if(weekday<1||weekday>7){weekdayOverflow=true;}}else{dow=config._locale._week.dow;doy=config._locale._week.doy;var curWeek=weekOfYear(createLocal(),dow,doy);weekYear=defaults(w.gg,config._a[YEAR],curWeek.year);week=defaults(w.w,curWeek.week);if(w.d!=null){weekday=w.d;if(weekday<0||weekday>6){weekdayOverflow=true;}}else if(w.e!=null){weekday=w.e+dow;if(w.e<0||w.e>6){weekdayOverflow=true;}}else{weekday=dow;}} 917if(week<1||week>weeksInYear(weekYear,dow,doy)){getParsingFlags(config)._overflowWeeks=true;}else if(weekdayOverflow!=null){getParsingFlags(config)._overflowWeekday=true;}else{temp=dayOfYearFromWeeks(weekYear,week,weekday,dow,doy);config._a[YEAR]=temp.year;config._dayOfYear=temp.dayOfYear;}} 918var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;var basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;var tzRegex=/Z|[+-]\d\d(?::?\d\d)?/;var isoDates=[['YYYYYY-MM-DD',/[+-]\d{6}-\d\d-\d\d/],['YYYY-MM-DD',/\d{4}-\d\d-\d\d/],['GGGG-[W]WW-E',/\d{4}-W\d\d-\d/],['GGGG-[W]WW',/\d{4}-W\d\d/,false],['YYYY-DDD',/\d{4}-\d{3}/],['YYYY-MM',/\d{4}-\d\d/,false],['YYYYYYMMDD',/[+-]\d{10}/],['YYYYMMDD',/\d{8}/],['GGGG[W]WWE',/\d{4}W\d{3}/],['GGGG[W]WW',/\d{4}W\d{2}/,false],['YYYYDDD',/\d{7}/]];var isoTimes=[['HH:mm:ss.SSSS',/\d\d:\d\d:\d\d\.\d+/],['HH:mm:ss,SSSS',/\d\d:\d\d:\d\d,\d+/],['HH:mm:ss',/\d\d:\d\d:\d\d/],['HH:mm',/\d\d:\d\d/],['HHmmss.SSSS',/\d\d\d\d\d\d\.\d+/],['HHmmss,SSSS',/\d\d\d\d\d\d,\d+/],['HHmmss',/\d\d\d\d\d\d/],['HHmm',/\d\d\d\d/],['HH',/\d\d/]];var aspNetJsonRegex=/^\/?Date\((\-?\d+)/i;function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}} 919if(dateFormat==null){config._isValid=false;return;} 920if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){timeFormat=(match[2]||' ')+isoTimes[i][0];break;}} 921if(timeFormat==null){config._isValid=false;return;}} 922if(!allowTime&&timeFormat!=null){config._isValid=false;return;} 923if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}} 924config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}} 925var rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function extractFromRFC2822Strings(yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr){var result=[untruncateYear(yearStr),defaultLocaleMonthsShort.indexOf(monthStr),parseInt(dayStr,10),parseInt(hourStr,10),parseInt(minuteStr,10)];if(secondStr){result.push(parseInt(secondStr,10));} 926return result;} 927function untruncateYear(yearStr){var year=parseInt(yearStr,10);if(year<=49){return 2000+year;}else if(year<=999){return 1900+year;} 928return year;} 929function preprocessRFC2822(s){return s.replace(/\([^)]*\)|[\n\t]/g,' ').replace(/(\s\s+)/g,' ').trim();} 930function checkWeekday(weekdayStr,parsedInput,config){if(weekdayStr){var weekdayProvided=defaultLocaleWeekdaysShort.indexOf(weekdayStr),weekdayActual=new Date(parsedInput[0],parsedInput[1],parsedInput[2]).getDay();if(weekdayProvided!==weekdayActual){getParsingFlags(config).weekdayMismatch=true;config._isValid=false;return false;}} 931return true;} 932var obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function calculateOffset(obsOffset,militaryOffset,numOffset){if(obsOffset){return obsOffsets[obsOffset];}else if(militaryOffset){return 0;}else{var hm=parseInt(numOffset,10);var m=hm%100,h=(hm-m)/100;return h*60+m;}} 933function configFromRFC2822(config){var match=rfc2822.exec(preprocessRFC2822(config._i));if(match){var parsedArray=extractFromRFC2822Strings(match[4],match[3],match[2],match[5],match[6],match[7]);if(!checkWeekday(match[1],parsedArray,config)){return;} 934config._a=parsedArray;config._tzm=calculateOffset(match[8],match[9],match[10]);config._d=createUTCDate.apply(null,config._a);config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm);getParsingFlags(config).rfc2822=true;}else{config._isValid=false;}} 935function configFromString(config){var matched=aspNetJsonRegex.exec(config._i);if(matched!==null){config._d=new Date(+matched[1]);return;} 936configFromISO(config);if(config._isValid===false){delete config._isValid;}else{return;} 937configFromRFC2822(config);if(config._isValid===false){delete config._isValid;}else{return;} 938hooks.createFromInputFallback(config);} 939hooks.createFromInputFallback=deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), '+'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are '+'discouraged and will be removed in an upcoming major release. Please refer to '+'http://momentjs.com/guides/#/warnings/js-date/ for more info.',function(config){config._d=new Date(config._i+(config._useUTC?' UTC':''));});hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(config){if(config._f===hooks.ISO_8601){configFromISO(config);return;} 940if(config._f===hooks.RFC_2822){configFromRFC2822(config);return;} 941config._a=[];getParsingFlags(config).empty=true;var string=''+config._i,i,parsedInput,tokens,token,skipped,stringLength=string.length,totalParsedInputLength=0;tokens=expandFormat(config._f,config._locale).match(formattingTokens)||[];for(i=0;i<tokens.length;i++){token=tokens[i];parsedInput=(string.match(getParseRegexForToken(token,config))||[])[0];if(parsedInput){skipped=string.substr(0,string.indexOf(parsedInput));if(skipped.length>0){getParsingFlags(config).unusedInput.push(skipped);} 942string=string.slice(string.indexOf(parsedInput)+parsedInput.length);totalParsedInputLength+=parsedInput.length;} 943if(formatTokenFunctions[token]){if(parsedInput){getParsingFlags(config).empty=false;} 944else{getParsingFlags(config).unusedTokens.push(token);} 945addTimeToArrayFromToken(token,parsedInput,config);} 946else if(config._strict&&!parsedInput){getParsingFlags(config).unusedTokens.push(token);}} 947getParsingFlags(config).charsLeftOver=stringLength-totalParsedInputLength;if(string.length>0){getParsingFlags(config).unusedInput.push(string);} 948if(config._a[HOUR]<=12&&getParsingFlags(config).bigHour===true&&config._a[HOUR]>0){getParsingFlags(config).bigHour=undefined;} 949getParsingFlags(config).parsedDateParts=config._a.slice(0);getParsingFlags(config).meridiem=config._meridiem;config._a[HOUR]=meridiemFixWrap(config._locale,config._a[HOUR],config._meridiem);configFromArray(config);checkOverflow(config);} 950function meridiemFixWrap(locale,hour,meridiem){var isPm;if(meridiem==null){return hour;} 951if(locale.meridiemHour!=null){return locale.meridiemHour(hour,meridiem);}else if(locale.isPM!=null){isPm=locale.isPM(meridiem);if(isPm&&hour<12){hour+=12;} 952if(!isPm&&hour===12){hour=0;} 953return hour;}else{return hour;}} 954function configFromStringAndArray(config){var tempConfig,bestMoment,scoreToBeat,i,currentScore;if(config._f.length===0){getParsingFlags(config).invalidFormat=true;config._d=new Date(NaN);return;} 955for(i=0;i<config._f.length;i++){currentScore=0;tempConfig=copyConfig({},config);if(config._useUTC!=null){tempConfig._useUTC=config._useUTC;} 956tempConfig._f=config._f[i];configFromStringAndFormat(tempConfig);if(!isValid(tempConfig)){continue;} 957currentScore+=getParsingFlags(tempConfig).charsLeftOver;currentScore+=getParsingFlags(tempConfig).unusedTokens.length*10;getParsingFlags(tempConfig).score=currentScore;if(scoreToBeat==null||currentScore<scoreToBeat){scoreToBeat=currentScore;bestMoment=tempConfig;}} 958extend(config,bestMoment||tempConfig);} 959function configFromObject(config){if(config._d){return;} 960var i=normalizeObjectUnits(config._i);config._a=map([i.year,i.month,i.day||i.date,i.hour,i.minute,i.second,i.millisecond],function(obj){return obj&&parseInt(obj,10);});configFromArray(config);} 961function createFromConfig(config){var res=new Moment(checkOverflow(prepareConfig(config)));if(res._nextDay){res.add(1,'d');res._nextDay=undefined;} 962return res;} 963function prepareConfig(config){var input=config._i,format=config._f;config._locale=config._locale||getLocale(config._l);if(input===null||(format===undefined&&input==='')){return createInvalid({nullInput:true});} 964if(typeof input==='string'){config._i=input=config._locale.preparse(input);} 965if(isMoment(input)){return new Moment(checkOverflow(input));}else if(isDate(input)){config._d=input;}else if(isArray(format)){configFromStringAndArray(config);}else if(format){configFromStringAndFormat(config);}else{configFromInput(config);} 966if(!isValid(config)){config._d=null;} 967return config;} 968function configFromInput(config){var input=config._i;if(isUndefined(input)){config._d=new Date(hooks.now());}else if(isDate(input)){config._d=new Date(input.valueOf());}else if(typeof input==='string'){configFromString(config);}else if(isArray(input)){config._a=map(input.slice(0),function(obj){return parseInt(obj,10);});configFromArray(config);}else if(isObject(input)){configFromObject(config);}else if(isNumber(input)){config._d=new Date(input);}else{hooks.createFromInputFallback(config);}} 969function createLocalOrUTC(input,format,locale,strict,isUTC){var c={};if(locale===true||locale===false){strict=locale;locale=undefined;} 970if((isObject(input)&&isObjectEmpty(input))||(isArray(input)&&input.length===0)){input=undefined;} 971c._isAMomentObject=true;c._useUTC=c._isUTC=isUTC;c._l=locale;c._i=input;c._f=format;c._strict=strict;return createFromConfig(c);} 972function createLocal(input,format,locale,strict){return createLocalOrUTC(input,format,locale,strict,false);} 973var prototypeMin=deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',function(){var other=createLocal.apply(null,arguments);if(this.isValid()&&other.isValid()){return other<this?this:other;}else{return createInvalid();}});var prototypeMax=deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',function(){var other=createLocal.apply(null,arguments);if(this.isValid()&&other.isValid()){return other>this?this:other;}else{return createInvalid();}});function pickBy(fn,moments){var res,i;if(moments.length===1&&isArray(moments[0])){moments=moments[0];} 974if(!moments.length){return createLocal();} 975res=moments[0];for(i=1;i<moments.length;++i){if(!moments[i].isValid()||moments[i][fn](res)){res=moments[i];}} 976return res;} 977function min(){var args=[].slice.call(arguments,0);return pickBy('isBefore',args);} 978function max(){var args=[].slice.call(arguments,0);return pickBy('isAfter',args);} 979var now=function(){return Date.now?Date.now():+(new Date());};var ordering=['year','quarter','month','week','day','hour','minute','second','millisecond'];function isDurationValid(m){for(var key in m){if(!(indexOf.call(ordering,key)!==-1&&(m[key]==null||!isNaN(m[key])))){return false;}} 980var unitHasDecimal=false;for(var i=0;i<ordering.length;++i){if(m[ordering[i]]){if(unitHasDecimal){return false;} 981if(parseFloat(m[ordering[i]])!==toInt(m[ordering[i]])){unitHasDecimal=true;}}} 982return true;} 983function isValid$1(){return this._isValid;} 984function createInvalid$1(){return createDuration(NaN);} 985function Duration(duration){var normalizedInput=normalizeObjectUnits(duration),years=normalizedInput.year||0,quarters=normalizedInput.quarter||0,months=normalizedInput.month||0,weeks=normalizedInput.week||0,days=normalizedInput.day||0,hours=normalizedInput.hour||0,minutes=normalizedInput.minute||0,seconds=normalizedInput.second||0,milliseconds=normalizedInput.millisecond||0;this._isValid=isDurationValid(normalizedInput);this._milliseconds=+milliseconds+ 986seconds*1e3+ 987minutes*6e4+ 988hours*1000*60*60;this._days=+days+ 989weeks*7;this._months=+months+ 990quarters*3+ 991years*12;this._data={};this._locale=getLocale();this._bubble();} 992function isDuration(obj){return obj instanceof Duration;} 993function absRound(number){if(number<0){return Math.round(-1*number)*-1;}else{return Math.round(number);}} 994function offset(token,separator){addFormatToken(token,0,0,function(){var offset=this.utcOffset();var sign='+';if(offset<0){offset=-offset;sign='-';} 995return sign+zeroFill(~~(offset/60),2)+separator+zeroFill(~~(offset)%60,2);});} 996offset('Z',':');offset('ZZ','');addRegexToken('Z',matchShortOffset);addRegexToken('ZZ',matchShortOffset);addParseToken(['Z','ZZ'],function(input,array,config){config._useUTC=true;config._tzm=offsetFromString(matchShortOffset,input);});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(matcher,string){var matches=(string||'').match(matcher);if(matches===null){return null;} 997var chunk=matches[matches.length-1]||[];var parts=(chunk+'').match(chunkOffset)||['-',0,0];var minutes=+(parts[1]*60)+toInt(parts[2]);return minutes===0?0:parts[0]==='+'?minutes:-minutes;} 998function cloneWithOffset(input,model){var res,diff;if(model._isUTC){res=model.clone();diff=(isMoment(input)||isDate(input)?input.valueOf():createLocal(input).valueOf())-res.valueOf();res._d.setTime(res._d.valueOf()+diff);hooks.updateOffset(res,false);return res;}else{return createLocal(input).local();}} 999function getDateOffset(m){return-Math.round(m._d.getTimezoneOffset()/15)*15;} 1000hooks.updateOffset=function(){};function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;} 1001if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;} 1002if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);} 1003this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');} 1004if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}} 1005return this;}else{return this._isUTC?offset:getDateOffset(this);}} 1006function getSetZone(input,keepLocalTime){if(input!=null){if(typeof input!=='string'){input=-input;} 1007this.utcOffset(input,keepLocalTime);return this;}else{return-this.utcOffset();}} 1008function setOffsetToUTC(keepLocalTime){return this.utcOffset(0,keepLocalTime);} 1009function setOffsetToLocal(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(getDateOffset(this),'m');}} 1010return this;} 1011function setOffsetToParsedOffset(){if(this._tzm!=null){this.utcOffset(this._tzm,false,true);}else if(typeof this._i==='string'){var tZone=offsetFromString(matchOffset,this._i);if(tZone!=null){this.utcOffset(tZone);} 1012else{this.utcOffset(0,true);}} 1013return this;} 1014function hasAlignedHourOffset(input){if(!this.isValid()){return false;} 1015input=input?createLocal(input).utcOffset():0;return(this.utcOffset()-input)%60===0;} 1016function isDaylightSavingTime(){return(this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset());} 1017function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted)){return this._isDSTShifted;} 1018var c={};copyConfig(c,this);c=prepareConfig(c);if(c._a){var other=c._isUTC?createUTC(c._a):createLocal(c._a);this._isDSTShifted=this.isValid()&&compareArrays(c._a,other.toArray())>0;}else{this._isDSTShifted=false;} 1019return this._isDSTShifted;} 1020function isLocal(){return this.isValid()?!this._isUTC:false;} 1021function isUtcOffset(){return this.isValid()?this._isUTC:false;} 1022function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:false;} 1023var aspNetRegex=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;var isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(input,key){var duration=input,match=null,sign,ret,diffRes;if(isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months};}else if(isNumber(input)){duration={};if(key){duration[key]=input;}else{duration.milliseconds=input;}}else if(!!(match=aspNetRegex.exec(input))){sign=(match[1]==='-')?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(absRound(match[MILLISECOND]*1000))*sign};}else if(!!(match=isoRegex.exec(input))){sign=(match[1]==='-')?-1:(match[1]==='+')?1:1;duration={y:parseIso(match[2],sign),M:parseIso(match[3],sign),w:parseIso(match[4],sign),d:parseIso(match[5],sign),h:parseIso(match[6],sign),m:parseIso(match[7],sign),s:parseIso(match[8],sign)};}else if(duration==null){duration={};}else if(typeof duration==='object'&&('from'in duration||'to'in duration)){diffRes=momentsDifference(createLocal(duration.from),createLocal(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months;} 1024ret=new Duration(duration);if(isDuration(input)&&hasOwnProp(input,'_locale')){ret._locale=input._locale;} 1025return ret;} 1026createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(inp,sign){var res=inp&&parseFloat(inp.replace(',','.'));return(isNaN(res)?0:res)*sign;} 1027function positiveMomentsDifference(base,other){var res={milliseconds:0,months:0};res.months=other.month()-base.month()+ 1028(other.year()-base.year())*12;if(base.clone().add(res.months,'M').isAfter(other)){--res.months;} 1029res.milliseconds=+other-+(base.clone().add(res.months,'M'));return res;} 1030function momentsDifference(base,other){var res;if(!(base.isValid()&&other.isValid())){return{milliseconds:0,months:0};} 1031other=cloneWithOffset(other,base);if(base.isBefore(other)){res=positiveMomentsDifference(base,other);}else{res=positiveMomentsDifference(other,base);res.milliseconds=-res.milliseconds;res.months=-res.months;} 1032return res;} 1033function createAdder(direction,name){return function(val,period){var dur,tmp;if(period!==null&&!isNaN(+period)){deprecateSimple(name,'moment().'+name+'(period, number) is deprecated. Please use moment().'+name+'(number, period). '+'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');tmp=val;val=period;period=tmp;} 1034val=typeof val==='string'?+val:val;dur=createDuration(val,period);addSubtract(this,dur,direction);return this;};} 1035function addSubtract(mom,duration,isAdding,updateOffset){var milliseconds=duration._milliseconds,days=absRound(duration._days),months=absRound(duration._months);if(!mom.isValid()){return;} 1036updateOffset=updateOffset==null?true:updateOffset;if(months){setMonth(mom,get(mom,'Month')+months*isAdding);} 1037if(days){set$1(mom,'Date',get(mom,'Date')+days*isAdding);} 1038if(milliseconds){mom._d.setTime(mom._d.valueOf()+milliseconds*isAdding);} 1039if(updateOffset){hooks.updateOffset(mom,days||months);}} 1040var add=createAdder(1,'add');var subtract=createAdder(-1,'subtract');function getCalendarFormat(myMoment,now){var diff=myMoment.diff(now,'days',true);return diff<-6?'sameElse':diff<-1?'lastWeek':diff<0?'lastDay':diff<1?'sameDay':diff<2?'nextDay':diff<7?'nextWeek':'sameElse';} 1041function calendar$1(time,formats){var now=time||createLocal(),sod=cloneWithOffset(now,this).startOf('day'),format=hooks.calendarFormat(this,sod)||'sameElse';var output=formats&&(isFunction(formats[format])?formats[format].call(this,now):formats[format]);return this.format(output||this.localeData().calendar(format,this,createLocal(now)));} 1042function clone(){return new Moment(this);} 1043function isAfter(input,units){var localInput=isMoment(input)?input:createLocal(input);if(!(this.isValid()&&localInput.isValid())){return false;} 1044units=normalizeUnits(!isUndefined(units)?units:'millisecond');if(units==='millisecond'){return this.valueOf()>localInput.valueOf();}else{return localInput.valueOf()<this.clone().startOf(units).valueOf();}} 1045function isBefore(input,units){var localInput=isMoment(input)?input:createLocal(input);if(!(this.isValid()&&localInput.isValid())){return false;} 1046units=normalizeUnits(!isUndefined(units)?units:'millisecond');if(units==='millisecond'){return this.valueOf()<localInput.valueOf();}else{return this.clone().endOf(units).valueOf()<localInput.valueOf();}} 1047function isBetween(from,to,units,inclusivity){inclusivity=inclusivity||'()';return(inclusivity[0]==='('?this.isAfter(from,units):!this.isBefore(from,units))&&(inclusivity[1]===')'?this.isBefore(to,units):!this.isAfter(to,units));} 1048function isSame(input,units){var localInput=isMoment(input)?input:createLocal(input),inputMs;if(!(this.isValid()&&localInput.isValid())){return false;} 1049units=normalizeUnits(units||'millisecond');if(units==='millisecond'){return this.valueOf()===localInput.valueOf();}else{inputMs=localInput.valueOf();return this.clone().startOf(units).valueOf()<=inputMs&&inputMs<=this.clone().endOf(units).valueOf();}} 1050function isSameOrAfter(input,units){return this.isSame(input,units)||this.isAfter(input,units);} 1051function isSameOrBefore(input,units){return this.isSame(input,units)||this.isBefore(input,units);} 1052function diff(input,units,asFloat){var that,zoneDelta,delta,output;if(!this.isValid()){return NaN;} 1053that=cloneWithOffset(input,this);if(!that.isValid()){return NaN;} 1054zoneDelta=(that.utcOffset()-this.utcOffset())*6e4;units=normalizeUnits(units);switch(units){case'year':output=monthDiff(this,that)/12;break;case'month':output=monthDiff(this,that);break;case'quarter':output=monthDiff(this,that)/3;break;case'second':output=(this-that)/1e3;break;case'minute':output=(this-that)/6e4;break;case'hour':output=(this-that)/36e5;break;case'day':output=(this-that-zoneDelta)/864e5;break;case'week':output=(this-that-zoneDelta)/6048e5;break;default:output=this-that;} 1055return asFloat?output:absFloor(output);} 1056function monthDiff(a,b){var wholeMonthDiff=((b.year()-a.year())*12)+(b.month()-a.month()),anchor=a.clone().add(wholeMonthDiff,'months'),anchor2,adjust;if(b-anchor<0){anchor2=a.clone().add(wholeMonthDiff-1,'months');adjust=(b-anchor)/(anchor-anchor2);}else{anchor2=a.clone().add(wholeMonthDiff+1,'months');adjust=(b-anchor)/(anchor2-anchor);} 1057return-(wholeMonthDiff+adjust)||0;} 1058hooks.defaultFormat='YYYY-MM-DDTHH:mm:ssZ';hooks.defaultFormatUtc='YYYY-MM-DDTHH:mm:ss[Z]';function toString(){return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');} 1059function toISOString(){if(!this.isValid()){return null;} 1060var m=this.clone().utc();if(m.year()<0||m.year()>9999){return formatMoment(m,'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');} 1061if(isFunction(Date.prototype.toISOString)){return this.toDate().toISOString();} 1062return formatMoment(m,'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');} 1063function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';} 1064var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';} 1065var prefix='['+func+'("]';var year=(0<=this.year()&&this.year()<=9999)?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[")]';return this.format(prefix+year+datetime+suffix);} 1066function format(inputString){if(!inputString){inputString=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat;} 1067var output=formatMoment(this,inputString);return this.localeData().postformat(output);} 1068function from(time,withoutSuffix){if(this.isValid()&&((isMoment(time)&&time.isValid())||createLocal(time).isValid())){return createDuration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix);}else{return this.localeData().invalidDate();}} 1069function fromNow(withoutSuffix){return this.from(createLocal(),withoutSuffix);} 1070function to(time,withoutSuffix){if(this.isValid()&&((isMoment(time)&&time.isValid())||createLocal(time).isValid())){return createDuration({from:this,to:time}).locale(this.locale()).humanize(!withoutSuffix);}else{return this.localeData().invalidDate();}} 1071function toNow(withoutSuffix){return this.to(createLocal(),withoutSuffix);} 1072function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;} 1073return this;}} 1074var lang=deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',function(key){if(key===undefined){return this.localeData();}else{return this.locale(key);}});function localeData(){return this._locale;} 1075function startOf(units){units=normalizeUnits(units);switch(units){case'year':this.month(0);case'quarter':case'month':this.date(1);case'week':case'isoWeek':case'day':case'date':this.hours(0);case'hour':this.minutes(0);case'minute':this.seconds(0);case'second':this.milliseconds(0);} 1076if(units==='week'){this.weekday(0);} 1077if(units==='isoWeek'){this.isoWeekday(1);} 1078if(units==='quarter'){this.month(Math.floor(this.month()/3)*3);} 1079return this;} 1080function endOf(units){units=normalizeUnits(units);if(units===undefined||units==='millisecond'){return this;} 1081if(units==='date'){units='day';} 1082return this.startOf(units).add(1,(units==='isoWeek'?'week':units)).subtract(1,'ms');} 1083function valueOf(){return this._d.valueOf()-((this._offset||0)*60000);} 1084function unix(){return Math.floor(this.valueOf()/1000);} 1085function toDate(){return new Date(this.valueOf());} 1086function toArray(){var m=this;return[m.year(),m.month(),m.date(),m.hour(),m.minute(),m.second(),m.millisecond()];} 1087function toObject(){var m=this;return{years:m.year(),months:m.month(),date:m.date(),hours:m.hours(),minutes:m.minutes(),seconds:m.seconds(),milliseconds:m.milliseconds()};} 1088function toJSON(){return this.isValid()?this.toISOString():null;} 1089function isValid$2(){return isValid(this);} 1090function parsingFlags(){return extend({},getParsingFlags(this));} 1091function invalidAt(){return getParsingFlags(this).overflow;} 1092function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict};} 1093addFormatToken(0,['gg',2],0,function(){return this.weekYear()%100;});addFormatToken(0,['GG',2],0,function(){return this.isoWeekYear()%100;});function addWeekYearFormatToken(token,getter){addFormatToken(0,[token,token.length],0,getter);} 1094addWeekYearFormatToken('gggg','weekYear');addWeekYearFormatToken('ggggg','weekYear');addWeekYearFormatToken('GGGG','isoWeekYear');addWeekYearFormatToken('GGGGG','isoWeekYear');addUnitAlias('weekYear','gg');addUnitAlias('isoWeekYear','GG');addUnitPriority('weekYear',1);addUnitPriority('isoWeekYear',1);addRegexToken('G',matchSigned);addRegexToken('g',matchSigned);addRegexToken('GG',match1to2,match2);addRegexToken('gg',match1to2,match2);addRegexToken('GGGG',match1to4,match4);addRegexToken('gggg',match1to4,match4);addRegexToken('GGGGG',match1to6,match6);addRegexToken('ggggg',match1to6,match6);addWeekParseToken(['gggg','ggggg','GGGG','GGGGG'],function(input,week,config,token){week[token.substr(0,2)]=toInt(input);});addWeekParseToken(['gg','GG'],function(input,week,config,token){week[token]=hooks.parseTwoDigitYear(input);});function getSetWeekYear(input){return getSetWeekYearHelper.call(this,input,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy);} 1095function getSetISOWeekYear(input){return getSetWeekYearHelper.call(this,input,this.isoWeek(),this.isoWeekday(),1,4);} 1096function getISOWeeksInYear(){return weeksInYear(this.year(),1,4);} 1097function getWeeksInYear(){var weekInfo=this.localeData()._week;return weeksInYear(this.year(),weekInfo.dow,weekInfo.doy);} 1098function getSetWeekYearHelper(input,week,weekday,dow,doy){var weeksTarget;if(input==null){return weekOfYear(this,dow,doy).year;}else{weeksTarget=weeksInYear(input,dow,doy);if(week>weeksTarget){week=weeksTarget;} 1099return setWeekAll.call(this,input,week,weekday,dow,doy);}} 1100function setWeekAll(weekYear,week,weekday,dow,doy){var dayOfYearData=dayOfYearFromWeeks(weekYear,week,weekday,dow,doy),date=createUTCDate(dayOfYearData.year,0,dayOfYearData.dayOfYear);this.year(date.getUTCFullYear());this.month(date.getUTCMonth());this.date(date.getUTCDate());return this;} 1101addFormatToken('Q',0,'Qo','quarter');addUnitAlias('quarter','Q');addUnitPriority('quarter',7);addRegexToken('Q',match1);addParseToken('Q',function(input,array){array[MONTH]=(toInt(input)-1)*3;});function getSetQuarter(input){return input==null?Math.ceil((this.month()+1)/3):this.month((input-1)*3+this.month()%3);} 1102addFormatToken('D',['DD',2],'Do','date');addUnitAlias('date','D');addUnitPriority('date',9);addRegexToken('D',match1to2);addRegexToken('DD',match1to2,match2);addRegexToken('Do',function(isStrict,locale){return isStrict?(locale._dayOfMonthOrdinalParse||locale._ordinalParse):locale._dayOfMonthOrdinalParseLenient;});addParseToken(['D','DD'],DATE);addParseToken('Do',function(input,array){array[DATE]=toInt(input.match(match1to2)[0],10);});var getSetDayOfMonth=makeGetSet('Date',true);addFormatToken('DDD',['DDDD',3],'DDDo','dayOfYear');addUnitAlias('dayOfYear','DDD');addUnitPriority('dayOfYear',4);addRegexToken('DDD',match1to3);addRegexToken('DDDD',match3);addParseToken(['DDD','DDDD'],function(input,array,config){config._dayOfYear=toInt(input);});function getSetDayOfYear(input){var dayOfYear=Math.round((this.clone().startOf('day')-this.clone().startOf('year'))/864e5)+1;return input==null?dayOfYear:this.add((input-dayOfYear),'d');} 1103addFormatToken('m',['mm',2],0,'minute');addUnitAlias('minute','m');addUnitPriority('minute',14);addRegexToken('m',match1to2);addRegexToken('mm',match1to2,match2);addParseToken(['m','mm'],MINUTE);var getSetMinute=makeGetSet('Minutes',false);addFormatToken('s',['ss',2],0,'second');addUnitAlias('second','s');addUnitPriority('second',15);addRegexToken('s',match1to2);addRegexToken('ss',match1to2,match2);addParseToken(['s','ss'],SECOND);var getSetSecond=makeGetSet('Seconds',false);addFormatToken('S',0,0,function(){return~~(this.millisecond()/100);});addFormatToken(0,['SS',2],0,function(){return~~(this.millisecond()/10);});addFormatToken(0,['SSS',3],0,'millisecond');addFormatToken(0,['SSSS',4],0,function(){return this.millisecond()*10;});addFormatToken(0,['SSSSS',5],0,function(){return this.millisecond()*100;});addFormatToken(0,['SSSSSS',6],0,function(){return this.millisecond()*1000;});addFormatToken(0,['SSSSSSS',7],0,function(){return this.millisecond()*10000;});addFormatToken(0,['SSSSSSSS',8],0,function(){return this.millisecond()*100000;});addFormatToken(0,['SSSSSSSSS',9],0,function(){return this.millisecond()*1000000;});addUnitAlias('millisecond','ms');addUnitPriority('millisecond',16);addRegexToken('S',match1to3,match1);addRegexToken('SS',match1to3,match2);addRegexToken('SSS',match1to3,match3);var token;for(token='SSSS';token.length<=9;token+='S'){addRegexToken(token,matchUnsigned);} 1104function parseMs(input,array){array[MILLISECOND]=toInt(('0.'+input)*1000);} 1105for(token='S';token.length<=9;token+='S'){addParseToken(token,parseMs);} 1106var getSetMillisecond=makeGetSet('Milliseconds',false);addFormatToken('z',0,0,'zoneAbbr');addFormatToken('zz',0,0,'zoneName');function getZoneAbbr(){return this._isUTC?'UTC':'';} 1107function getZoneName(){return this._isUTC?'Coordinated Universal Time':'';} 1108var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone;proto.diff=diff;proto.endOf=endOf;proto.format=format;proto.from=from;proto.fromNow=fromNow;proto.to=to;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter;proto.isBefore=isBefore;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang;proto.locale=locale;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray;proto.toObject=toObject;proto.toDate=toDate;proto.toISOString=toISOString;proto.inspect=inspect;proto.toJSON=toJSON;proto.toString=toString;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate('dates accessor is deprecated. Use date instead.',getSetDayOfMonth);proto.months=deprecate('months accessor is deprecated. Use month instead',getSetMonth);proto.years=deprecate('years accessor is deprecated. Use year instead',getSetYear);proto.zone=deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',getSetZone);proto.isDSTShifted=deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',isDaylightSavingTimeShifted);function createUnix(input){return createLocal(input*1000);} 1109function createInZone(){return createLocal.apply(null,arguments).parseZone();} 1110function preParsePostFormat(string){return string;} 1111var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1(format,index,field,setter){var locale=getLocale();var utc=createUTC().set(setter,index);return locale[field](utc,format);} 1112function listMonthsImpl(format,index,field){if(isNumber(format)){index=format;format=undefined;} 1113format=format||'';if(index!=null){return get$1(format,index,field,'month');} 1114var i;var out=[];for(i=0;i<12;i++){out[i]=get$1(format,i,field,'month');} 1115return out;} 1116function listWeekdaysImpl(localeSorted,format,index,field){if(typeof localeSorted==='boolean'){if(isNumber(format)){index=format;format=undefined;} 1117format=format||'';}else{format=localeSorted;index=format;localeSorted=false;if(isNumber(format)){index=format;format=undefined;} 1118format=format||'';} 1119var locale=getLocale(),shift=localeSorted?locale._week.dow:0;if(index!=null){return get$1(format,(index+shift)%7,field,'day');} 1120var i;var out=[];for(i=0;i<7;i++){out[i]=get$1(format,(i+shift)%7,field,'day');} 1121return out;} 1122function listMonths(format,index){return listMonthsImpl(format,index,'months');} 1123function listMonthsShort(format,index){return listMonthsImpl(format,index,'monthsShort');} 1124function listWeekdays(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,'weekdays');} 1125function listWeekdaysShort(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,'weekdaysShort');} 1126function listWeekdaysMin(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,'weekdaysMin');} 1127getSetGlobalLocale('en',{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(number){var b=number%10,output=(toInt(number%100/10)===1)?'th':(b===1)?'st':(b===2)?'nd':(b===3)?'rd':'th';return number+output;}});hooks.lang=deprecate('moment.lang is deprecated. Use moment.locale instead.',getSetGlobalLocale);hooks.langData=deprecate('moment.langData is deprecated. Use moment.localeData instead.',getLocale);var mathAbs=Math.abs;function abs(){var data=this._data;this._milliseconds=mathAbs(this._milliseconds);this._days=mathAbs(this._days);this._months=mathAbs(this._months);data.milliseconds=mathAbs(data.milliseconds);data.seconds=mathAbs(data.seconds);data.minutes=mathAbs(data.minutes);data.hours=mathAbs(data.hours);data.months=mathAbs(data.months);data.years=mathAbs(data.years);return this;} 1128function addSubtract$1(duration,input,value,direction){var other=createDuration(input,value);duration._milliseconds+=direction*other._milliseconds;duration._days+=direction*other._days;duration._months+=direction*other._months;return duration._bubble();} 1129function add$1(input,value){return addSubtract$1(this,input,value,1);} 1130function subtract$1(input,value){return addSubtract$1(this,input,value,-1);} 1131function absCeil(number){if(number<0){return Math.floor(number);}else{return Math.ceil(number);}} 1132function bubble(){var milliseconds=this._milliseconds;var days=this._days;var months=this._months;var data=this._data;var seconds,minutes,hours,years,monthsFromDays;if(!((milliseconds>=0&&days>=0&&months>=0)||(milliseconds<=0&&days<=0&&months<=0))){milliseconds+=absCeil(monthsToDays(months)+days)*864e5;days=0;months=0;} 1133data.milliseconds=milliseconds%1000;seconds=absFloor(milliseconds/1000);data.seconds=seconds%60;minutes=absFloor(seconds/60);data.minutes=minutes%60;hours=absFloor(minutes/60);data.hours=hours%24;days+=absFloor(hours/24);monthsFromDays=absFloor(daysToMonths(days));months+=monthsFromDays;days-=absCeil(monthsToDays(monthsFromDays));years=absFloor(months/12);months%=12;data.days=days;data.months=months;data.years=years;return this;} 1134function daysToMonths(days){return days*4800/146097;} 1135function monthsToDays(months){return months*146097/4800;} 1136function as(units){if(!this.isValid()){return NaN;} 1137var days;var months;var milliseconds=this._milliseconds;units=normalizeUnits(units);if(units==='month'||units==='year'){days=this._days+milliseconds/864e5;months=this._months+daysToMonths(days);return units==='month'?months:months/12;}else{days=this._days+Math.round(monthsToDays(this._months));switch(units){case'week':return days/7+milliseconds/6048e5;case'day':return days+milliseconds/864e5;case'hour':return days*24+milliseconds/36e5;case'minute':return days*1440+milliseconds/6e4;case'second':return days*86400+milliseconds/1000;case'millisecond':return Math.floor(days*864e5)+milliseconds;default:throw new Error('Unknown unit '+units);}}} 1138function valueOf$1(){if(!this.isValid()){return NaN;} 1139return(this._milliseconds+ 1140this._days*864e5+ 1141(this._months%12)*2592e6+ 1142toInt(this._months/12)*31536e6);} 1143function makeAs(alias){return function(){return this.as(alias);};} 1144var asMilliseconds=makeAs('ms');var asSeconds=makeAs('s');var asMinutes=makeAs('m');var asHours=makeAs('h');var asDays=makeAs('d');var asWeeks=makeAs('w');var asMonths=makeAs('M');var asYears=makeAs('y');function clone$1(){return createDuration(this);} 1145function get$2(units){units=normalizeUnits(units);return this.isValid()?this[units+'s']():NaN;} 1146function makeGetter(name){return function(){return this.isValid()?this._data[name]:NaN;};} 1147var milliseconds=makeGetter('milliseconds');var seconds=makeGetter('seconds');var minutes=makeGetter('minutes');var hours=makeGetter('hours');var days=makeGetter('days');var months=makeGetter('months');var years=makeGetter('years');function weeks(){return absFloor(this.days()/7);} 1148var round=Math.round;var thresholds={ss:44,s:45,m:45,h:22,d:26,M:11};function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture);} 1149function relativeTime$1(posNegDuration,withoutSuffix,locale){var duration=createDuration(posNegDuration).abs();var seconds=round(duration.as('s'));var minutes=round(duration.as('m'));var hours=round(duration.as('h'));var days=round(duration.as('d'));var months=round(duration.as('M'));var years=round(duration.as('y'));var a=seconds<=thresholds.ss&&['s',seconds]||seconds<thresholds.s&&['ss',seconds]||minutes<=1&&['m']||minutes<thresholds.m&&['mm',minutes]||hours<=1&&['h']||hours<thresholds.h&&['hh',hours]||days<=1&&['d']||days<thresholds.d&&['dd',days]||months<=1&&['M']||months<thresholds.M&&['MM',months]||years<=1&&['y']||['yy',years];a[2]=withoutSuffix;a[3]=+posNegDuration>0;a[4]=locale;return substituteTimeAgo.apply(null,a);} 1150function getSetRelativeTimeRounding(roundingFunction){if(roundingFunction===undefined){return round;}
1151if(typeof(roundingFunction)==='function'){round=roundingFunction;return true;} 1152return false;} 1153function getSetRelativeTimeThreshold(threshold,limit){if(thresholds[threshold]===undefined){return false;} 1154if(limit===undefined){return thresholds[threshold];} 1155thresholds[threshold]=limit;if(threshold==='s'){thresholds.ss=limit-1;} 1156return true;} 1157function humanize(withSuffix){if(!this.isValid()){return this.localeData().invalidDate();} 1158var locale=this.localeData();var output=relativeTime$1(this,!withSuffix,locale);if(withSuffix){output=locale.pastFuture(+this,output);} 1159return locale.postformat(output);} 1160var abs$1=Math.abs;function sign(x){return((x>0)-(x<0))||+x;} 1161function toISOString$1(){if(!this.isValid()){return this.localeData().invalidDate();} 1162var seconds=abs$1(this._milliseconds)/1000;var days=abs$1(this._days);var months=abs$1(this._months);var minutes,hours,years;minutes=absFloor(seconds/60);hours=absFloor(minutes/60);seconds%=60;minutes%=60;years=absFloor(months/12);months%=12;var Y=years;var M=months;var D=days;var h=hours;var m=minutes;var s=seconds?seconds.toFixed(3).replace(/\.?0+$/,''):'';var total=this.asSeconds();if(!total){return'P0D';} 1163var totalSign=total<0?'-':'';var ymSign=sign(this._months)!==sign(total)?'-':'';var daysSign=sign(this._days)!==sign(total)?'-':'';var hmsSign=sign(this._milliseconds)!==sign(total)?'-':'';return totalSign+'P'+ 1164(Y?ymSign+Y+'Y':'')+ 1165(M?ymSign+M+'M':'')+ 1166(D?daysSign+D+'D':'')+ 1167((h||m||s)?'T':'')+ 1168(h?hmsSign+h+'H':'')+ 1169(m?hmsSign+m+'M':'')+ 1170(s?hmsSign+s+'S':'');} 1171var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1;proto$2.get=get$2;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale;proto$2.localeData=localeData;proto$2.toIsoString=deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',toISOString$1);proto$2.lang=lang;addFormatToken('X',0,0,'unix');addFormatToken('x',0,0,'valueOf');addRegexToken('x',matchSigned);addRegexToken('X',matchTimestamp);addParseToken('X',function(input,array,config){config._d=new Date(parseFloat(input,10)*1000);});addParseToken('x',function(input,array,config){config._d=new Date(toInt(input));});hooks.version='2.19.3';setHookCallback(createLocal);hooks.fn=proto;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;return hooks;})));; 1172 1173/* /web/static/lib/owl/owl.js */ 1174(function(exports){'use strict';function filterOutModifiersFromData(dataList){dataList=dataList.slice();const modifiers=[];let elm;while((elm=dataList[0])&&typeof elm==="string"){modifiers.push(dataList.shift());} 1175return{modifiers,data:dataList};} 1176const config={shouldNormalizeDom:true,mainEventHandler:(data,ev,currentTarget)=>{if(typeof data==="function"){data(ev);} 1177else if(Array.isArray(data)){data=filterOutModifiersFromData(data).data;data[0](data[1],ev);} 1178return false;},};class VToggler{constructor(key,child){this.key=key;this.child=child;} 1179mount(parent,afterNode){this.parentEl=parent;this.child.mount(parent,afterNode);} 1180moveBeforeDOMNode(node,parent){this.child.moveBeforeDOMNode(node,parent);} 1181moveBeforeVNode(other,afterNode){this.moveBeforeDOMNode((other&&other.firstNode())||afterNode);} 1182patch(other,withBeforeRemove){if(this===other){return;} 1183let child1=this.child;let child2=other.child;if(this.key===other.key){child1.patch(child2,withBeforeRemove);} 1184else{child2.mount(this.parentEl,child1.firstNode());if(withBeforeRemove){child1.beforeRemove();} 1185child1.remove();this.child=child2;this.key=other.key;}} 1186beforeRemove(){this.child.beforeRemove();} 1187remove(){this.child.remove();} 1188firstNode(){return this.child.firstNode();} 1189toString(){return this.child.toString();}} 1190function toggler(key,child){return new VToggler(key,child);}
1191class OwlError extends Error{} 1192const{setAttribute:elemSetAttribute,removeAttribute}=Element.prototype;const tokenList=DOMTokenList.prototype;const tokenListAdd=tokenList.add;const tokenListRemove=tokenList.remove;const isArray=Array.isArray;const{split,trim}=String.prototype;const wordRegexp=/\s+/;function setAttribute(key,value){switch(value){case false:case undefined:removeAttribute.call(this,key);break;case true:elemSetAttribute.call(this,key,"");break;default:elemSetAttribute.call(this,key,value);}} 1193function createAttrUpdater(attr){return function(value){setAttribute.call(this,attr,value);};} 1194function attrsSetter(attrs){if(isArray(attrs)){if(attrs[0]==="class"){setClass.call(this,attrs[1]);} 1195else{setAttribute.call(this,attrs[0],attrs[1]);}} 1196else{for(let k in attrs){if(k==="class"){setClass.call(this,attrs[k]);} 1197else{setAttribute.call(this,k,attrs[k]);}}}} 1198function attrsUpdater(attrs,oldAttrs){if(isArray(attrs)){const name=attrs[0];const val=attrs[1];if(name===oldAttrs[0]){if(val===oldAttrs[1]){return;} 1199if(name==="class"){updateClass.call(this,val,oldAttrs[1]);} 1200else{setAttribute.call(this,name,val);}} 1201else{removeAttribute.call(this,oldAttrs[0]);setAttribute.call(this,name,val);}} 1202else{for(let k in oldAttrs){if(!(k in attrs)){if(k==="class"){updateClass.call(this,"",oldAttrs[k]);} 1203else{removeAttribute.call(this,k);}}} 1204for(let k in attrs){const val=attrs[k];if(val!==oldAttrs[k]){if(k==="class"){updateClass.call(this,val,oldAttrs[k]);} 1205else{setAttribute.call(this,k,val);}}}}} 1206function toClassObj(expr){const result={};switch(typeof expr){case"string":const str=trim.call(expr);if(!str){return{};} 1207let words=split.call(str,wordRegexp);for(let i=0,l=words.length;i<l;i++){result[words[i]]=true;} 1208return result;case"object":for(let key in expr){const value=expr[key];if(value){key=trim.call(key);if(!key){continue;} 1209const words=split.call(key,wordRegexp);for(let word of words){result[word]=value;}}} 1210return result;case"undefined":return{};case"number":return{[expr]:true};default:return{[expr]:true};}} 1211function setClass(val){val=val===""?{}:toClassObj(val);const cl=this.classList;for(let c in val){tokenListAdd.call(cl,c);}} 1212function updateClass(val,oldVal){oldVal=oldVal===""?{}:toClassObj(oldVal);val=val===""?{}:toClassObj(val);const cl=this.classList;for(let c in oldVal){if(!(c in val)){tokenListRemove.call(cl,c);}} 1213for(let c in val){if(!(c in oldVal)){tokenListAdd.call(cl,c);}}} 1214function batched(callback){let scheduled=false;return async(...args)=>{if(!scheduled){scheduled=true;await Promise.resolve();scheduled=false;callback(...args);}};} 1215function inOwnerDocument(el){if(!el){return false;} 1216if(el.ownerDocument.contains(el)){return true;} 1217const rootNode=el.getRootNode();return rootNode instanceof ShadowRoot&&el.ownerDocument.contains(rootNode.host);} 1218function isAttachedToDocument(element,documentElement){let current=element;const shadowRoot=documentElement.defaultView.ShadowRoot;while(current){if(current===documentElement){return true;} 1219if(current.parentNode){current=current.parentNode;} 1220else if(current instanceof shadowRoot&¤t.host){current=current.host;} 1221else{return false;}} 1222return false;} 1223function validateTarget(target){const document=target&&target.ownerDocument;if(document){if(!document.defaultView){throw new OwlError("Cannot mount a component: the target document is not attached to a window (defaultView is missing)");} 1224const HTMLElement=document.defaultView.HTMLElement;if(target instanceof HTMLElement||target instanceof ShadowRoot){if(!isAttachedToDocument(target,document)){throw new OwlError("Cannot mount a component on a detached dom node");} 1225return;}} 1226throw new OwlError("Cannot mount component: the target is not a valid DOM element");} 1227class EventBus extends EventTarget{trigger(name,payload){this.dispatchEvent(new CustomEvent(name,{detail:payload}));}} 1228function whenReady(fn){return new Promise(function(resolve){if(document.readyState!=="loading"){resolve(true);} 1229else{document.addEventListener("DOMContentLoaded",resolve,false);}}).then(fn||function(){});} 1230async function loadFile(url){const result=await fetch(url);if(!result.ok){throw new OwlError("Error while fetching xml templates");} 1231return await result.text();} 1232class Markup extends String{} 1233function htmlEscape(str){if(str instanceof Markup){return str;} 1234if(str===undefined){return markup("");} 1235if(typeof str==="number"){return markup(String(str));} 1236[["&","&"],["<","<"],[">",">"],["'","'"],['"',"""],["`","`"],].forEach((pairs)=>{str=String(str).replace(new RegExp(pairs[0],"g"),pairs[1]);});return markup(str);} 1237function markup(valueOrStrings,...placeholders){if(!Array.isArray(valueOrStrings)){return new Markup(valueOrStrings);} 1238const strings=valueOrStrings;let acc="";let i=0;for(;i<placeholders.length;++i){acc+=strings[i]+htmlEscape(placeholders[i]);} 1239acc+=strings[i];return new Markup(acc);} 1240function createEventHandler(rawEvent){const eventName=rawEvent.split(".")[0];const capture=rawEvent.includes(".capture");
1240if(rawEvent.includes(".synthetic")){return createSyntheticHandler(eventName,capture);} 1241else{return createElementHandler(eventName,capture);}} 1242let nextNativeEventId=1;function createElementHandler(evName,capture=false){let eventKey=`__event__${evName}_${nextNativeEventId++}`;if(capture){eventKey=`${eventKey}_capture`;} 1243function listener(ev){const currentTarget=ev.currentTarget;if(!currentTarget||!inOwnerDocument(currentTarget)) 1244return;const data=currentTarget[eventKey];if(!data) 1245return;config.mainEventHandler(data,ev,currentTarget);} 1246function setup(data){this[eventKey]=data;this.addEventListener(evName,listener,{capture});} 1247function remove(){delete this[eventKey];this.removeEventListener(evName,listener,{capture});} 1248function update(data){this[eventKey]=data;} 1249return{setup,update,remove};} 1250let nextSyntheticEventId=1;function createSyntheticHandler(evName,capture=false){let eventKey=`__event__synthetic_${evName}`;if(capture){eventKey=`${eventKey}_capture`;} 1251setupSyntheticEvent(evName,eventKey,capture);const currentId=nextSyntheticEventId++;function setup(data){const _data=this[eventKey]||{};_data[currentId]=data;this[eventKey]=_data;} 1252function remove(){delete this[eventKey];} 1253return{setup,update:setup,remove};} 1254function nativeToSyntheticEvent(eventKey,event){let dom=event.target;while(dom!==null){const _data=dom[eventKey];if(_data){for(const data of Object.values(_data)){const stopped=config.mainEventHandler(data,event,dom);if(stopped) 1255return;}} 1256dom=dom.parentNode;}} 1257const CONFIGURED_SYNTHETIC_EVENTS={};function setupSyntheticEvent(evName,eventKey,capture=false){if(CONFIGURED_SYNTHETIC_EVENTS[eventKey]){return;} 1258document.addEventListener(evName,(event)=>nativeToSyntheticEvent(eventKey,event),{capture,});CONFIGURED_SYNTHETIC_EVENTS[eventKey]=true;} 1259const getDescriptor$3=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$4=Node.prototype;const nodeInsertBefore$3=nodeProto$4.insertBefore;const nodeSetTextContent$1=getDescriptor$3(nodeProto$4,"textContent").set;const nodeRemoveChild$3=nodeProto$4.removeChild;class VMulti{constructor(children){this.children=children;} 1260mount(parent,afterNode){const children=this.children;const l=children.length;const anchors=new Array(l);for(let i=0;i<l;i++){let child=children[i];if(child){child.mount(parent,afterNode);} 1261else{const childAnchor=document.createTextNode("");anchors[i]=childAnchor;nodeInsertBefore$3.call(parent,childAnchor,afterNode);}} 1262this.anchors=anchors;this.parentEl=parent;} 1263moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;const children=this.children;const anchors=this.anchors;for(let i=0,l=children.length;i<l;i++){let child=children[i];if(child){child.moveBeforeDOMNode(node,parent);} 1264else{const anchor=anchors[i];nodeInsertBefore$3.call(parent,anchor,node);}}} 1265moveBeforeVNode(other,afterNode){if(other){const next=other.children[0];afterNode=(next?next.firstNode():other.anchors[0])||null;} 1266const children=this.children;const parent=this.parentEl;const anchors=this.anchors;for(let i=0,l=children.length;i<l;i++){let child=children[i];if(child){child.moveBeforeVNode(null,afterNode);} 1267else{const anchor=anchors[i];nodeInsertBefore$3.call(parent,anchor,afterNode);}}} 1268patch(other,withBeforeRemove){if(this===other){return;} 1269const children1=this.children;const children2=other.children;const anchors=this.anchors;const parentEl=this.parentEl;for(let i=0,l=children1.length;i<l;i++){const vn1=children1[i];const vn2=children2[i];if(vn1){if(vn2){vn1.patch(vn2,withBeforeRemove);} 1270else{const afterNode=vn1.firstNode();const anchor=document.createTextNode("");anchors[i]=anchor;nodeInsertBefore$3.call(parentEl,anchor,afterNode);
1270if(withBeforeRemove){vn1.beforeRemove();} 1271vn1.remove();children1[i]=undefined;}} 1272else if(vn2){children1[i]=vn2;const anchor=anchors[i];vn2.mount(parentEl,anchor);nodeRemoveChild$3.call(parentEl,anchor);}}} 1273beforeRemove(){const children=this.children;for(let i=0,l=children.length;i<l;i++){const child=children[i];if(child){child.beforeRemove();}}} 1274remove(){const parentEl=this.parentEl;if(this.isOnlyChild){nodeSetTextContent$1.call(parentEl,"");} 1275else{const children=this.children;const anchors=this.anchors;for(let i=0,l=children.length;i<l;i++){const child=children[i];if(child){child.remove();} 1276else{nodeRemoveChild$3.call(parentEl,anchors[i]);}}}} 1277firstNode(){const child=this.children[0];return child?child.firstNode():this.anchors[0];} 1278toString(){return this.children.map((c)=>(c?c.toString():"")).join("");}} 1279function multi(children){return new VMulti(children);} 1280const getDescriptor$2=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$3=Node.prototype;const characterDataProto$1=CharacterData.prototype;const nodeInsertBefore$2=nodeProto$3.insertBefore;const characterDataSetData$1=getDescriptor$2(characterDataProto$1,"data").set;const nodeRemoveChild$2=nodeProto$3.removeChild;class VSimpleNode{constructor(text){this.text=text;} 1281mountNode(node,parent,afterNode){this.parentEl=parent;nodeInsertBefore$2.call(parent,node,afterNode);this.el=node;} 1282moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;nodeInsertBefore$2.call(parent,this.el,node);} 1283moveBeforeVNode(other,afterNode){nodeInsertBefore$2.call(this.parentEl,this.el,other?other.el:afterNode);} 1284beforeRemove(){} 1285remove(){nodeRemoveChild$2.call(this.parentEl,this.el);} 1286firstNode(){return this.el;} 1287toString(){return this.text;}} 1288class VText$1 extends VSimpleNode{mount(parent,afterNode){this.mountNode(document.createTextNode(toText(this.text)),parent,afterNode);} 1289patch(other){const text2=other.text;if(this.text!==text2){characterDataSetData$1.call(this.el,toText(text2));this.text=text2;}}} 1290class VComment extends VSimpleNode{mount(parent,afterNode){this.mountNode(document.createComment(toText(this.text)),parent,afterNode);} 1291patch(){}} 1292function text(str){return new VText$1(str);} 1293function comment(str){return new VComment(str);} 1294function toText(value){switch(typeof value){case"string":return value;case"number":return String(value);case"boolean":return value?"true":"false";default:return value||"";}} 1295const getDescriptor$1=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$2=Node.prototype;const elementProto=Element.prototype;const characterDataProto=CharacterData.prototype;const characterDataSetData=getDescriptor$1(characterDataProto,"data").set;const nodeGetFirstChild=getDescriptor$1(nodeProto$2,"firstChild").get;const nodeGetNextSibling=getDescriptor$1(nodeProto$2,"nextSibling").get;const NO_OP$1=()=>{};function makePropSetter(name){return function setProp(value){this[name]=value===0?0:value?value.valueOf():"";};} 1296const cache$1={};function createBlock(str){if(str in cache$1){return cache$1[str];} 1297const doc=new DOMParser().parseFromString(`<t>${str}</t>`,"text/xml");const node=doc.firstChild.firstChild;if(config.shouldNormalizeDom){normalizeNode(node);} 1298const tree=buildTree(node);const context=buildContext(tree);const template=tree.el;const Block=buildBlock(template,context);cache$1[str]=Block;return Block;} 1299function normalizeNode(node){if(node.nodeType===Node.TEXT_NODE){if(!/\S/.test(node.textContent)){node.remove();return;}} 1300if(node.nodeType===Node.ELEMENT_NODE){if(node.tagName==="pre"){return;}} 1301for(let i=node.childNodes.length-1;i>=0;--i){normalizeNode(node.childNodes.item(i));}} 1302function buildTree(node,parent=null,domParentTree=null){switch(node.nodeType){case Node.ELEMENT_NODE:{let currentNS=domParentTree&&domParentTree.currentNS;const tagName=node.tagName;let el=undefined;const info=[];if(tagName.startsWith("block-text-")){const index=parseInt(tagName.slice(11),10);info.push({type:"text",idx:index});el=document.createTextNode("");} 1303if(tagName.startsWith("block-child-")){if(!domParentTree.isRef){addRef(domParentTree);} 1304const index=parseInt(tagName.slice(12),10);info.push({type:"child",idx:index});
1304el=document.createTextNode("");} 1305currentNS||(currentNS=node.namespaceURI);if(!el){el=currentNS?document.createElementNS(currentNS,tagName):document.createElement(tagName);} 1306if(el instanceof Element){if(!domParentTree){const fragment=document.createElement("template").content;fragment.appendChild(el);} 1307const attrs=node.attributes;for(let i=0;i<attrs.length;i++){const attrName=attrs[i].name;const attrValue=attrs[i].value;if(attrName.startsWith("block-handler-")){const idx=parseInt(attrName.slice(14),10);info.push({type:"handler",idx,event:attrValue,});} 1308else if(attrName.startsWith("block-attribute-")){const idx=parseInt(attrName.slice(16),10);info.push({type:"attribute",idx,name:attrValue,tag:tagName,});} 1309else if(attrName.startsWith("block-property-")){const idx=parseInt(attrName.slice(15),10);info.push({type:"property",idx,name:attrValue,tag:tagName,});} 1310else if(attrName==="block-attributes"){info.push({type:"attributes",idx:parseInt(attrValue,10),});} 1311else if(attrName==="block-ref"){info.push({type:"ref",idx:parseInt(attrValue,10),});} 1312else{el.setAttribute(attrs[i].name,attrValue);}}} 1313const tree={parent,firstChild:null,nextSibling:null,el,info,refN:0,currentNS,};if(node.firstChild){const childNode=node.childNodes[0];if(node.childNodes.length===1&&childNode.nodeType===Node.ELEMENT_NODE&&childNode.tagName.startsWith("block-child-")){const tagName=childNode.tagName;const index=parseInt(tagName.slice(12),10);info.push({idx:index,type:"child",isOnlyChild:true});} 1314else{tree.firstChild=buildTree(node.firstChild,tree,tree);el.appendChild(tree.firstChild.el);let curNode=node.firstChild;let curTree=tree.firstChild;while((curNode=curNode.nextSibling)){curTree.nextSibling=buildTree(curNode,curTree,tree);el.appendChild(curTree.nextSibling.el);curTree=curTree.nextSibling;}}} 1315if(tree.info.length){addRef(tree);} 1316return tree;} 1317case Node.TEXT_NODE:case Node.COMMENT_NODE:{const el=node.nodeType===Node.TEXT_NODE?document.createTextNode(node.textContent):document.createComment(node.textContent);return{parent:parent,firstChild:null,nextSibling:null,el,info:[],refN:0,currentNS:null,};}} 1318throw new OwlError("boom");} 1319function addRef(tree){tree.isRef=true;do{tree.refN++;}while((tree=tree.parent));} 1320function parentTree(tree){let parent=tree.parent;while(parent&&parent.nextSibling===tree){tree=parent;parent=parent.parent;} 1321return parent;} 1322function buildContext(tree,ctx,fromIdx){if(!ctx){const children=new Array(tree.info.filter((v)=>v.type==="child").length);ctx={collectors:[],locations:[],children,cbRefs:[],refN:tree.refN,refList:[]};fromIdx=0;} 1323if(tree.refN){const initialIdx=fromIdx;const isRef=tree.isRef;const firstChild=tree.firstChild?tree.firstChild.refN:0;const nextSibling=tree.nextSibling?tree.nextSibling.refN:0;
1323if(isRef){for(let info of tree.info){info.refIdx=initialIdx;} 1324tree.refIdx=initialIdx;updateCtx(ctx,tree);fromIdx++;} 1325if(nextSibling){const idx=fromIdx+firstChild;ctx.collectors.push({idx,prevIdx:initialIdx,getVal:nodeGetNextSibling});buildContext(tree.nextSibling,ctx,idx);} 1326if(firstChild){ctx.collectors.push({idx:fromIdx,prevIdx:initialIdx,getVal:nodeGetFirstChild});buildContext(tree.firstChild,ctx,fromIdx);}} 1327return ctx;} 1328function updateCtx(ctx,tree){for(let info of tree.info){switch(info.type){case"text":ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:setText,updateData:setText,});break;case"child":if(info.isOnlyChild){ctx.children[info.idx]={parentRefIdx:info.refIdx,isOnlyChild:true,};} 1329else{ctx.children[info.idx]={parentRefIdx:parentTree(tree).refIdx,afterRefIdx:info.refIdx,};} 1330break;case"property":{const refIdx=info.refIdx;const setProp=makePropSetter(info.name);ctx.locations.push({idx:info.idx,refIdx,setData:setProp,updateData:setProp,});break;} 1331case"attribute":{const refIdx=info.refIdx;let updater;let setter;if(info.name==="class"){setter=setClass;updater=updateClass;} 1332else{setter=createAttrUpdater(info.name);updater=setter;} 1333ctx.locations.push({idx:info.idx,refIdx,setData:setter,updateData:updater,});break;} 1334case"attributes":ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:attrsSetter,updateData:attrsUpdater,});break;case"handler":{const{setup,update}=createEventHandler(info.event);ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:setup,updateData:update,});break;} 1335case"ref":const index=ctx.cbRefs.push(info.idx)-1;ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:makeRefSetter(index,ctx.refList),updateData:NO_OP$1,});}}} 1336function buildBlock(template,ctx){let B=createBlockClass(template,ctx);if(ctx.cbRefs.length){const cbRefs=ctx.cbRefs;const refList=ctx.refList;let cbRefsNumber=cbRefs.length;B=class extends B{mount(parent,afterNode){refList.push(new Array(cbRefsNumber));super.mount(parent,afterNode);for(let cbRef of refList.pop()){cbRef();}} 1337remove(){super.remove();for(let cbRef of cbRefs){let fn=this.data[cbRef];fn(null);}}};} 1338if(ctx.children.length){B=class extends B{constructor(data,children){super(data);this.children=children;}};B.prototype.beforeRemove=VMulti.prototype.beforeRemove;return(data,children=[])=>new B(data,children);} 1339return(data)=>new B(data);} 1340function createBlockClass(template,ctx){const{refN,collectors,children}=ctx;const colN=collectors.length;ctx.locations.sort((a,b)=>a.idx-b.idx);const locations=ctx.locations.map((loc)=>({refIdx:loc.refIdx,setData:loc.setData,updateData:loc.updateData,}));const locN=locations.length;const childN=children.length;const childrenLocs=children;const isDynamic=refN>0;const nodeCloneNode=nodeProto$2.cloneNode;const nodeInsertBefore=nodeProto$2.insertBefore;const elementRemove=elementProto.remove;class Block{constructor(data){this.data=data;} 1341beforeRemove(){} 1342remove(){elementRemove.call(this.el);} 1343firstNode(){return this.el;} 1344moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;nodeInsertBefore.call(parent,this.el,node);} 1345moveBeforeVNode(other,afterNode){nodeInsertBefore.call(this.parentEl,this.el,other?other.el:afterNode);} 1346toString(){const div=document.createElement("div");this.mount(div,null);return div.innerHTML;} 1347mount(parent,afterNode){const el=nodeCloneNode.call(template,true);nodeInsertBefore.call(parent,el,afterNode);this.el=el;this.parentEl=parent;} 1348patch(other,withBeforeRemove){}} 1349if(isDynamic){Block.prototype.mount=function mount(parent,afterNode){const el=nodeCloneNode.call(template,true);const refs=new Array(refN);this.refs=refs;refs[0]=el;for(let i=0;i<colN;i++){const w=collectors[i];refs[w.idx]=w.getVal.call(refs[w.prevIdx]);} 1350if(locN){const data=this.data;for(let i=0;i<locN;i++){const loc=locations[i];loc.setData.call(refs[loc.refIdx],data[i]);}} 1351nodeInsertBefore.call(parent,el,afterNode);
1351if(childN){const children=this.children;for(let i=0;i<childN;i++){const child=children[i];if(child){const loc=childrenLocs[i];const afterNode=loc.afterRefIdx?refs[loc.afterRefIdx]:null;child.isOnlyChild=loc.isOnlyChild;child.mount(refs[loc.parentRefIdx],afterNode);}}} 1352this.el=el;this.parentEl=parent;};Block.prototype.patch=function patch(other,withBeforeRemove){if(this===other){return;} 1353const refs=this.refs;if(locN){const data1=this.data;const data2=other.data;for(let i=0;i<locN;i++){const val1=data1[i];const val2=data2[i];if(val1!==val2){const loc=locations[i];loc.updateData.call(refs[loc.refIdx],val2,val1);}} 1354this.data=data2;} 1355if(childN){let children1=this.children;const children2=other.children;for(let i=0;i<childN;i++){const child1=children1[i];const child2=children2[i];if(child1){if(child2){child1.patch(child2,withBeforeRemove);} 1356else{if(withBeforeRemove){child1.beforeRemove();} 1357child1.remove();children1[i]=undefined;}} 1358else if(child2){const loc=childrenLocs[i];const afterNode=loc.afterRefIdx?refs[loc.afterRefIdx]:null;child2.mount(refs[loc.parentRefIdx],afterNode);children1[i]=child2;}}}};} 1359return Block;} 1360function setText(value){characterDataSetData.call(this,toText(value));} 1361function makeRefSetter(index,refs){return function setRef(fn){refs[refs.length-1][index]=()=>fn(this);};} 1362const getDescriptor=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$1=Node.prototype;const nodeInsertBefore$1=nodeProto$1.insertBefore;const nodeAppendChild=nodeProto$1.appendChild;const nodeRemoveChild$1=nodeProto$1.removeChild;const nodeSetTextContent=getDescriptor(nodeProto$1,"textContent").set;class VList{constructor(children){this.children=children;} 1363mount(parent,afterNode){const children=this.children;
1363const _anchor=document.createTextNode("");this.anchor=_anchor;nodeInsertBefore$1.call(parent,_anchor,afterNode);const l=children.length;if(l){const mount=children[0].mount;for(let i=0;i<l;i++){mount.call(children[i],parent,_anchor);}} 1364this.parentEl=parent;} 1365moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;const children=this.children;for(let i=0,l=children.length;i<l;i++){children[i].moveBeforeDOMNode(node,parent);} 1366parent.insertBefore(this.anchor,node);} 1367moveBeforeVNode(other,afterNode){if(other){const next=other.children[0];afterNode=(next?next.firstNode():other.anchor)||null;} 1368const children=this.children;for(let i=0,l=children.length;i<l;i++){children[i].moveBeforeVNode(null,afterNode);} 1369this.parentEl.insertBefore(this.anchor,afterNode);} 1370patch(other,withBeforeRemove){if(this===other){return;} 1371const ch1=this.children;const ch2=other.children;if(ch2.length===0&&ch1.length===0){return;} 1372this.children=ch2;const proto=ch2[0]||ch1[0];const{mount:cMount,patch:cPatch,remove:cRemove,beforeRemove,moveBeforeVNode:cMoveBefore,firstNode:cFirstNode,}=proto;const _anchor=this.anchor;const isOnlyChild=this.isOnlyChild;const parent=this.parentEl;if(ch2.length===0&&isOnlyChild){if(withBeforeRemove){for(let i=0,l=ch1.length;i<l;i++){beforeRemove.call(ch1[i]);}} 1373nodeSetTextContent.call(parent,"");nodeAppendChild.call(parent,_anchor);return;} 1374let startIdx1=0;let startIdx2=0;let startVn1=ch1[0];let startVn2=ch2[0];let endIdx1=ch1.length-1;let endIdx2=ch2.length-1;let endVn1=ch1[endIdx1];let endVn2=ch2[endIdx2];let mapping=undefined;while(startIdx1<=endIdx1&&startIdx2<=endIdx2){if(startVn1===null){startVn1=ch1[++startIdx1];continue;} 1375if(endVn1===null){endVn1=ch1[--endIdx1];continue;} 1376let startKey1=startVn1.key;let startKey2=startVn2.key;if(startKey1===startKey2){cPatch.call(startVn1,startVn2,withBeforeRemove);ch2[startIdx2]=startVn1;startVn1=ch1[++startIdx1];startVn2=ch2[++startIdx2];continue;} 1377let endKey1=endVn1.key;let endKey2=endVn2.key;if(endKey1===endKey2){cPatch.call(endVn1,endVn2,withBeforeRemove);ch2[endIdx2]=endVn1;endVn1=ch1[--endIdx1];endVn2=ch2[--endIdx2];continue;} 1378if(startKey1===endKey2){cPatch.call(startVn1,endVn2,withBeforeRemove);ch2[endIdx2]=startVn1;const nextChild=ch2[endIdx2+1];cMoveBefore.call(startVn1,nextChild,_anchor);startVn1=ch1[++startIdx1];endVn2=ch2[--endIdx2];continue;} 1379if(endKey1===startKey2){cPatch.call(endVn1,startVn2,withBeforeRemove);ch2[startIdx2]=endVn1;const nextChild=ch1[startIdx1];cMoveBefore.call(endVn1,nextChild,_anchor);endVn1=ch1[--endIdx1];startVn2=ch2[++startIdx2];continue;} 1380mapping=mapping||createMapping(ch1,startIdx1,endIdx1);let idxInOld=mapping[startKey2];if(idxInOld===undefined){cMount.call(startVn2,parent,cFirstNode.call(startVn1)||null);} 1381else{const elmToMove=ch1[idxInOld];cMoveBefore.call(elmToMove,startVn1,null);cPatch.call(elmToMove,startVn2,withBeforeRemove);ch2[startIdx2]=elmToMove;ch1[idxInOld]=null;} 1382startVn2=ch2[++startIdx2];} 1383if(startIdx1<=endIdx1||startIdx2<=endIdx2){if(startIdx1>endIdx1){const nextChild=ch2[endIdx2+1];const anchor=nextChild?cFirstNode.call(nextChild)||null:_anchor;for(let i=startIdx2;i<=endIdx2;i++){cMount.call(ch2[i],parent,anchor);}} 1384else{for(let i=startIdx1;i<=endIdx1;i++){let ch=ch1[i];if(ch){if(withBeforeRemove){beforeRemove.call(ch);} 1385cRemove.call(ch);}}}}} 1386beforeRemove(){const children=this.children;const l=children.length;if(l){const beforeRemove=children[0].beforeRemove;for(let i=0;i<l;i++){beforeRemove.call(children[i]);}}} 1387remove(){const{parentEl,anchor}=this;if(this.isOnlyChild){nodeSetTextContent.call(parentEl,"");} 1388else{const children=this.children;const l=children.length;if(l){const remove=children[0].remove;for(let i=0;i<l;i++){remove.call(children[i]);}} 1389nodeRemoveChild$1.call(parentEl,anchor);}} 1390firstNode(){const child=this.children[0];return child?child.firstNode():undefined;} 1391toString(){return this.children.map((c)=>c.toString()).join("");}} 1392function list(children){return new VList(children);} 1393function createMapping(ch1,startIdx1,endIdx2){let mapping={};for(let i=startIdx1;i<=endIdx2;i++){mapping[ch1[i].key]=i;} 1394return mapping;} 1395const nodeProto=Node.prototype;const nodeInsertBefore=nodeProto.insertBefore;const nodeRemoveChild=nodeProto.removeChild;class VHtml{constructor(html){this.content=[];this.html=html;} 1396mount(parent,afterNode){this.parentEl=parent;const template=document.createElement("template");template.innerHTML=this.html;this.content=[...template.content.childNodes];for(let elem of this.content){nodeInsertBefore.call(parent,elem,afterNode);} 1397if(!this.content.length){const textNode=document.createTextNode("");this.content.push(textNode);nodeInsertBefore.call(parent,textNode,afterNode);}} 1398moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;for(let elem of this.content){nodeInsertBefore.call(parent,elem,
1398node);}} 1399moveBeforeVNode(other,afterNode){const target=other?other.content[0]:afterNode;this.moveBeforeDOMNode(target);} 1400patch(other){if(this===other){return;} 1401const html2=other.html;if(this.html!==html2){const parent=this.parentEl;const afterNode=this.content[0];const template=document.createElement("template");template.innerHTML=html2;const content=[...template.content.childNodes];for(let elem of content){nodeInsertBefore.call(parent,elem,afterNode);} 1402if(!content.length){const textNode=document.createTextNode("");content.push(textNode);nodeInsertBefore.call(parent,textNode,afterNode);} 1403this.remove();this.content=content;this.html=other.html;}} 1404beforeRemove(){} 1405remove(){const parent=this.parentEl;for(let elem of this.content){nodeRemoveChild.call(parent,elem);}} 1406firstNode(){return this.content[0];} 1407toString(){return this.html;}} 1408function html(str){return new VHtml(str);} 1409function createCatcher(eventsSpec){const n=Object.keys(eventsSpec).length;class VCatcher{constructor(child,handlers){this.handlerFns=[];this.afterNode=null;this.child=child;this.handlerData=handlers;} 1410mount(parent,afterNode){this.parentEl=parent;this.child.mount(parent,afterNode);this.afterNode=document.createTextNode("");parent.insertBefore(this.afterNode,afterNode);this.wrapHandlerData();for(let name in eventsSpec){const index=eventsSpec[name];const handler=createEventHandler(name);this.handlerFns[index]=handler;handler.setup.call(parent,this.handlerData[index]);}} 1411wrapHandlerData(){for(let i=0;i<n;i++){let handler=this.handlerData[i];let idx=handler.length-2;let origFn=handler[idx];const self=this;handler[idx]=function(ev){const target=ev.target;let currentNode=self.child.firstNode();const afterNode=self.afterNode;while(currentNode&¤tNode!==afterNode){if(currentNode.contains(target)){return origFn.call(this,ev);} 1412currentNode=currentNode.nextSibling;}};}} 1413moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;this.child.moveBeforeDOMNode(node,parent);parent.insertBefore(this.afterNode,node);} 1414moveBeforeVNode(other,afterNode){if(other){afterNode=other.firstNode()||afterNode;} 1415this.child.moveBeforeVNode(other?other.child:null,afterNode);this.parentEl.insertBefore(this.afterNode,afterNode);} 1416patch(other,withBeforeRemove){if(this===other){return;} 1417this.handlerData=other.handlerData;this.wrapHandlerData();for(let i=0;i<n;i++){this.handlerFns[i].update.call(this.parentEl,this.handlerData[i]);} 1418this.child.patch(other.child,withBeforeRemove);} 1419beforeRemove(){this.child.beforeRemove();} 1420remove(){for(let i=0;i<n;i++){this.handlerFns[i].remove.call(this.parentEl);} 1421this.child.remove();this.afterNode.remove();} 1422firstNode(){return this.child.firstNode();} 1423toString(){return this.child.toString();}} 1424return function(child,handlers){return new VCatcher(child,handlers);};} 1425function mount$1(vnode,fixture,afterNode=null){vnode.mount(fixture,afterNode);} 1426function patch(vnode1,vnode2,withBeforeRemove=false){vnode1.patch(vnode2,withBeforeRemove);} 1427function remove(vnode,withBeforeRemove=false){if(withBeforeRemove){vnode.beforeRemove();} 1428vnode.remove();} 1429const fibersInError=new WeakMap();const nodeErrorHandlers=new WeakMap();function _handleError(node,error){if(!node){return false;} 1430const fiber=node.fiber;if(fiber){fibersInError.set(fiber,error);} 1431const errorHandlers=nodeErrorHandlers.get(node);if(errorHandlers){let handled=false;for(let i=errorHandlers.length-1;i>=0;i--){try{errorHandlers[i](error);handled=true;break;} 1432catch(e){error=e;}} 1433if(handled){return true;}} 1434return _handleError(node.parent,error);} 1435function handleError(params){let{error}=params;if(!(error instanceof OwlError)){error=Object.assign(new OwlError(`An error occured in the owl lifecycle (see this Error's "cause" property)`),{cause:error});} 1436const node="node"in params?params.node:params.fiber.node;const fiber="fiber"in params?params.fiber:node.fiber;if(fiber){let current=fiber;do{current.node.fiber=current;fibersInError.set(current,error);current=current.parent;}while(current);fibersInError.set(fiber.root,error);} 1437const handled=_handleError(node,error);if(!handled){console.warn(`[Owl] Unhandled error. Destroying the root component`);try{node.app.destroy();} 1438catch(e){console.error(e);} 1439throw error;}} 1440function makeChildFiber(node,parent){let current=node.fiber;if(current){cancelFibers(current.children);current.root=null;} 1441return new Fiber(node,parent);} 1442function makeRootFiber(node){let current=node.fiber;if(current){let root=current.root;root.locked=true;root.setCounter(root.counter+1-cancelFibers(current.children));root.locked=false;current.children=[];current.childrenMap={};current.bdom=null;if(fibersInError.has(current)){fibersInError.delete(current);fibersInError.delete(root);current.appliedToDom=false;if(current instanceof RootFiber){current.mounted=current instanceof MountFiber?[current]:[];}} 1443return current;} 1444const fiber=new RootFiber(node,null);if(node.willPatch.length){fiber.willPatch.push(fiber);} 1445if(node.patched.length){fiber.patched.push(fiber);} 1446return fiber;} 1447function throwOnRender(){throw new OwlError("Attempted to render cancelled fiber");} 1448function cancelFibers(fibers){let result=0;for(let fiber of fibers){let node=fiber.node;fiber.render=throwOnRender;if(node.status===0){node.cancel();} 1449node.fiber=null;if(fiber.bdom){node.forceNextRender=true;} 1450else{result++;} 1451result+=cancelFibers(fiber.children);} 1452return result;} 1453class Fiber{constructor(node,parent){this.bdom=null;this.children=[];this.appliedToDom=false;this.deep=false;this.childrenMap={};this.node=node;this.parent=parent;if(parent){this.deep=parent.deep;const root=parent.root;root.setCounter(root.counter+1);this.root=root;parent.children.push(this);} 1454else{this.root=this;}} 1455render(){let prev=this.root.node;
1455let scheduler=prev.app.scheduler;let current=prev.parent;while(current){if(current.fiber){let root=current.fiber.root;if(root.counter===0&&prev.parentKey in current.fiber.childrenMap){current=root.node;} 1456else{scheduler.delayedRenders.push(this);return;}} 1457prev=current;current=current.parent;} 1458this._render();} 1459_render(){const node=this.node;const root=this.root;if(root){try{this.bdom=true;this.bdom=node.renderFn();} 1460catch(e){node.app.handleError({node,error:e});} 1461root.setCounter(root.counter-1);}}} 1462class RootFiber extends Fiber{constructor(){super(...arguments);this.counter=1;this.willPatch=[];this.patched=[];this.mounted=[];this.locked=false;} 1463complete(){const node=this.node;this.locked=true;let current=undefined;let mountedFibers=this.mounted;try{for(current of this.willPatch){let node=current.node;if(node.fiber===current){const component=node.component;for(let cb of node.willPatch){cb.call(component);}}} 1464current=undefined;node._patch();this.locked=false;while((current=mountedFibers.pop())){current=current;if(current.appliedToDom){for(let cb of current.node.mounted){cb();}}} 1465let patchedFibers=this.patched;while((current=patchedFibers.pop())){current=current;if(current.appliedToDom){for(let cb of current.node.patched){cb();}}}} 1466catch(e){for(let fiber of mountedFibers){fiber.node.willUnmount=[];} 1467this.locked=false;node.app.handleError({fiber:current||this,error:e});}} 1468setCounter(newValue){this.counter=newValue;if(newValue===0){this.node.app.scheduler.flush();}}} 1469class MountFiber extends RootFiber{constructor(node,target,options={}){super(node,null);this.target=target;this.position=options.position||"last-child";} 1470complete(){let current=this;try{const node=this.node;node.children=this.childrenMap;node.app.constructor.validateTarget(this.target);if(node.bdom){node.updateDom();} 1471else{node.bdom=this.bdom;if(this.position==="last-child"||this.target.childNodes.length===0){mount$1(node.bdom,this.target);} 1472else{const firstChild=this.target.childNodes[0];mount$1(node.bdom,this.target,firstChild);}} 1473node.fiber=null;node.status=1;this.appliedToDom=true;let mountedFibers=this.mounted;while((current=mountedFibers.pop())){if(current.appliedToDom){for(let cb of current.node.mounted){cb();}}}} 1474catch(e){this.node.app.handleError({fiber:current,error:e});}}} 1475const KEYCHANGES=Symbol("Key changes");const NO_CALLBACK=()=>{throw new Error("Called NO_CALLBACK. Owl is broken, please report this to the maintainers.");};const objectToString=Object.prototype.toString;const objectHasOwnProperty=Object.prototype.hasOwnProperty;const SUPPORTED_RAW_TYPES=["Object","Array","Set","Map","WeakMap"];const COLLECTION_RAW_TYPES=["Set","Map","WeakMap"];function rawType(obj){return objectToString.call(toRaw(obj)).slice(8,-1);} 1476function canBeMadeReactive(value){if(typeof value!=="object"){return false;} 1477return SUPPORTED_RAW_TYPES.includes(rawType(value));} 1478function possiblyReactive(val,cb){return canBeMadeReactive(val)?reactive(val,cb):val;} 1479const skipped=new WeakSet();function markRaw(value){skipped.add(value);return value;} 1480function toRaw(value){return targets.has(value)?targets.get(value):value;} 1481const targetToKeysToCallbacks=new WeakMap();function observeTargetKey(target,key,callback){if(callback===NO_CALLBACK){return;} 1482if(!targetToKeysToCallbacks.get(target)){targetToKeysToCallbacks.set(target,new Map());} 1483const keyToCallbacks=targetToKeysToCallbacks.get(target);if(!keyToCallbacks.get(key)){keyToCallbacks.set(key,new Set());} 1484keyToCallbacks.get(key).add(callback);if(!callbacksToTargets.has(callback)){callbacksToTargets.set(callback,new Set());} 1485callbacksToTargets.get(callback).add(target);} 1486function notifyReactives(target,key){const keyToCallbacks=targetToKeysToCallbacks.get(target);if(!keyToCallbacks){return;} 1487const callbacks=keyToCallbacks.get(key);if(!callbacks){return;} 1488for(const callback of[...callbacks]){clearReactivesForCallback(callback);callback();}} 1489const callbacksToTargets=new WeakMap();function clearReactivesForCallback(callback){const targetsToClear=callbacksToTargets.get(callback);if(!targetsToClear){return;} 1490for(const target of targetsToClear){const observedKeys=targetToKeysToCallbacks.get(target);if(!observedKeys){continue;} 1491for(const[key,callbacks]of observedKeys.entries()){callbacks.delete(callback);if(!callbacks.size){observedKeys.delete(key);}}} 1492targetsToClear.clear();} 1493function getSubscriptions(callback){const targets=callbacksToTargets.get(callback)||[];return[...targets].map((target)=>{const keysToCallbacks=targetToKeysToCallbacks.get(target);let keys=[];if(keysToCallbacks){for(const[key,cbs]of keysToCallbacks){if(cbs.has(callback)){keys.push(key);}}} 1494return{target,keys};});} 1495const targets=new WeakMap();const reactiveCache=new WeakMap();function reactive(target,callback=NO_CALLBACK){if(!canBeMadeReactive(target)){throw new OwlError(`Cannot make the given value reactive`);} 1496if(skipped.has(target)){return target;} 1497if(targets.has(target)){return reactive(targets.get(target),callback);} 1498if(!reactiveCache.has(target)){reactiveCache.set(target,new WeakMap());} 1499const reactivesForTarget=reactiveCache.get(target);if(!reactivesForTarget.has(callback)){const targetRawType=rawType(target);const handler=COLLECTION_RAW_TYPES.includes(targetRawType)?collectionsProxyHandler(target,callback,targetRawType):basicProxyHandler(callback);const proxy=new Proxy(target,handler);reactivesForTarget.set(callback,proxy);targets.set(proxy,target);} 1500return reactivesForTarget.get(callback);} 1501function basicProxyHandler(callback){return{get(target,key,receiver){const desc=Object.getOwnPropertyDescriptor(target,key);if(desc&&!desc.writable&&!desc.configurable){return Reflect.get(target,key,receiver);} 1502observeTargetKey(target,key,callback);return possiblyReactive(Reflect.get(target,key,receiver),callback);},set(target,key,value,receiver){const hadKey=objectHasOwnProperty.call(target,key);const originalValue=Reflect.get(target,key,receiver);const ret=Reflect.set(target,key,toRaw(value),receiver);if(!hadKey&&objectHasOwnProperty.call(target,key)){notifyReactives(target,KEYCHANGES);} 1503if(originalValue!==Reflect.get(target,key,receiver)||(key==="length"&&Array.isArray(target))){notifyReactives(target,key);} 1504return ret;},deleteProperty(target,key){const ret=Reflect.deleteProperty(target,key);notifyReactives(target,KEYCHANGES);notifyReactives(target,key);return ret;},ownKeys(target){observeTargetKey(target,KEYCHANGES,callback);return Reflect.ownKeys(target);},has(target,key){observeTargetKey(target,KEYCHANGES,callback);return Reflect.has(target,key);},};} 1505function makeKeyObserver(methodName,target,callback){return(key)=>{key=toRaw(key);observeTargetKey(target,key,callback);return possiblyReactive(target[methodName](key),callback);};} 1506function makeIteratorObserver(methodName,target,callback){return function*(){observeTargetKey(target,KEYCHANGES,callback);const keys=target.keys();for(const item of target[methodName]()){const key=keys.next().value;observeTargetKey(target,key,callback);yield possiblyReactive(item,callback);}};} 1507function makeForEachObserver(target,callback){return function forEach(forEachCb,thisArg){observeTargetKey(target,KEYCHANGES,callback);target.forEach(function(val,key,targetObj){observeTargetKey(target,key,callback);forEachCb.call(thisArg,possiblyReactive(val,callback),possiblyReactive(key,callback),possiblyReactive(targetObj,callback));},thisArg);};} 1508function delegateAndNotify(setterName,getterName,target){return(key,value)=>{key=toRaw(key);const hadKey=target.has(key);const originalValue=target[getterName](key);const ret=target[setterName](key,value);const hasKey=target.has(key);if(hadKey!==hasKey){notifyReactives(target,KEYCHANGES);} 1509if(originalValue!==target[getterName](key)){notifyReactives(target,key);} 1510return ret;};} 1511function makeClearNotifier(target){return()=>{const allKeys=[...target.keys()];target.clear();notifyReactives(target,KEYCHANGES);for(const key of allKeys){notifyReactives(target,key);}};} 1512const rawTypeToFuncHandlers={Set:(target,callback)=>({has:makeKeyObserver("has",target,callback),add:delegateAndNotify("add","has",target),delete:delegateAndNotify("delete","has",target),keys:makeIteratorObserver("keys",target,callback),values:makeIteratorObserver("values",target,callback),entr
1512ies:makeIteratorObserver("entries",target,callback),[Symbol.iterator]:makeIteratorObserver(Symbol.iterator,target,callback),forEach:makeForEachObserver(target,callback),clear:makeClearNotifier(target),get size(){observeTargetKey(target,KEYCHANGES,callback);return target.size;},}),Map:(target,callback)=>({has:makeKeyObserver("has",target,callback),get:makeKeyObserver("get",target,callback),set:delegateAndNotify("set","get",target),delete:delegateAndNotify("delete","has",target),keys:makeIteratorObserver("keys",target,callback),values:makeIteratorObserver("values",target,callback),entries:makeIteratorObserver("entries",target,callback),[Symbol.iterator]:makeIteratorObserver(Symbol.iterator,target,callback),forEach:makeForEachObserver(target,callback),clear:makeClearNotifier(target),get size(){observeTargetKey(target,KEYCHANGES,callback);return target.size;},}),WeakMap:(target,callback)=>({has:makeKeyObserver("has",target,callback),get:makeKeyObserver("get",target,callback),set:delegateAndNotify("set","get",target),delete:delegateAndNotify("delete","has",target),}),};function collectionsProxyHandler(target,callback,targetRawType){const specialHandlers=rawTypeToFuncHandlers[targetRawType](target,callback);return Object.assign(basicProxyHandler(callback),{get(target,key){if(objectHasOwnProperty.call(specialHandlers,key)){return specialHandlers[key];} 1513observeTargetKey(target,key,callback);return possiblyReactive(target[key],callback);},});} 1514let currentNode=null;function saveCurrent(){let n=currentNode;return()=>{currentNode=n;};} 1515function getCurrent(){if(!currentNode){throw new OwlError("No active component (a hook function should only be called in 'setup')");} 1516return currentNode;} 1517function useComponent(){return currentNode.component;} 1518function applyDefaultProps(props,defaultProps){for(let propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}} 1519const batchedRenderFunctions=new WeakMap();function useState(state){const node=getCurrent();let render=batchedRenderFunctions.get(node);if(!render){const wrapper={fn:batched(node.render.bind(node,false))};render=(...args)=>wrapper.fn(...args);batchedRenderFunctions.set(node,render);node.willDestroy.push(cleanupRenderAndReactives.bind(null,wrapper,render));} 1520return reactive(state,render);} 1521const NO_OP=()=>{};function cleanupRenderAndReactives(wrapper,render){wrapper.fn=NO_OP;clearReactivesForCallback(render);} 1522class ComponentNode{constructor(C,props,app,parent,parentKey){this.fiber=null;this.bdom=null;this.status=0;this.forceNextRender=false;this.nextProps=null;this.children=Object.create(null);this.refs={};this.willStart=[];this.willUpdateProps=[];this.willUnmount=[];this.mounted=[];this.willPatch=[];this.patched=[];this.willDestroy=[];currentNode=this;this.app=app;this.parent=parent;this.props=props;this.parentKey=parentKey;const defaultProps=C.defaultProps;props=Object.assign({},props);if(defaultProps){applyDefaultProps(props,defaultProps);} 1523const env=(parent&&parent.childEnv)||app.env;this.childEnv=env;for(const key in props){const prop=props[key];if(prop&&typeof prop==="object"&&targets.has(prop)){props[key]=useState(prop);}} 1524this.component=new C(props,env,this);const ctx=Object.assign(Object.create(this.component),{this:this.component});this.renderFn=app.getTemplate(C.template).bind(this.component,ctx,this);this.component.setup();currentNode=null;} 1525mountComponent(target,options){const fiber=new MountFiber(this,target,options);this.app.scheduler.addFiber(fiber);this.initiateRender(fiber);} 1526async initiateRender(fiber){this.fiber=fiber;if(this.mounted.length){fiber.root.mounted.push(fiber);} 1527const component=this.component;try{await Promise.all(this.willStart.map((f)=>f.call(component)));} 1528catch(e){this.app.handleError({node:this,error:e});return;} 1529if(this.status===0&&this.fiber===fiber){fiber.render();}} 1530async render(deep){if(this.status>=2){return;} 1531let current=this.fiber;if(current&&(current.root.locked||current.bdom===true)){await Promise.resolve();current=this.fiber;} 1532if(current){if(!current.bdom&&!fibersInError.has(current)){if(deep){current.deep=deep;} 1533return;} 1534deep=deep||current.deep;} 1535else if(!this.bdom){return;} 1536const fiber=makeRootFiber(this);fiber.deep=deep;
1536this.fiber=fiber;this.app.scheduler.addFiber(fiber);await Promise.resolve();if(this.status>=2){return;} 1537if(this.fiber===fiber&&(current||!fiber.parent)){fiber.render();}} 1538cancel(){this._cancel();delete this.parent.children[this.parentKey];this.app.scheduler.scheduleDestroy(this);} 1539_cancel(){this.status=2;const children=this.children;for(let childKey in children){children[childKey]._cancel();}} 1540destroy(){let shouldRemove=this.status===1;this._destroy();if(shouldRemove){this.bdom.remove();}} 1541_destroy(){const component=this.component;if(this.status===1){for(let cb of this.willUnmount){cb.call(component);}} 1542for(let child of Object.values(this.children)){child._destroy();} 1543if(this.willDestroy.length){try{for(let cb of this.willDestroy){cb.call(component);}} 1544catch(e){this.app.handleError({error:e,node:this});}} 1545this.status=3;} 1546async updateAndRender(props,parentFiber){this.nextProps=props;props=Object.assign({},props);const fiber=makeChildFiber(this,parentFiber);this.fiber=fiber;const component=this.component;const defaultProps=component.constructor.defaultProps;if(defaultProps){applyDefaultProps(props,defaultProps);} 1547currentNode=this;for(const key in props){const prop=props[key];if(prop&&typeof prop==="object"&&targets.has(prop)){props[key]=useState(prop);}} 1548currentNode=null;const prom=Promise.all(this.willUpdateProps.map((f)=>f.call(component,props)));await prom;if(fiber!==this.fiber){return;} 1549component.props=props;fiber.render();const parentRoot=parentFiber.root;if(this.willPatch.length){parentRoot.willPatch.push(fiber);} 1550if(this.patched.length){parentRoot.patched.push(fiber);}} 1551updateDom(){if(!this.fiber){return;} 1552if(this.bdom===this.fiber.bdom){for(let k in this.children){const child=this.children[k];child.updateDom();}} 1553else{this.bdom.patch(this.fiber.bdom,false);this.fiber.appliedToDom=true;this.fiber=null;}} 1554setRef(name,el){if(el){this.refs[name]=el;}} 1555firstNode(){const bdom=this.bdom;return bdom?bdom.firstNode():undefined;} 1556mount(parent,anchor){const bdom=this.fiber.bdom;this.bdom=bdom;bdom.mount(parent,anchor);this.status=1;this.fiber.appliedToDom=true;this.children=this.fiber.childrenMap;this.fiber=null;} 1557moveBeforeDOMNode(node,parent){this.bdom.moveBeforeDOMNode(node,parent);} 1558moveBeforeVNode(other,afterNode){this.bdom.moveBeforeVNode(other?other.bdom:null,afterNode);} 1559patch(){if(this.fiber&&this.fiber.parent){this._patch();this.props=this.nextProps;}} 1560_patch(){let hasChildren=false;for(let _k in this.children){hasChildren=true;break;} 1561const fiber=this.fiber;this.children=fiber.childrenMap;this.bdom.patch(fiber.bdom,hasChildren);fiber.appliedToDom=true;this.fiber=null;} 1562beforeRemove(){this._destroy();} 1563remove(){this.bdom.remove();} 1564get name(){return this.component.constructor.name;} 1565get subscriptions(){const render=batchedRenderFunctions.get(this);return render?getSubscriptions(render):[];}} 1566const TIMEOUT=Symbol("timeout");const HOOK_TIMEOUT={onWillStart:3000,onWillUpdateProps:3000,};function wrapError(fn,hookName){const error=new OwlError();const timeoutError=new OwlError();const node=getCurrent();return(...args)=>{const onError=(cause)=>{error.cause=cause;error.message=cause instanceof Error?`The following error occurred in ${hookName}: "${cause.message}"`:`Something that is not an Error was thrown in ${hookName} (see this Error's "cause" property)`;throw error;};let result;try{result=fn(...args);} 1567catch(cause){onError(cause);} 1568if(!(result instanceof Promise)){return result;} 1569const timeout=HOOK_TIMEOUT[hookName];if(timeout){const fiber=node.fiber;Promise.race([result.catch(()=>{}),new Promise((resolve)=>setTimeout(()=>resolve(TIMEOUT),timeout)),]).then((res)=>{if(res===TIMEOUT&&node.fiber===fiber&&node.status<=2){timeoutError.message=`${hookName}'s promise hasn't resolved after ${timeout / 1000} seconds`;console.log(timeoutError);}});} 1570return result.catch(onError);};} 1571function onWillStart(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willStart.push(decorate(fn.bind(node.component),"onWillStart"));} 1572function onWillUpdateProps(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willUpdateProps.push(decorate(fn.bind(node.component),"onWillUpdateProps"));} 1573function onMounted(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.mounted.push(decorate(fn.bind(node.component),"onMounted"));} 1574function onWillPatch(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willPatch.unshift(decorate(fn.bind(node.component),"onWillPatch"));} 1575function onPatched(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.patched.push(decorate(fn.bind(node.component),"onPatched"));} 1576function onWillUnmount(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willUnmount.unshift(decorate(fn.bind(node.component),"onWillUnmount"));} 1577function onWillDestroy(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willDestroy.push(decorate(fn.bind(node.component),"onWillDestroy"));} 1578function onWillRender(fn){const node=getCurrent();const renderFn=node.renderFn;const decorate=node.app.dev?wrapError:(fn)=>fn;fn=decorate(fn.bind(node.component),"onWillRender");node.renderFn=()=>{fn();return renderFn();};} 1579function onRendered(fn){const node=getCurrent();const renderFn=node.renderFn;const decorate=node.app.dev?wrapError:(fn)=>fn;fn=decorate(fn.bind(node.component),"onRendered");node.renderFn=()=>{const result=renderFn();fn();return result;};} 1580function onError(callback){const node=getCurrent();let handlers=nodeErrorHandlers.get(node);if(!handlers){handlers=[];nodeErrorHandlers.set(node,handlers);} 1581handlers.push(callback.bind(node.component));} 1582class Component{constructor(props,env,node){this.props=props;this.env=env;this.__owl__=node;} 1583setup(){} 1584render(deep=false){this.__owl__.render(deep===true);}} 1585Component.template="";const VText=text("").constructor;class VPortal extends VText{constructor(selector,content){super("");this.target=null;this.selector=selector;this.content=content;} 1586mount(parent,anchor){super.mount(parent,anchor);this.target=document.querySelector(this.selector);if(this.target){this.content.mount(this.target,null);} 1587else{this.content.mount(parent,anchor);}} 1588beforeRemove(){this.content.beforeRemove();} 1589remove(){if(this.content){super.remove();this.content.remove();this.content=null;}} 1590patch(other){super.patch(other);if(this.content){this.content.patch(other.content,true);} 1591else{this.content=other.content;this.content.mount(this.target,null);}}} 1592function portalTemplate(app,bdom,helpers){let{callSlot}=helpers;return function template(ctx,node,key=""){return new VPortal(ctx.props.target,callSlot(ctx,node,key,"default",false,null));};} 1593class Portal extends Component{setup(){const node=this.__owl__;onMounted(()=>{const portal=node.bdom;if(!portal.target){const target=document.querySelector(this.props.target);if(target){portal.content.moveBeforeDOMNode(target.firstChild,target);} 1594else{throw new OwlError("invalid portal target");}}});onWillUnmount(()=>{const portal=node.bdom;portal.remove();});}} 1595Portal.template="__portal__";Portal.props={target:{type:String,},slots:true,};const isUnionType=(t)=>Array.isArray(t);const isBaseType=(t)=>typeof t!=="object";const isValueType=(t)=>typeof t==="object"&&t&&"value"in t;function isOptional(t){return typeof t==="object"&&"optional"in t?t.optional||false:false;} 1596function describeType(type){return type==="*"||type===true?"value":type.name.toLowerCase();} 1597function describe(info){if(isBaseType(info)){return describeType(info);} 1598else if(isUnionType(info)){return info.map(describe).join(" or ");} 1599else if(isValueType(info)){return String(info.value);} 1600if("element"in info){return`list of ${describe({ type: info.element, optional: false })}s`;} 1601if("shape"in info){return`object`;} 1602return describe(info.type||"*");} 1603function toSchema(spec){return Object.fromEntries(spec.map((e)=>
1603e.endsWith("?")?[e.slice(0,-1),{optional:true}]:[e,{type:"*",optional:false}]));} 1604function validate(obj,spec){let errors=validateSchema(obj,spec);if(errors.length){throw new OwlError("Invalid object: "+errors.join(", "));}} 1605function validateSchema(obj,schema){if(Array.isArray(schema)){schema=toSchema(schema);} 1606obj=toRaw(obj);let errors=[];for(let key in obj){if(key in schema){let result=validateType(key,obj[key],schema[key]);if(result){errors.push(result);}} 1607else if(!("*"in schema)){errors.push(`unknown key '${key}'`);}} 1608for(let key in schema){const spec=schema[key];if(key!=="*"&&!isOptional(spec)&&!(key in obj)){const isObj=typeof spec==="object"&&!Array.isArray(spec);const isAny=spec==="*"||(isObj&&"type"in spec?spec.type==="*":isObj);let detail=isAny?"":` (should be a ${describe(spec)})`;errors.push(`'${key}' is missing${detail}`);}} 1609return errors;} 1610function validateBaseType(key,value,type){if(typeof type==="function"){if(typeof value==="object"){if(!(value instanceof type)){return`'${key}' is not a ${describeType(type)}`;}} 1611else if(typeof value!==type.name.toLowerCase()){return`'${key}' is not a ${describeType(type)}`;}} 1612return null;} 1613function validateArrayType(key,value,descr){if(!Array.isArray(value)){return`'${key}' is not a list of ${describe(descr)}s`;} 1614for(let i=0;i<value.length;i++){const error=validateType(`${key}[${i}]`,value[i],descr);if(error){return error;}} 1615return null;} 1616function validateType(key,value,descr){if(value===undefined){return isOptional(descr)?null:`'${key}' is undefined (should be a ${describe(descr)})`;} 1617else if(isBaseType(descr)){return validateBaseType(key,value,descr);} 1618else if(isValueType(descr)){return value===descr.value?null:`'${key}' is not equal to '${descr.value}'`;} 1619else if(isUnionType(descr)){let validDescr=descr.find((p)=>!validateType(key,value,p));return validDescr?null:`'${key}' is not a ${describe(descr)}`;} 1620let result=null;if("element"in descr){result=validateArrayType(key,value,descr.element);} 1621else if("shape"in descr){if(typeof value!=="object"||Array.isArray(value)){result=`'${key}' is not an object`;} 1622else{const errors=validateSchema(value,descr.shape);if(errors.length){result=`'${key}' doesn't have the correct shape (${errors.join(", ")})`;}}} 1623else if("values"in descr){if(typeof value!=="object"||Array.isArray(value)){result=`'${key}' is not an object`;} 1624else{const errors=Object.entries(value).map(([key,value])=>validateType(key,value,descr.values)).filter(Boolean);if(errors.length){result=`some of the values in '${key}' are invalid (${errors.join(", ")})`;}}} 1625if("type"in descr&&!result){result=validateType(key,value,descr.type);} 1626if("validate"in descr&&!result){result=!descr.validate(value)?`'${key}' is not valid`:null;} 1627return result;} 1628const ObjectCreate=Object.create;function withDefault(value,defaultValue){return value===undefined||value===null||value===false?defaultValue:value;} 1629function callSlot(ctx,parent,key,name,dynamic,extra,defaultContent){key=key+"__slot_"+name;const slots=ctx.props.slots||{};const{__render,__ctx,__scope}=slots[name]||{};const slotScope=ObjectCreate(__ctx||{});if(__scope){slotScope[__scope]=extra;} 1630const slotBDom=__render?__render(slotScope,parent,key):null;if(defaultContent){let child1=undefined;let child2=undefined;if(slotBDom){child1=dynamic?toggler(name,slotBDom):slotBDom;} 1631else{child2=defaultContent(ctx,parent,key);} 1632return multi([child1,child2]);} 1633return slotBDom||text("");} 1634function capture(ctx){const result=ObjectCreate(ctx);for(let k in ctx){result[k]=ctx[k];} 1635return result;} 1636function withKey(elem,k){elem.key=k;return elem;} 1637function prepareList(collection){let keys;let values;if(Array.isArray(collection)){keys=collection;values=collection;} 1638else if(collection instanceof Map){keys=[...collection.keys()];values=[...collection.values()];} 1639else if(Symbol.iterator in Object(collection)){keys=[...collection];values=keys;} 1640else if(collection&&typeof collection==="object"){values=Object.values(collection);keys=Object.keys(collection);} 1641else{throw new OwlError(`Invalid loop expression: "${collection}" is not iterable`);} 1642const n=values.length;return[keys,values,n,new Array(n)];} 1643const isBoundary=Symbol("isBoundary");function setContextValue(ctx,key,value){const ctx0=ctx;while(!ctx.hasOwnProperty(key)&&!ctx.hasOwnProperty(isBoundary)){const newCtx=ctx.__proto__;if(!newCtx){ctx=ctx0;break;} 1644ctx=newCtx;} 1645ctx[key]=value;} 1646function toNumber(val){const n=parseFloat(val);return isNaN(n)?val:n;} 1647function shallowEqual(l1,l2){for(let i=0,l=l1.length;i<l;i++){if(l1[i]!==l2[i]){return false;}} 1648return true;} 1649class LazyValue{constructor(fn,ctx,component,node,key){this.fn=fn;this.ctx=capture(ctx);this.component=component;this.node=node;this.key=key;} 1650evaluate(){return this.fn.call(this.component,this.ctx,this.node,this.key);} 1651toString(){return this.evaluate().toString();}} 1652function safeOutput(value,defaultValue){if(value===undefined||value===null){return defaultValue?toggler("default",defaultValue):toggler("undefined",text(""));} 1653let safeKey;let block;switch(typeof value){case"object":if(value instanceof Markup){safeKey=`string_safe`;block=html(value);} 1654else if(value instanceof LazyValue){safeKey=`lazy_value`;block=value.evaluate();} 1655else if(value instanceof String){safeKey="string_unsafe";block=text(value);} 1656else{safeKey="block_safe";block=value;} 1657break;case"string":safeKey="string_unsafe";block=text(value);break;default:safeKey="string_unsafe";block=text(String(value));} 1658return toggler(safeKey,block);} 1659function validateProps(name,props,comp){const ComponentClass=typeof name!=="string"?name:comp.constructor.components[name];if(!ComponentClass){return;} 1660const schema=ComponentClass.props;if(!schema){if(comp.__owl__.app.warnIfNoStaticProps){console.warn(`Component '${ComponentClass.name}' does not have a static props description`);} 1661return;} 1662const defaultProps=ComponentClass.defaultProps;if(defaultProps){let isMandatory=(name)=>Array.isArray(schema)?schema.includes(name):name in schema&&!("*"in schema)&&!isOptional(schema[name]);for(let p in defaultProps){if(isMandatory(p)){throw new OwlError(`A default value cannot be defined for a mandatory prop (name: '${p}', component: ${ComponentClass.name})`);}}} 1663const errors=validateSchema(props,schema);if(errors.length){throw new OwlError(`Invalid props for component '${ComponentClass.name}': `+errors.join(", "));}} 1664function makeRefWrapper(node){let refNames=new Set();return(name,fn)=>{if(refNames.has(name)){throw new OwlError(`Cannot set the same ref more than once in the same component, ref "${name}" was set multiple times in ${node.name}`);} 1665refNames.add(name);return fn;};} 1666const helpers={withDefault,zero:Symbol("zero"),isBoundary,callSlot,capture,withKey,prepareList,setContextValue,shallowEqual,toNumber,validateProps,LazyValue,safeOutput,createCat
1666cher,markRaw,OwlError,makeRefWrapper,};function parseXML(xml){const parser=new DOMParser();const doc=parser.parseFromString(xml,"text/xml");if(doc.getElementsByTagName("parsererror").length){let msg="Invalid XML in template.";const parsererrorText=doc.getElementsByTagName("parsererror")[0].textContent;if(parsererrorText){msg+="\nThe parser has produced the following error message:\n"+parsererrorText;const re=/\d+/g;const firstMatch=re.exec(parsererrorText);if(firstMatch){const lineNumber=Number(firstMatch[0]);const line=xml.split("\n")[lineNumber-1];const secondMatch=re.exec(parsererrorText);if(line&&secondMatch){const columnIndex=Number(secondMatch[0])-1;if(line[columnIndex]){msg+=`\nThe error might be located at xml line ${lineNumber} column ${columnIndex}\n`+`${line}\n${"-".repeat(columnIndex - 1)}^`;}}}} 1667throw new OwlError(msg);} 1668return doc;} 1669const bdom={text,createBlock,list,multi,html,toggler,comment};class TemplateSet{constructor(config={}){this.rawTemplates=Object.create(globalTemplates);this.templates={};this.Portal=Portal;this.dev=config.dev||false;this.translateFn=config.translateFn;this.translatableAttributes=config.translatableAttributes;if(config.templates){if(config.templates instanceof Document||typeof config.templates==="string"){this.addTemplates(config.templates);} 1670else{for(const name in config.templates){this.addTemplate(name,config.templates[name]);}}} 1671this.getRawTemplate=config.getTemplate;this.customDirectives=config.customDirectives||{};this.runtimeUtils={...helpers,__globals__:config.globalValues||{}};this.hasGlobalValues=Boolean(config.globalValues&&Object.keys(config.globalValues).length);} 1672static registerTemplate(name,fn){globalTemplates[name]=fn;} 1673addTemplate(name,template){if(name in this.rawTemplates){if(!this.dev){return;} 1674const rawTemplate=this.rawTemplates[name];const currentAsString=typeof rawTemplate==="string"?rawTemplate:rawTemplate instanceof Element?rawTemplate.outerHTML:rawTemplate.toString();const newAsString=typeof template==="string"?template:template.outerHTML;if(currentAsString===newAsString){return;} 1675throw new OwlError(`Template ${name} already defined with different content`);} 1676this.rawTemplates[name]=template;} 1677addTemplates(xml){if(!xml){return;} 1678xml=xml instanceof Document?xml:parseXML(xml);for(const template of xml.querySelectorAll("[t-name]")){const name=template.getAttribute("t-name");this.addTemplate(name,template);}} 1679getTemplate(name){var _a;if(!(name in this.templates)){const rawTemplate=((_a=this.getRawTemplate)===null||_a===void 0?void 0:_a.call(this,name))||this.rawTemplates[name];if(rawTemplate===undefined){let extraInfo="";try{const componentName=getCurrent().component.constructor.name;extraInfo=` (for component "${componentName}")`;} 1680catch{} 1681throw new OwlError(`Missing template: "${name}"${extraInfo}`);} 1682const isFn=typeof rawTemplate==="function"&&!(rawTemplate instanceof Element);const templateFn=isFn?rawTemplate:this._compileTemplate(name,rawTemplate);const templates=this.templates;this.templates[name]=function(context,parent){return templates[name].call(this,context,parent);};const template=templateFn(this,bdom,this.runtimeUtils);this.templates[name]=template;} 1683return this.templates[name];} 1684_compileTemplate(name,template){throw new OwlError(`Unable to compile a template. Please use owl full build instead`);} 1685callTemplate(owner,subTemplate,ctx,parent,key){const template=this.getTemplate(subTemplate);return toggler(subTemplate,template.call(owner,ctx,parent,key+subTemplate));}} 1686const globalTemplates={};function xml(...args){const name=`__template__${xml.nextId++}`;const value=String.raw(...args);globalTemplates[name]=value;return name;} 1687xml.nextId=1;TemplateSet.registerTemplate("__portal__",portalTemplate);const RESERVED_WORDS="true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,eval,void,Math,RegExp,Array,Object,Date,__globals__".split(",");const WORD_REPLACEMENT=Object.assign(Object.create(null),{and:"&&",or:"||",gt:">",gte:">=",lt:"<",lte:"<=",});const STATIC_TOKEN_MAP=Object.assign(Object.create(null),{"{":"LEFT_BRACE","}":"RIGHT_BRACE","[":"LEFT_BRACKET","]":"RIGHT_BRACKET",":":"COLON",",":"COMMA","(":"LEFT_PAREN",")":"RIGHT_PAREN",});const OPERATORS="...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ,|,&,^,~".split(",");let tokenizeString=function(expr){let s=expr[0];let start=s;if(s!=="'"&&s!=='"'&&s!=="`"){return false;} 1688let i=1;let cur;while(expr[i]&&expr[i]!==start){cur=expr[i];s+=cur;if(cur==="\\"){i++;cur=expr[i];if(!cur){throw new OwlError("Invalid expression");} 1689s+=cur;} 1690i++;} 1691if(expr[i]!==start){throw new OwlError("Invalid expression");} 1692s+=start;if(start==="`"){return{type:"TEMPLATE_STRING",value:s,replace(replacer){return s.replace(/\$\{(.*?)\}/g,(match,group)=>{return"${"+replacer(group)+"}";});},};} 1693return{type:"VALUE",value:s};};let tokenizeNumber=function(expr){let s=expr[0];if(s&&s.match(/[0-9]/)){let i=1;while(expr[i]&&expr[i].match(/[0-9]|\./)){s+=expr[i];i++;} 1694return{type:"VALUE",value:s};} 1695else{return false;}};let tokenizeSymbol=function(expr){let s=expr[0];if(s&&s.match(/[a-zA-Z_\$]/)){let i=1;while(expr[i]&&expr[i].match(/\w/)){s+=expr[i];i++;} 1696if(s in WORD_REPLACEMENT){return{type:"OPERATOR",value:WORD_REPLACEMENT[s],size:s.length};} 1697return{type:"SYMBOL",value:s};} 1698else{return false;}};const tokenizeStatic=function(expr){const char=expr[0];if(char&&char in STATIC_TOKEN_MAP){return{type:STATIC_TOKEN_MAP[char],value:char};} 1699return false;};const tokenizeOperator=function(expr){for(let op of OPERATORS){if(expr.startsWith(op)){return{type:"OPERATOR",value:op};}} 1700return false;};const TOKENIZERS=[tokenizeString,tokenizeNumber,tokenizeOperator,tokenizeSymbol,tokenizeStatic,];function tokenize(expr){const result=[];let token=true;let error;let current=expr;try{while(token){current=current.trim();if(current){for(let tokenizer of TOKENIZERS){token=tokenizer(current);if(token){result.push(token);current=current.slice(token.size||token.value.length);break;}}} 1701else{token=false;}}} 1702catch(e){error=e;} 1703if(current.length||error){throw new OwlError(`Tokenizer error: could not tokenize \`${expr}\``);} 1704return result;} 1705const isLeftSeparator=(token)=>token&&(token.type==="LEFT_BRACE"||token.type==="COMMA");const isRightSeparator=(token)=>token&&(token.type==="RIGHT_BRACE"||token.type==="COMMA");function compileExprToArray(expr){const localVars=new Set();const tokens=tokenize(expr);let i=0;let stack=[];while(i<tokens.length){let token=tokens[i];let prevToken=tokens[i-1];let nextToken=tokens[i+1];let groupType=stack[stack.length-1];switch(token.type){case"LEFT_BRACE":case"LEFT_BRACKET":case"LEFT_PAREN":stack.push(token.type);break;case"RIGHT_BRACE":case"RIGHT_BRACKET":case"RIGHT_PAREN":stack.pop();} 1706let isVar=token.type==="SYMBOL"&&!RESERVED_WORDS.includes(token.value);if(token.type==="SYMBOL"&&!RESERVED_WORDS.includes(token.value)){if(prevToken){if(groupType==="LEFT_BRACE"&&isLeftSeparator(prevToken)&&isRightSeparator(nextToken)){tokens.splice(i+1,0,{type:"COLON",value:":"},{...token});nextToken=tokens[i+1];} 1707if(prevToken.type==="OPERATOR"&&prevToken.value==="."){isVar=false;} 1708else if(prevToken.type==="LEFT_BRACE"||prevToken.type==="COMMA"){if(nextToken&&nextToken.type==="COLON"){isVar=false;}}}} 1709if(token.type==="TEMPLATE_STRING"){token.value=token.replace((expr)=>compileExpr(expr));} 1710if(nextToken&&nextToken.type==="OPERATOR"&&nextToken.value==="=>"){if(token.type==="RIGHT_PAREN"){let j=i-1;while(j>0&&tokens[j].type!=="LEFT_PAREN"){if(tokens[j].type==="SYMBOL"&&tokens[j].originalValue){tokens[j].value=tokens[j].originalValue;localVars.add(tokens[j].value);} 1711j--;}} 1712else{localVars.add(token.value);}} 1713if(isVar){token.varName=token.value;if(!localVars.has(token.value)){token.originalValue=token.value;token.value=`ctx['${token.value}']`;}} 1714i++;} 1715for(const token of tokens){if(token.type==="SYMBOL"&&token.varName&&localVars.has(token.value)){token.originalValue=token.value;token.value=`_${token.value}`;token.isLocal=true;}} 1716return tokens;} 1717const paddedValues=new Map([["in "," in "]]);function compileExpr(expr){return compileExprToArray(expr).map((t)=>paddedValues.get(t.value)||t.value).join("");} 1718const INTERP_REGEXP=/\{\{.*?\}\}|\#\{.*?\}/g;function replaceDynamicParts(s,replacer){let matches=s.match(INTERP_REGEXP);if(matches&&matches[0].length===s.length){return`(${replacer(s.slice(2, matches[0][0] === "{" ? -2 : -1))})`;} 1719let r=s.replace(INTERP_REGEXP,(s)=>"${"+replacer(s.slice(2,s[0]==="{"?-2:-1))+"}");return"`"+r+"`";} 1720function interpolate(s){return replaceDynamicParts(s,compileExpr);} 1721const whitespaceRE=/\s+/g;const xmlDoc=document.implementation.createDocument(null,null,null);const MODS=new Set(["stop","capture","prevent","self","synthetic"]);let nextDataIds={};function generateId(prefix=""){nextDataIds[prefix]=(nextDataIds[prefix]||0)+1;return prefix+nextDataIds[prefix];} 1722function isProp(tag,key){switch(tag){case"input":return(key==="checked"||key==="indeterminate"||key==="value"||key==="readonly"||key==="readOnly"||key==="disabled");case"option":return key==="selected"||key==="disabled";case"textarea":return key==="value"||key==="readonly"||key==="readOnly"||key==="disabled";case"select":return key==="value"||key==="disabled";case"button":case"optgroup":return key==="disabled";} 1723return false;} 1724function toStringExpression(str){return`\`${str.replace(/\\/g, "\\\\").replace(/`/g,"\\`").replace(/\$\{/,"\\${")}\``;} 1725class BlockDescription{constructor(target,type){this.dynamicTagName=null;this.isRoot=false;this.hasDynamicChildren=false;this.children=[];this.data=[];this.childNumber=0;this.parentVar="";this.id=BlockDescription.nextBlockId++;this.varName="b"+this.id;this.blockName="block"+this.id;this.target=target;this.type=type;} 1726insertData(str,prefix="d"){const id=generateId(prefix);this.target.addLine(`let ${id} = ${str};`);return this.data.push(id)-1;} 1727insert(dom){if(this.currentDom){this.currentDom.appendChild(dom);} 1728else{this.dom=dom;}}
1729generateExpr(expr){if(this.type==="block"){const hasChildren=this.children.length;let params=this.data.length?`[${this.data.join(", ")}]`:hasChildren?"[]":"";if(hasChildren){params+=", ["+this.children.map((c)=>c.varName).join(", ")+"]";} 1730if(this.dynamicTagName){return`toggler(${this.dynamicTagName}, ${this.blockName}(${this.dynamicTagName})(${params}))`;} 1731return`${this.blockName}(${params})`;} 1732else if(this.type==="list"){return`list(c_block${this.id})`;} 1733return expr;} 1734asXmlString(){const t=xmlDoc.createElement("t");t.appendChild(this.dom);return t.innerHTML;}} 1735BlockDescription.nextBlockId=1;function createContext(parentCtx,params){return Object.assign({block:null,index:0,forceNewBlock:true,translate:parentCtx.translate,translationCtx:parentCtx.translationCtx,tKeyExpr:null,nameSpace:parentCtx.nameSpace,tModelSelectedExpr:parentCtx.tModelSelectedExpr,},params);} 1736class CodeTarget{constructor(name,on){this.indentLevel=0;this.loopLevel=0;this.code=[];this.hasRoot=false;this.hasCache=false;this.shouldProtectScope=false;this.hasRefWrapper=false;this.name=name;this.on=on||null;} 1737addLine(line,idx){const prefix=new Array(this.indentLevel+2).join(" ");
1737if(idx===undefined){this.code.push(prefix+line);} 1738else{this.code.splice(idx,0,prefix+line);}} 1739generateCode(){let result=[];result.push(`function ${this.name}(ctx, node, key = "") {`);if(this.shouldProtectScope){result.push(` ctx = Object.create(ctx);`);result.push(` ctx[isBoundary] = 1`);} 1740if(this.hasRefWrapper){result.push(` let refWrapper = makeRefWrapper(this.__owl__);`);} 1741if(this.hasCache){result.push(` let cache = ctx.cache || {};`);result.push(` let nextCache = ctx.cache = {};`);} 1742for(let line of this.code){result.push(line);} 1743if(!this.hasRoot){result.push(`return text('');`);} 1744result.push(`}`);return result.join("\n ");} 1745currentKey(ctx){let key=this.loopLevel?`key${this.loopLevel}`:"key";if(ctx.tKeyExpr){key=`${ctx.tKeyExpr} + ${key}`;} 1746return key;}} 1747const TRANSLATABLE_ATTRS=["alt","aria-label","aria-placeholder","aria-roledescription","aria-valuetext","label","placeholder","title",];const translationRE=/^(\s*)([\s\S]+?)(\s*)$/;class CodeGenerator{constructor(ast,options){this.blocks=[];this.nextBlockId=1;this.isDebug=false;this.targets=[];this.target=new CodeTarget("template");this.translatableAttributes=TRANSLATABLE_ATTRS;this.staticDefs=[];this.slotNames=new Set();this.helpers=new Set();this.translateFn=options.translateFn||((s)=>s);if(options.translatableAttributes){const attrs=new Set(TRANSLATABLE_ATTRS);for(let attr of options.translatableAttributes){if(attr.startsWith("-")){attrs.delete(attr.slice(1));} 1748else{attrs.add(attr);}} 1749this.translatableAttributes=[...attrs];} 1750this.hasSafeContext=options.hasSafeContext||false;this.dev=options.dev||false;this.ast=ast;this.templateName=options.name;if(options.hasGlobalValues){this.helpers.add("__globals__");}} 1751generateCode(){const ast=this.ast;this.isDebug=ast.type===12;BlockDescription.nextBlockId=1;nextDataIds={};this.compileAST(ast,{block:null,index:0,forceNewBlock:false,isLast:true,translate:true,translationCtx:"",tKeyExpr:null,});let mainCode=[` let { text, createBlock, list, multi, html, toggler, comment } = bdom;`];if(this.helpers.size){mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`);} 1752if(this.templateName){mainCode.push(`// Template name: "${this.templateName}"`);} 1753for(let{id,expr}of this.staticDefs){mainCode.push(`const ${id} = ${expr};`);} 1754if(this.blocks.length){mainCode.push(``);for(let block of this.blocks){if(block.dom){let xmlString=toStringExpression(block.asXmlString());if(block.dynamicTagName){xmlString=xmlString.replace(/^`<\w+/,`\`<\${tag || '${block.dom.nodeName}'}`);xmlString=xmlString.replace(/\w+>`$/,`\${tag || '${block.dom.nodeName}'}>\``);mainCode.push(`let ${block.blockName} = tag => createBlock(${xmlString});`);} 1755else{mainCode.push(`let ${block.blockName} = createBlock(${xmlString});`);}}}} 1756if(this.targets.length){for(let fn of this.targets){mainCode.push("");mainCode=mainCode.concat(fn.generateCode());}} 1757mainCode.push("");mainCode=mainCode.concat("return "+this.target.generateCode());const code=mainCode.join("\n ");if(this.isDebug){const msg=`[Owl Debug]\n${code}`;console.log(msg);} 1758return code;} 1759compileInNewTarget(prefix,ast,ctx,on){const name=generateId(prefix);const initialTarget=this.target;const target=new CodeTarget(name,on);this.targets.push(target);this.target=target;this.compileAST(ast,createContext(ctx));this.target=initialTarget;return name;} 1760addLine(line,idx){this.target.addLine(line,idx);} 1761define(varName,expr){this.addLine(`const ${varName} = ${expr};`);} 1762insertAnchor(block,index=block.children.length){const tag=`block-child-${index}`;const anchor=xmlDoc.createElement(tag);block.insert(anchor);} 1763createBlock(parentBlock,type,ctx){const hasRoot=this.target.hasRoot;const block=new BlockDescription(this.target,type);if(!hasRoot){this.target.hasRoot=true;block.isRoot=true;} 1764if(parentBlock){parentBlock.children.push(block);if(parentBlock.type==="list"){block.parentVar=`c_block${parentBlock.id}`;}} 1765return block;} 1766insertBlock(expression,block,ctx){let blockExpr=block.generateExpr(expression);if(block.parentVar){let key=this.target.currentKey(ctx);this.helpers.add("withKey");this.addLine(`${block.parentVar}[${ctx.index}] = withKey(${blockExpr}, ${key});`);return;} 1767if(ctx.tKeyExpr){blockExpr=`toggler(${ctx.tKeyExpr}, ${blockExpr})`;} 1768if(block.isRoot){if(this.target.on){blockExpr=this.wrapWithEventCatcher(blockExpr,this.target.on);} 1769this.addLine(`return ${blockExpr};`);} 1770else{this.define(block.varName,blockExpr);}} 1771captureExpression(expr,forceCapture=false){if(!forceCapture&&!expr.includes("=>")){return compileExpr(expr);} 1772const tokens=compileExprToArray(expr);const mapping=new Map();return tokens.map((tok)=>
1772{if(tok.varName&&!tok.isLocal){if(!mapping.has(tok.varName)){const varId=generateId("v");mapping.set(tok.varName,varId);this.define(varId,tok.value);} 1773tok.value=mapping.get(tok.varName);} 1774return tok.value;}).join("");} 1775translate(str,translationCtx){const match=translationRE.exec(str);return match[1]+this.translateFn(match[2],translationCtx)+match[3];} 1776compileAST(ast,ctx){switch(ast.type){case 1:return this.compileComment(ast,ctx);case 0:return this.compileText(ast,ctx);case 2:return this.compileTDomNode(ast,ctx);case 4:return this.compileTEsc(ast,ctx);case 8:return this.compileTOut(ast,ctx);case 5:return this.compileTIf(ast,ctx);case 9:return this.compileTForeach(ast,ctx);case 10:return this.compileTKey(ast,ctx);case 3:return this.compileMulti(ast,ctx);case 7:return this.compileTCall(ast,ctx);case 15:return this.compileTCallBlock(ast,ctx);case 6:return this.compileTSet(ast,ctx);case 11:return this.compileComponent(ast,ctx);case 12:return this.compileDebug(ast,ctx);case 13:return this.compileLog(ast,ctx);case 14:return this.compileTSlot(ast,ctx);case 16:return this.compileTTranslation(ast,ctx);case 17:return this.compileTTranslationContext(ast,ctx);case 18:return this.compileTPortal(ast,ctx);}} 1777compileDebug(ast,ctx){this.addLine(`debugger;`);if(ast.content){return this.compileAST(ast.content,ctx);} 1778return null;} 1779compileLog(ast,ctx){this.addLine(`console.log(${compileExpr(ast.expr)});`);if(ast.content){return this.compileAST(ast.content,ctx);} 1780return null;} 1781compileComment(ast,ctx){let{block,forceNewBlock}=ctx;const isNewBlock=!block||forceNewBlock;if(isNewBlock){block=this.createBlock(block,"comment",ctx);this.insertBlock(`comment(${toStringExpression(ast.value)})`,block,{...ctx,forceNewBlock:forceNewBlock&&!block,});} 1782else{const text=xmlDoc.createComment(ast.value);block.insert(text);} 1783return block.varName;} 1784compileText(ast,ctx){let{block,forceNewBlock}=ctx;let value=ast.value;if(value&&ctx.translate!==false){value=this.translate(value,ctx.translationCtx);} 1785if(!ctx.inPreTag){value=value.replace(whitespaceRE," ");} 1786if(!block||forceNewBlock){block=this.createBlock(block,"text",ctx);this.insertBlock(`text(${toStringExpression(value)})`,block,{...ctx,forceNewBlock:forceNewBlock&&!block,});} 1787else{const createFn=ast.type===0?xmlDoc.createTextNode:xmlDoc.createComment;block.insert(createFn.call(xmlDoc,value));} 1788return block.varName;} 1789generateHandlerCode(rawEvent,handler){const modifiers=rawEvent.split(".").slice(1).map((m)=>{if(!MODS.has(m)){throw new OwlError(`Unknown event modifier: '${m}'`);} 1790return`"${m}"`;});let modifiersCode="";if(modifiers.length){modifiersCode=`${modifiers.join(",")}, `;} 1791return`[${modifiersCode}${this.captureExpression(handler)}, ctx]`;} 1792compileTDomNode(ast,ctx){var _a;let{block,forceNewBlock}=ctx;const isNewBlock=!block||forceNewBlock||ast.dynamicTag!==null||ast.ns;let codeIdx=this.target.code.length;if(isNewBlock){if((ast.dynamicTag||ctx.tKeyExpr||ast.ns)&&ctx.block){this.insertAnchor(ctx.block);} 1793block=this.createBlock(block,"block",ctx);this.blocks.push(block);if(ast.dynamicTag){const tagExpr=generateId("tag");this.define(tagExpr,compileExpr(ast.dynamicTag));block.dynamicTagName=tagExpr;}} 1794const attrs={};for(let key in ast.attrs){let expr,attrName;if(key.startsWith("t-attf")){expr=interpolate(ast.attrs[key]);const idx=block.insertData(expr,"attr");attrName=key.slice(7);attrs["block-attribute-"+idx]=attrName;} 1795else if(key.startsWith("t-att")){attrName=key==="t-att"?null:key.slice(6);expr=compileExpr(ast.attrs[key]);if(attrName&&isProp(ast.tag,attrName)){if(attrName==="readonly"){attrName="readOnly";} 1796if(attrName==="value"){expr=`new String((${expr}) === 0 ? 0 : ((${expr}) || ""))`;} 1797else{expr=`new Boolean(${expr})`;} 1798const idx=block.insertData(expr,"prop");attrs[`block-property-${idx}`]=attrName;} 1799else{const idx=block.insertData(expr,"attr");if(key==="t-att"){attrs[`block-attributes`]=String(idx);} 1800else{attrs[`block-attribute-${idx}`]=attrName;}}} 1801else if(this.translatableAttributes.includes(key)){const attrTranslationCtx=((_a=ast.attrsTranslationCtx)===null||_a===void 0?void 0:_a[key])||ctx.translationCtx;attrs[key]=this.translateFn(ast.attrs[key],attrTranslationCtx);} 1802else{expr=`"${ast.attrs[key]}"`;attrName=key;attrs[key]=ast.attrs[key];} 1803if(attrName==="value"&&ctx.tModelSelectedExpr){let selectedId=block.insertData(`${ctx.tModelSelectedExpr} === ${expr}`,"attr");attrs[`block-attribute-${selectedId}`]="selected";}} 1804let tModelSelectedExpr;if(ast.model){const{hasDynamicChildren,baseExpr,expr,eventType,shouldNumberize,
1804shouldTrim,targetAttr,specialInitTargetAttr,}=ast.model;const baseExpression=compileExpr(baseExpr);const bExprId=generateId("bExpr");this.define(bExprId,baseExpression);const expression=compileExpr(expr);const exprId=generateId("expr");this.define(exprId,expression);const fullExpression=`${bExprId}[${exprId}]`;let idx;if(specialInitTargetAttr){let targetExpr=targetAttr in attrs&&`'${attrs[targetAttr]}'`;if(!targetExpr&&ast.attrs){const dynamicTgExpr=ast.attrs[`t-att-${targetAttr}`];if(dynamicTgExpr){targetExpr=compileExpr(dynamicTgExpr);}} 1805idx=block.insertData(`${fullExpression} === ${targetExpr}`,"prop");attrs[`block-property-${idx}`]=specialInitTargetAttr;} 1806else if(hasDynamicChildren){const bValueId=generateId("bValue");tModelSelectedExpr=`${bValueId}`;this.define(tModelSelectedExpr,fullExpression);} 1807else{idx=block.insertData(`${fullExpression}`,"prop");attrs[`block-property-${idx}`]=targetAttr;} 1808this.helpers.add("toNumber");let valueCode=`ev.target.${targetAttr}`;valueCode=shouldTrim?`${valueCode}.trim()`:valueCode;valueCode=shouldNumberize?`toNumber(${valueCode})`:valueCode;const handler=`[(ev) => { ${fullExpression} = ${valueCode}; }]`;idx=block.insertData(handler,"hdlr");attrs[`block-handler-${idx}`]=eventType;} 1809for(let ev in ast.on){const name=this.generateHandlerCode(ev,ast.on[ev]);const idx=block.insertData(name,"hdlr");attrs[`block-handler-${idx}`]=ev;} 1810if(ast.ref){if(this.dev){this.helpers.add("makeRefWrapper");this.target.hasRefWrapper=true;} 1811const isDynamic=INTERP_REGEXP.test(ast.ref);let name=`\`${ast.ref}\``;if(isDynamic){name=replaceDynamicParts(ast.ref,(expr)=>this.captureExpression(expr,true));} 1812let setRefStr=`(el) => this.__owl__.setRef((${name}), el)`;if(this.dev){setRefStr=`refWrapper(${name}, ${setRefStr})`;} 1813const idx=block.insertData(setRefStr,"ref");attrs["block-ref"]=String(idx);} 1814const nameSpace=ast.ns||ctx.nameSpace;const dom=nameSpace?xmlDoc.createElementNS(nameSpace,ast.tag):xmlDoc.createElement(ast.tag);for(const[attr,val]of Object.entries(attrs)){if(!(attr==="class"&&val==="")){dom.setAttribute(attr,val);}} 1815block.insert(dom);if(ast.content.length){const initialDom=block.currentDom;block.currentDom=dom;const children=ast.content;for(let i=0;i<children.length;i++){const child=ast.content[i];const subCtx=createContext(ctx,{block,index:block.childNumber,forceNewBlock:false,isLast:ctx.isLast&&i===children.length-1,tKeyExpr:ctx.tKeyExpr,nameSpace,tModelSelectedExpr,inPreTag:ctx.inPreTag||ast.tag==="pre",});this.compileAST(child,subCtx);} 1816block.currentDom=initialDom;} 1817if(isNewBlock){this.insertBlock(`${block.blockName}(ddd)`,block,ctx);if(block.children.length&&block.hasDynamicChildren){const code=this.target.code;const children=block.children.slice();let current=children.shift();for(let i=codeIdx;i<code.length;i++){if(code[i].trimStart().startsWith(`const ${current.varName} `)){code[i]=code[i].replace(`const ${current.varName}`,current.varName);current=children.shift();if(!current) 1818break;}} 1819this.addLine(`let ${block.children.map((c) => c.varName).join(", ")};`,codeIdx);}} 1820return block.varName;} 1821compileTEsc(ast,ctx){let{block,forceNewBlock}=ctx;let expr;if(ast.expr==="0"){this.helpers.add("zero");expr=`ctx[zero]`;} 1822else{expr=compileExpr(ast.expr);if(ast.defaultValue){this.helpers.add("withDefault");expr=`withDefault(${expr}, ${toStringExpression(ast.defaultValue)})`;}} 1823if(!block||forceNewBlock){block=this.createBlock(block,"text",ctx);this.insertBlock(`text(${expr})`,block,{...ctx,forceNewBlock:forceNewBlock&&!block});} 1824else{const idx=block.insertData(expr,"txt");const text=xmlDoc.createElement(`block-text-${idx}`);block.insert(text);} 1825return block.varName;} 1826compileTOut(ast,ctx){let{block}=ctx;if(block){this.insertAnchor(block);} 1827block=this.createBlock(block,"html",ctx);let blockStr;if(ast.expr==="0"){this.helpers.add("zero");blockStr=`ctx[zero]`;} 1828else if(ast.body){let bodyValue=null;bodyValue=BlockDescription.nextBlockId;const subCtx=createContext(ctx);this.compileAST({type:3,content:ast.body},subCtx);this.helpers.add("safeOutput");blockStr=`safeOutput(${compileExpr(ast.expr)}, b${bodyValue})`;} 1829else{this.helpers.add("safeOutput");blockStr=`safeOutput(${compileExpr(ast.expr)})`;} 1830this.insertBlock(blockStr,block,ctx);return block.varName;} 1831compileTIfBranch(content,block,ctx){this.target.indentLevel++;let childN=block.children.length;this.compileAST(content,createContext(ctx,{block,index:ctx.index}));if(block.children.length>childN){this.insertAnchor(block,childN);} 1832this.target.indentLevel--;} 1833compileTIf(ast,ctx,nextNode){let{block,forceNewBlock}=ctx;const codeIdx=this.target.code.length;const isNewBlock=!block||(block.type!=="multi"&&forceNewBlock);if(block){block.hasDynamicChildren=true;} 1834if(!block||(block.type!=="multi"&&forceNewBlock)){block=this.createBlock(block,"multi",ctx);} 1835this.addLine(`if (${compileExpr(ast.condition)}) {`);this.compileTIfBranch(ast.content,block,ctx);if(ast.tElif){for(let clause of ast.tElif){this.addLine(`} else if (${compileExpr(clause.condition)}) {`);this.compileTIfBranch(clause.content,block,ctx);}} 1836if(ast.tElse){this.addLine(`} else {`);this.compileTIfBranch(ast.tElse,block,ctx);} 1837this.addLine("}");if(isNewBlock){if(block.children.length){const code=this.target.code;const children=block.children.slice();let current=children.shift();for(let i=codeIdx;i<code.length;i++){if(code[i].trimStart().startsWith(`const ${current.varName} `)){code[i]=code[i].replace(`const ${current.varName}`,current.varName);current=children.shift();if(!current) 1838break;}} 1839this.addLine(`let ${block.children.map((c) => c.varName).join(", ")};`,codeIdx);} 1840const args=block.children.map((c)=>c.varName).join(", ");this.insertBlock(`multi([${args}])`,block,ctx);} 1841return block.varName;} 1842compileTForeach(ast,ctx){let{block}=ctx;if(block){this.insertAnchor(block);} 1843block=this.createBlock(block,"list",ctx);this.target.loopLevel++;const loopVar=`i${this.target.loopLevel}`;this.addLine(`ctx = Object.create(ctx);`);const vals=`v_block${block.id}`;const keys=`k_block${block.id}`;const l=`l_block${block.id}`;const c=`c_block${block.id}`;this.helpers.add("prepareList");this.define(`[${keys}, ${vals}, ${l}, ${c}]`,`prepareList(${compileExpr(ast.collection)});`);if(this.dev){this.define(`keys${block.id}`,`new Set()`);} 1844this.addLine(`for (let ${loopVar} = 0; ${loopVar} < ${l}; ${loopVar}++) {`);this.target.indentLevel++;this.addLine(`ctx[\`${ast.elem}\`] = ${keys}[${loopVar}];`);if(!ast.hasNoFirst){this.addLine(`ctx[\`${ast.elem}_first\`] = ${loopVar} === 0;`);} 1845if(!ast.hasNoLast){this.addLine(`ctx[\`${ast.elem}_last\`] = ${loopVar} === ${keys}.length - 1;`);} 1846if(!ast.hasNoIndex){this.addLine(`ctx[\`${ast.elem}_index\`] = ${loopVar};`);} 1847if(!ast.hasNoValue){this.addLine(`ctx[\`${ast.elem}_value\`] = ${vals}[${loopVar}];`);} 1848this.define(`key${this.target.loopLevel}`,ast.key?compileExpr(ast.key):loopVar);if(this.dev){this.helpers.add("OwlError");this.addLine(`if (keys${block.id}.has(String(key${this.target.loopLevel}))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`);this.addLine(`keys${block.id}.add(String(key${this.target.loopLevel}));`);} 1849let id;if(ast.memo){this.target.hasCache=true;id=generateId();this.define(`memo${id}`,compileExpr(ast.memo));this.define(`vnode${id}`,`cache[key${this.target.loopLevel}];`);this.addLine(`if (vnode${id}) {`);this.target.indentLevel++;this.addLine(`if (shallowEqual(vnode${id}.memo, memo${id})) {`);this.target.indentLevel++;this.addLine(`${c}[${loopVar}] = vnode${id};`);this.addLine(`nextCache[key${this.target.loopLevel}] = vnode${id};`);this.addLine(`continue;`);this.target.indentLevel--;this.addLine("}");this.target.indentLevel--;this.addLine("}");} 1850const subCtx=createContext(ctx,{block,index:loopVar});this.compileAST(ast.body,subCtx);if(ast.memo){this.addLine(`nextCache[key${this.target.loopLevel}] = Object.assign(${c}[${loopVar}], {memo: memo${id}});`);} 1851this.target.indentLevel--;this.target.loopLevel--;this.addLine(`}`);if(!ctx.isLast){this.addLine(`ctx = ctx.__proto__;`);} 1852this.insertBlock("l",block,ctx);return block.varName;} 1853compileTKey(ast,ctx){const tKeyExpr=generateId("tKey_");this.define(tKeyExpr,compileExpr(ast.expr));ctx=createContext(ctx,{tKeyExpr,block:ctx.block,index:ctx.index,});return this.compileAST(ast.content,ctx);} 1854compileMulti(ast,ctx){let{block,forceNewBlock}=ctx;const isNewBlock=!block||forceNewBlock;let codeIdx=this.target.code.length;if(isNewBlock){const n=ast.content.filter((c)=>!c.hasNoRepresentation).length;let result=null;if(n<=1){for(let child of ast.content){const blockName=this.compileAST(child,ctx);result=result||blockName;} 1855return result;} 1856block=this.createBlock(block,"multi",ctx);} 1857let index=0;for(let i=0,l=ast.content.length;i<l;i++){const child=ast.content[i];const forceNewBlock=!child.hasNoRepresentation;const subCtx=createContext(ctx,{block,index,forceNewBlock,isLast:ctx.isLast&&i===l-1,});this.compileAST(child,subCtx);if(forceNewBlock){index++;}} 1858if(isNewBlock){if(block.hasDynamicChildren&&block.children.length){const code=this.target.code;const children=block.children.slice();let current=children.shift();for(let i=codeIdx;i<code.length;i++){if(code[i].trimStart().startsWith(`const ${current.varName} `)){code[i]=code[i].replace(`const ${current.varName}`,current.varName);current=children.shift();if(!current) 1859break;}} 1860this.addLine(`let ${block.children.map((c) => c.varName).join(", ")};`,codeIdx);} 1861const args=block.children.map((c)=>c.varName).join(", ");this.insertBlock(`multi([${args}])`,block,ctx);} 1862return block.varName;} 1863compileTCall(ast,ctx){let{block,forceNewBlock}=ctx;let ctxVar=ctx.ctxVar||"ctx";if(ast.context){ctxVar=generateId("ctx");this.addLine(`let ${ctxVar} = ${compileExpr(ast.context)};`);} 1864const isDynamic=INTERP_REGEXP.test(ast.name);const subTemplate=isDynamic?interpolate(ast.name):"`"+ast.name+"`";if(block&&!forceNewBlock){this.insertAnchor(block);} 1865block=this.createBlock(block,"multi",ctx);if(ast.body){this.addLine(`${ctxVar} = Object.create(${ctxVar});`);this.addLine(`${ctxVar}[isBoundary] = 1;`);this.helpers.add("isBoundary");const subCtx=createContext(ctx,{ctxVar});const bl=this.compileMulti({type:3,content:ast.body},subCtx);if(bl){this.helpers.add("zero");this.addLine(`${ctxVar}[zero] = ${bl};`);}} 1866const key=this.generateComponentKey();if(isDynamic){const templateVar=generateId("template");if(!this.staticDefs.find((d)=>d.id==="call")){this.staticDefs.push({id:"call",expr:`app.callTemplate.bind(app)`});} 1867this.define(templateVar,subTemplate);this.insertBlock(`call(this, ${templateVar}, ${ctxVar}, node, ${key})`,block,{...ctx,forceNewBlock:!block,});} 1868else{const id=generateId(`callTemplate_`);this.staticDefs.push({id,expr:`app.getTemplate(${subTemplate})`});this.insertBlock(`${id}.call(this, ${ctxVar}, node, ${key})`,block,{...ctx,forceNewBlock:!block,});} 1869if(ast.body&&!ctx.isLast){this.addLine(`${ctxVar} = ${ctxVar}.__proto__;`);} 1870return block.varName;} 1871compileTCallBlock(ast,ctx){let{block,forceNewBlock}=ctx;if(block){if(!forceNewBlock){this.insertAnchor(block);}} 1872block=this.createBlock(block,"multi",ctx);this.insertBlock(compileExpr(ast.name),block,{...ctx,forceNewBlock:!block});return block.varName;} 1873compileTSet(ast,ctx){this.target.shouldProtectScope=true;this.helpers.add("isBoundary").add("withDefault");const expr=ast.value?compileExpr(ast.value||""):"null";if(ast.body){this.helpers.add("LazyValue");const bodyAst={type:3,content:ast.body};const name=this.compileInNewTarget("value",bodyAst,ctx);let key=this.target.currentKey(ctx);let value=`new LazyValue(${name}, ctx, this, node, ${key})`;value=ast.value?(value?`withDefault(${expr}, ${value})`:expr):value;this.addLine(`ctx[\`${ast.name}\`] = ${value};`);} 1874else{let value;if(ast.defaultValue){const defaultValue=toStringExpression(ctx.translate?this.translate(ast.defaultValue,ctx.translationCtx):ast.defaultValue);if(ast.value){value=`withDefault(${expr}, ${defaultValue})`;} 1875else{value=defaultValue;}}
1876else{value=expr;} 1877this.helpers.add("setContextValue");this.addLine(`setContextValue(${ctx.ctxVar || "ctx"}, "${ast.name}", ${value});`);} 1878return null;} 1879generateComponentKey(currentKey="key"){const parts=[generateId("__")];for(let i=0;i<this.target.loopLevel;i++){parts.push(`\${key${i + 1}}`);} 1880return`${currentKey} + \`${parts.join("__")}\``;} 1881formatProp(name,value,attrsTranslationCtx,translationCtx){if(name.endsWith(".translate")){const attrTranslationCtx=(attrsTranslationCtx===null||attrsTranslationCtx===void 0?void 0:attrsTranslationCtx[name])||translationCtx;value=toStringExpression(this.translateFn(value,attrTranslationCtx));} 1882else{value=this.captureExpression(value);} 1883if(name.includes(".")){let[_name,suffix]=name.split(".");name=_name;switch(suffix){case"bind":value=`(${value}).bind(this)`;break;case"alike":case"translate":break;default:throw new OwlError(`Invalid prop suffix: ${suffix}`);}} 1884name=/^[a-z_]+$/i.test(name)?name:`'${name}'`;return`${name}: ${value || undefined}`;} 1885formatPropObject(obj,attrsTranslationCtx,translationCtx){return Object.entries(obj).map(([k,v])=>this.formatProp(k,v,attrsTranslationCtx,translationCtx));} 1886getPropString(props,dynProps){let propString=`{${props.join(",")}}`;if(dynProps){propString=`Object.assign({}, ${compileExpr(dynProps)}${props.length ? ", " + propString : ""})`;} 1887return propString;} 1888compileComponent(ast,ctx){let{block}=ctx;const hasSlotsProp="slots"in(ast.props||{});const props=ast.props?this.formatPropObject(ast.props,ast.propsTranslationCtx,ctx.translationCtx):[];let slotDef="";if(ast.slots){let ctxStr="ctx";if(this.target.loopLevel||!this.hasSafeContext){ctxStr=generateId("ctx");this.helpers.add("capture");this.define(ctxStr,`capture(ctx)`);} 1889let slotStr=[];for(let slotName in ast.slots){const slotAst=ast.slots[slotName];const params=[];if(slotAst.content){const name=this.compileInNewTarget("slot",slotAst.content,ctx,slotAst.on);params.push(`__render: ${name}.bind(this), __ctx: ${ctxStr}`);} 1890const scope=ast.slots[slotName].scope;if(scope){params.push(`__scope: "${scope}"`);} 1891if(ast.slots[slotName].attrs){params.push(...this.formatPropObject(ast.slots[slotName].attrs,ast.slots[slotName].attrsTranslationCtx,ctx.translationCtx));} 1892const slotInfo=`{${params.join(", ")}}`;slotStr.push(`'${slotName}': ${slotInfo}`);} 1893slotDef=`{${slotStr.join(", ")}}`;} 1894if(slotDef&&!(ast.dynamicProps||hasSlotsProp)){this.helpers.add("markRaw");props.push(`slots: markRaw(${slotDef})`);} 1895let propString=this.getPropString(props,ast.dynamicProps);let propVar;if((slotDef&&(ast.dynamicProps||hasSlotsProp))||this.dev){propVar=generateId("props");this.define(propVar,propString);propString=propVar;} 1896if(slotDef&&(ast.dynamicProps||hasSlotsProp)){this.helpers.add("markRaw");this.addLine(`${propVar}.slots = markRaw(Object.assign(${slotDef}, ${propVar}.slots))`);} 1897let expr;if(ast.isDynamic){expr=generateId("Comp");this.define(expr,compileExpr(ast.name));} 1898else{expr=`\`${ast.name}\``;} 1899if(this.dev){this.addLine(`helpers.validateProps(${expr}, ${propVar}, this);`);} 1900if(block&&(ctx.forceNewBlock===false||ctx.tKeyExpr)){this.insertAnchor(block);} 1901let keyArg=this.generateComponentKey();if(ctx.tKeyExpr){keyArg=`${ctx.tKeyExpr} + ${keyArg}`;} 1902let id=generateId("comp");const propList=[];for(let p in ast.props||{}){let[name,suffix]=p.split(".");if(!suffix){propList.push(`"${name}"`);}} 1903this.staticDefs.push({id,expr:`app.createComponent(${ast.isDynamic ? null : expr}, ${!ast.isDynamic}, ${!!ast.slots}, ${!!ast.dynamicProps}, [${propList}])`,});if(ast.isDynamic){keyArg=`(${expr}).name + ${keyArg}`;} 1904let blockExpr=`${id}(${propString}, ${keyArg}, node, this, ${ast.isDynamic ? expr : null})`;if(ast.isDynamic){blockExpr=`toggler(${expr}, ${blockExpr})`;} 1905if(ast.on){blockExpr=this.wrapWithEventCatcher(blockExpr,ast.on);} 1906block=this.createBlock(block,"multi",ctx);this.insertBlock(blockExpr,block,ctx);return block.varName;}
1907wrapWithEventCatcher(expr,on){this.helpers.add("createCatcher");let name=generateId("catcher");let spec={};let handlers=[];for(let ev in on){let handlerId=generateId("hdlr");let idx=handlers.push(handlerId)-1;spec[ev]=idx;const handler=this.generateHandlerCode(ev,on[ev]);this.define(handlerId,handler);} 1908this.staticDefs.push({id:name,expr:`createCatcher(${JSON.stringify(spec)})`});return`${name}(${expr}, [${handlers.join(",")}])`;} 1909compileTSlot(ast,ctx){this.helpers.add("callSlot");let{block}=ctx;let blockString;let slotName;let dynamic=false;let isMultiple=false;if(ast.name.match(INTERP_REGEXP)){dynamic=true;isMultiple=true;slotName=interpolate(ast.name);} 1910else{slotName="'"+ast.name+"'";isMultiple=isMultiple||this.slotNames.has(ast.name);this.slotNames.add(ast.name);} 1911const attrs={...ast.attrs};const dynProps=attrs["t-props"];delete attrs["t-props"];let key=this.target.loopLevel?`key${this.target.loopLevel}`:"key";if(isMultiple){key=this.generateComponentKey(key);} 1912const props=ast.attrs?this.formatPropObject(attrs,ast.attrsTranslationCtx,ctx.translationCtx):[];const scope=this.getPropString(props,dynProps);if(ast.defaultContent){const name=this.compileInNewTarget("defaultContent",ast.defaultContent,ctx);blockString=`callSlot(ctx, node, ${key}, ${slotName}, ${dynamic}, ${scope}, ${name}.bind(this))`;} 1913else{if(dynamic){let name=generateId("slot");this.define(name,slotName);blockString=`toggler(${name}, callSlot(ctx, node, ${key}, ${name}, ${dynamic}, ${scope}))`;} 1914else{blockString=`callSlot(ctx, node, ${key}, ${slotName}, ${dynamic}, ${scope})`;}} 1915if(ast.on){blockString=this.wrapWithEventCatcher(blockString,ast.on);} 1916if(block){this.insertAnchor(block);} 1917block=this.createBlock(block,"multi",ctx);this.insertBlock(blockString,block,{...ctx,forceNewBlock:false});return block.varName;} 1918compileTTranslation(ast,ctx){if(ast.content){return this.compileAST(ast.content,Object.assign({},ctx,{translate:false}));} 1919return null;} 1920compileTTranslationContext(ast,ctx){if(ast.content){return this.compileAST(ast.content,Object.assign({},ctx,{translationCtx:ast.translationCtx}));} 1921return null;} 1922compileTPortal(ast,ctx){if(!this.staticDefs.find((d)=>d.id==="Portal")){this.staticDefs.push({id:"Portal",expr:`app.Portal`});} 1923let{block}=ctx;const name=this.compileInNewTarget("slot",ast.content,ctx);let ctxStr="ctx";if(this.target.loopLevel||!this.hasSafeContext){ctxStr=generateId("ctx");this.helpers.add("capture");this.define(ctxStr,`capture(ctx)`);} 1924let id=generateId("comp");this.staticDefs.push({id,expr:`app.createComponent(null, false, true, false, false)`,});const target=compileExpr(ast.target);const key=this.generateComponentKey();const blockString=`${id}({target: ${target},slots: {'default': {__render: ${name}.bind(this), __ctx: ${ctxStr}}}}, ${key}, node, ctx, Portal)`;if(block){this.insertAnchor(block);} 1925block=this.createBlock(block,"multi",ctx);this.insertBlock(blockString,block,{...ctx,forceNewBlock:false});return block.varName;}} 1926const cache=new WeakMap();function parse(xml,customDir){const ctx={inPreTag:false,customDirectives:customDir,};if(typeof xml==="string"){const elem=parseXML(`<t>${xml}</t>`).firstChild;return _parse(elem,ctx);} 1927let ast=cache.get(xml);if(!ast){ast=_parse(xml.cloneNode(true),ctx);cache.set(xml,ast);} 1928return ast;} 1929function _parse(xml,ctx){normalizeXML(xml);return parseNode(xml,ctx)||{type:0,value:""};} 1930function parseNode(node,ctx){if(!(node instanceof Element)){return parseTextCommentNode(node,ctx);} 1931return(parseTCustom(node,ctx)||parseTDebugLog(node,ctx)||parseTForEach(node,ctx)||parseTIf(node,ctx)||parseTPortal(node,ctx)||parseTCall(node,ctx)||parseTCallBlock(node)||parseTTranslation(node,ctx)||parseTTranslationContext(node,ctx)||parseTKey(node,ctx)||parseTEscNode(node,ctx)||parseTOutNode(node,ctx)||parseTSlot(node,ctx)||parseComponent(node,ctx)||parseDOMNode(node,ctx)||parseTSetNode(node,ctx)||parseTNode(node,ctx));} 1932function parseTNode(node,ctx){if(node.tagName!=="t"){return null;} 1933return parseChildNodes(node,ctx);} 1934const lineBreakRE=/[\r\n]/;function parseTextCommentNode(node,ctx){if(node.nodeType===Node.TEXT_NODE){let value=node.textContent||"";if(!ctx.inPreTag&&lineBreakRE.test(value)&&!value.trim()){return null;} 1935return{type:0,value};} 1936else if(node.nodeType===Node.COMMENT_NODE){return{type:1,value:node.textContent||""};} 1937return null;} 1938function parseTCustom(node,ctx){if(!ctx.customDirectives){return null;} 1939const nodeAttrsNames=node.getAttributeNames();
1939for(let attr of nodeAttrsNames){if(attr==="t-custom"||attr==="t-custom-"){throw new OwlError("Missing custom directive name with t-custom directive");} 1940if(attr.startsWith("t-custom-")){const directiveName=attr.split(".")[0].slice(9);const customDirective=ctx.customDirectives[directiveName];if(!customDirective){throw new OwlError(`Custom directive "${directiveName}" is not defined`);} 1941const value=node.getAttribute(attr);const modifiers=attr.split(".").slice(1);node.removeAttribute(attr);try{customDirective(node,value,modifiers);} 1942catch(error){throw new OwlError(`Custom directive "${directiveName}" throw the following error: ${error}`);} 1943return parseNode(node,ctx);}} 1944return null;} 1945function parseTDebugLog(node,ctx){if(node.hasAttribute("t-debug")){node.removeAttribute("t-debug");const content=parseNode(node,ctx);const ast={type:12,content,};if(content===null||content===void 0?void 0:content.hasNoRepresentation){ast.hasNoRepresentation=true;} 1946return ast;} 1947if(node.hasAttribute("t-log")){const expr=node.getAttribute("t-log");node.removeAttribute("t-log");const content=parseNode(node,ctx);const ast={type:13,expr,content,};if(content===null||content===void 0?void 0:content.hasNoRepresentation){ast.hasNoRepresentation=true;} 1948return ast;} 1949return null;} 1950const hasDotAtTheEnd=/\.[\w_]+\s*$/;const hasBracketsAtTheEnd=/\[[^\[]+\]\s*$/;const ROOT_SVG_TAGS=new Set(["svg","g","path"]);function parseDOMNode(node,ctx){const{tagName}=node;const dynamicTag=node.getAttribute("t-tag");node.removeAttribute("t-tag");if(tagName==="t"&&!dynamicTag){return null;} 1951if(tagName.startsWith("block-")){throw new OwlError(`Invalid tag name: '${tagName}'`);} 1952ctx=Object.assign({},ctx);if(tagName==="pre"){ctx.inPreTag=true;} 1953let ns=!ctx.nameSpace&&ROOT_SVG_TAGS.has(tagName)?"http://www.w3.org/2000/svg":null;const ref=node.getAttribute("t-ref");node.removeAttribute("t-ref");const nodeAttrsNames=node.getAttributeNames();let attrs=null;let attrsTranslationCtx=null;let on=null;let model=null;for(let attr of nodeAttrsNames){const value=node.getAttribute(attr);if(attr==="t-on"||attr==="t-on-"){throw new OwlError("Missing event name with t-on directive");} 1954if(attr.startsWith("t-on-")){on=on||{};on[attr.slice(5)]=value;} 1955else if(attr.startsWith("t-model")){if(!["input","select","textarea"].includes(tagName)){throw new OwlError("The t-model directive only works with <input>, <textarea> and <select>");} 1956let baseExpr,expr;if(hasDotAtTheEnd.test(value)){const index=value.lastIndexOf(".");baseExpr=value.slice(0,index);expr=`'${value.slice(index + 1)}'`;} 1957else if(hasBracketsAtTheEnd.test(value)){const index=value.lastIndexOf("[");baseExpr=value.slice(0,index);expr=value.slice(index+1,-1);} 1958else{throw new OwlError(`Invalid t-model expression: "${value}" (it should be assignable)`);} 1959const typeAttr=node.getAttribute("type");const isInput=tagName==="input";const isSelect=tagName==="select";const isCheckboxInput=isInput&&typeAttr==="checkbox";const isRadioInput=isInput&&typeAttr==="radio";const hasTrimMod=attr.includes(".trim");const hasLazyMod=hasTrimMod||attr.includes(".lazy");const hasNumberMod=attr.includes(".number");const eventType=isRadioInput?"click":isSelect||hasLazyMod?"change":"input";model={baseExpr,expr,targetAttr:isCheckboxInput?"checked":"value",specialInitTargetAttr:isRadioInput?"checked":null,eventType,hasDynamicChildren:false,shouldTrim:hasTrimMod,shouldNumberize:hasNumberMod,};if(isSelect){ctx=Object.assign({},ctx);ctx.tModelInfo=model;}} 1960else if(attr.startsWith("block-")){throw new OwlError(`Invalid attribute: '${attr}'`);} 1961else if(attr==="xmlns"){ns=value;} 1962else if(attr.startsWith("t-translation-context-")){const attrName=attr.slice(22);attrsTranslationCtx=attrsTranslationCtx||{};attrsTranslationCtx[attrName]=value;} 1963else if(attr!=="t-name"){if(attr.startsWith("t-")&&!attr.startsWith("t-att")){throw new OwlError(`Unknown QWeb directive: '${attr}'`);} 1964const tModel=ctx.tModelInfo;if(tModel&&["t-att-value","t-attf-value"].includes(attr)){tModel.hasDynamicChildren=true;} 1965attrs=attrs||{};attrs[attr]=value;}} 1966if(ns){ctx.nameSpace=ns;} 1967const children=parseChildren(node,ctx);return{type:2,tag:tagName,dynamicTag,attrs,attrsTranslationCtx,on,ref,content:children,model,ns,};} 1968function parseTEscNode(node,ctx){if(!node.hasAttribute("t-esc")){return null;} 1969const escValue=node.getAttribute("t-esc");node.removeAttribute("t-esc");const tesc={type:4,expr:escValue,defaultValue:node.textContent||"",};let ref=node.getAttribute("t-ref");node.removeAttribute("t-ref");const ast=parseNode(node,ctx);if(!ast){return tesc;} 1970if(ast.type===2){return{...ast,ref,content:[tesc],};} 1971return tesc;} 1972function parseTOutNode(node,ctx){if(!node.hasAttribute("t-out")&&!node.hasAttribute("t-raw")){return null;} 1973if(node.hasAttribute("t-raw")){console.warn(`t-raw has been deprecated
1973in favor of t-out. If the value to render is not wrapped by the "markup" function, it will be escaped`);} 1974const expr=(node.getAttribute("t-out")||node.getAttribute("t-raw"));node.removeAttribute("t-out");node.removeAttribute("t-raw");const tOut={type:8,expr,body:null};const ref=node.getAttribute("t-ref");node.removeAttribute("t-ref");const ast=parseNode(node,ctx);if(!ast){return tOut;} 1975if(ast.type===2){tOut.body=ast.content.length?ast.content:null;return{...ast,ref,content:[tOut],};} 1976return tOut;} 1977function parseTForEach(node,ctx){if(!node.hasAttribute("t-foreach")){return null;} 1978const html=node.outerHTML;const collection=node.getAttribute("t-foreach");node.removeAttribute("t-foreach");const elem=node.getAttribute("t-as")||"";node.removeAttribute("t-as");const key=node.getAttribute("t-key");if(!key){throw new OwlError(`"Directive t-foreach should always be used with a t-key!" (expression: t-foreach="${collection}" t-as="${elem}")`);} 1979node.removeAttribute("t-key");const memo=node.getAttribute("t-memo")||"";node.removeAttribute("t-memo");const body=parseNode(node,ctx);if(!body){return null;} 1980const hasNoTCall=!html.includes("t-call");const hasNoFirst=hasNoTCall&&!html.includes(`${elem}_first`);const hasNoLast=hasNoTCall&&!html.includes(`${elem}_last`);const hasNoIndex=hasNoTCall&&!html.includes(`${elem}_index`);const hasNoValue=hasNoTCall&&!html.includes(`${elem}_value`);return{type:9,collection,elem,body,memo,key,hasNoFirst,hasNoLast,hasNoIndex,hasNoValue,};} 1981function parseTKey(node,ctx){if(!node.hasAttribute("t-key")){return null;} 1982const key=node.getAttribute("t-key");node.removeAttribute("t-key");const content=parseNode(node,ctx);if(!content){return null;} 1983const ast={type:10,expr:key,content,};if(content.hasNoRepresentation){ast.hasNoRepresentation=true;} 1984return ast;} 1985function parseTCall(node,ctx){if(!node.hasAttribute("t-call")){return null;} 1986const subTemplate=node.getAttribute("t-call");const context=node.getAttribute("t-call-context");node.removeAttribute("t-call");node.removeAttribute("t-call-context");if(node.tagName!=="t"){const ast=parseNode(node,ctx);const tcall={type:7,name:subTemplate,body:null,context};if(ast&&ast.type===2){ast.content=[tcall];return ast;} 1987if(ast&&ast.type===11){return{...ast,slots:{default:{content:tcall,scope:null,on:null,attrs:null,attrsTranslationCtx:null,},},};}} 1988const body=parseChildren(node,ctx);return{type:7,name:subTemplate,body:body.length?body:null,context,};} 1989function parseTCallBlock(node,ctx){if(!node.hasAttribute("t-call-block")){return null;} 1990const name=node.getAttribute("t-call-block");return{type:15,name,};} 1991function parseTIf(node,ctx){if(!node.hasAttribute("t-if")){return null;} 1992const condition=node.getAttribute("t-if");node.removeAttribute("t-if");const content=parseNode(node,ctx)||{type:0,value:""};let nextElement=node.nextElementSibling;const tElifs=[];while(nextElement&&nextElement.hasAttribute("t-elif")){const condition=nextElement.getAttribute("t-elif");nextElement.removeAttribute("t-elif");const tElif=parseNode(nextElement,ctx);const next=nextElement.nextElementSibling;nextElement.remove();nextElement=next;if(tElif){tElifs.push({condition,content:tElif});}} 1993let tElse=null;if(nextElement&&nextElement.hasAttribute("t-else")){nextElement.removeAttribute("t-else");tElse=parseNode(nextElement,ctx);nextElement.remove();} 1994return{type:5,condition,content,tElif:tElifs.length?tElifs:null,tElse,};} 1995function parseTSetNode(node,ctx){if(!node.hasAttribute("t-set")){return null;} 1996const name=node.getAttribute("t-set");const value=node.getAttribute("t-value")||null;const defaultValue=node.innerHTML===node.textContent?node.textContent||null:null;let body=null;if(node.textContent!==node.innerHTML){body=parseChildren(node,ctx);} 1997return{type:6,name,value,defaultValue,body,hasNoRepresentation:true};} 1998const directiveErrorMap=new Map([["t-ref","t-ref is no longer supported on components. Consider exposing only the public part of the component's API through a callback prop.",],["t-att","t-att makes no sense on component: props are already treated as expressions"],["t-attf","t-attf is not supported on components: use template strings for string interpolation in props",],]);function parseComponent(node,ctx){let name=node.tagName;const firstLetter=name[0];let isDynamic=node.hasAttribute("t-component");if(isDynamic&&name!=="t"){throw new OwlError(`Directive 't-component' can only be used on <t>
1998 nodes (used on a <${name}>)`);} 1999if(!(firstLetter===firstLetter.toUpperCase()||isDynamic)){return null;} 2000if(isDynamic){name=node.getAttribute("t-component");node.removeAttribute("t-component");} 2001const dynamicProps=node.getAttribute("t-props");node.removeAttribute("t-props");const defaultSlotScope=node.getAttribute("t-slot-scope");node.removeAttribute("t-slot-scope");let on=null;let props=null;let propsTranslationCtx=null;for(let name of node.getAttributeNames()){const value=node.getAttribute(name);if(name.startsWith("t-translation-context-")){const attrName=name.slice(22);propsTranslationCtx=propsTranslationCtx||{};propsTranslationCtx[attrName]=value;} 2002else if(name.startsWith("t-")){if(name.startsWith("t-on-")){on=on||{};on[name.slice(5)]=value;} 2003else{const message=directiveErrorMap.get(name.split("-").slice(0,2).join("-"));throw new OwlError(message||`unsupported directive on Component: ${name}`);}} 2004else{props=props||{};props[name]=value;}} 2005let slots=null;if(node.hasChildNodes()){const clone=node.cloneNode(true);const slotNodes=Array.from(clone.querySelectorAll("[t-set-slot]"));for(let slotNode of slotNodes){if(slotNode.tagName!=="t"){throw new OwlError(`Directive 't-set-slot' can only be used on <t> nodes (used on a <${slotNode.tagName}>)`);} 2006const name=slotNode.getAttribute("t-set-slot");let el=slotNode.parentElement;let isInSubComponent=false;while(el&&el!==clone){if(el.hasAttribute("t-component")||el.tagName[0]===el.tagName[0].toUpperCase()){isInSubComponent=true;break;} 2007el=el.parentElement;} 2008if(isInSubComponent||!el){continue;} 2009slotNode.removeAttribute("t-set-slot");slotNode.remove();const slotAst=parseNode(slotNode,ctx);let on=null;let attrs=null;let attrsTranslationCtx=null;let scope=null;for(let attributeName of slotNode.getAttributeNames()){const value=slotNode.getAttribute(attributeName);if(attributeName==="t-slot-scope"){scope=value;continue;} 2010else if(attributeName.startsWith("t-translation-context-")){const attrName=attributeName.slice(22);attrsTranslationCtx=attrsTranslationCtx||{};attrsTranslationCtx[attrName]=value;} 2011else if(attributeName.startsWith("t-on-")){on=on||{};on[attributeName.slice(5)]=value;} 2012else{attrs=attrs||{};attrs[attributeName]=value;}} 2013slots=slots||{};slots[name]={content:slotAst,on,attrs,attrsTranslationCtx,scope};} 2014const defaultContent=parseChildNodes(clone,ctx);slots=slots||{};if(defaultContent&&!slots.default){slots.default={content:defaultContent,on,attrs:null,attrsTranslationCtx:null,scope:defaultSlotScope,};}} 2015return{type:11,name,isDynamic,dynamicProps,props,propsTranslationCtx,slots,on,};} 2016function parseTSlot(node,ctx){if(!node.hasAttribute("t-slot")){return null;} 2017const name=node.getAttribute("t-slot");node.removeAttribute("t-slot");let attrs=null;let attrsTranslationCtx=null;let on=null;for(let attributeName of node.getAttributeNames()){const value=node.getAttribute(attributeName);if(attributeName.startsWith("t-on-")){on=on||{};on[attributeName.slice(5)]=value;} 2018else if(attributeName.startsWith("t-translation-context-")){const attrName=attributeName.slice(22);attrsTranslationCtx=attrsTranslationCtx||{};attrsTranslationCtx[attrName]=value;} 2019else{attrs=attrs||{};attrs[attributeName]=value;}} 2020return{type:14,name,attrs,attrsTranslationCtx,on,defaultContent:parseChildNodes(node,ctx),};} 2021function wrapInTTranslationAST(r){const ast={type:16,content:r};if(r===null||r===void 0?void 0:r.hasNoRepresentation){ast.hasNoRepresentation=true;} 2022return ast;} 2023function parseTTranslation(node,ctx){if(node.getAttribute("t-translation")!=="off"){return null;} 2024node.removeAttribute("t-translation");const result=parseNode(node,ctx);if((result===null||result===void 0?void 0:result.type)===3){const children=result.content.map(wrapInTTranslationAST);return makeASTMulti(children);} 2025return wrapInTTranslationAST(result);} 2026function wrapInTTranslationContextAST(r,translationCtx){const ast={type:17,content:r,translationCtx,};if(r===null||r===void 0?void 0:r.hasNoRepresentation){ast.hasNoRepresentation=true;} 2027return ast;} 2028function parseTTranslationContext(node,ctx){const translationCtx=node.getAttribute("t-translation-context");if(!translationCtx){return null;} 2029node.removeAttribute("t-translation-context");const result=parseNode(node,ctx);if((result===null||result===void 0?void 0:result.type)===3){const children=result.content.map((c)=>wrapInTTranslationContextAST(c,translationCtx));return makeASTMulti(children);} 2030return wrapInTTranslationContextAST(result,translationCtx);} 2031function parseTPortal(node,ctx){if(!node.hasAttribute("t-portal")){return null;} 2032const target=node.getAttribute("t-portal");node.removeAttribute("t-portal");const content=parseNode(node,ctx);if(!content){return{type:0,value:"",};} 2033return{type:18,target,content,};} 2034function parseChildren(node,ctx){const children=[];for(let child of node.childNodes){const childAst=parseNode(child,ctx);if(childAst){if(childAst.type===3){children.push(...childAst.content);} 2035else{children.push(childAst);}}} 2036return children;} 2037function makeASTMulti(children){const ast={type:3,content:children};if(children.every((c)=>c.hasNoRepresentation)){ast.hasNoRepresentation=true;} 2038return ast;} 2039function parseChildNodes(node,ctx){const children=parseChildren(node,ctx);switch(children.length){case 0:return null;case 1:return children[0];default:return makeASTMulti(children);}} 2040function normalizeTIf(el){let tbranch=el.querySelectorAll("[t-elif], [t-else]");for(let i=0,ilen=tbranch.length;i<ilen;i++){let node=tbranch[i];let prevElem=node.previousElementSibling;let pattr=(name)=>prevElem.getAttribute(name);let nattr=(name)=>+!!node.getAttribute(name);if(prevElem&&(pattr("t-if")||pattr("t-elif"))){if(pattr("t-foreach")){throw new OwlError("t-if cannot stay at the same level as t-foreach when using t-elif or t-else");} 2041if(["t-if","t-elif","t-else"].map(nattr).reduce(function(a,b){return a+b;})>1){throw new OwlError("Only one conditional branching directive is allowed per node");} 2042let textNode;while((textNode=node.previousSibling)!==prevElem){if(textNode.nodeValue.trim().length&&textNode.nodeType!==8){throw new OwlError("text is not allowed between branching directives");} 2043textNode.remove();}} 2044else{throw new OwlError("t-elif and t-else directives must be preceded by a t-if or t-elif directive");}}} 2045function normalizeTEscTOut(el){for(const d of["t-esc","t-out"]){const elements=[...el.querySelectorAll(`[${d}]`)].filter((el)=>el.tagName[0]===el.tagName[0].toUpperCase()||el.hasAttribute("t-component"));for(const el of elements){if(el.childNodes.length){throw new OwlError(`Cannot have ${d} on a component that already has content`);} 2046const value=el.getAttribute(d);el.removeAttribute(d);const t=el.ownerDocument.createElement("t");if(value!=null){t.setAttribute(d,value);} 2047el.appendChild(t);}}} 2048function normalizeXML(el){normalizeTIf(el);normalizeTEscTOut(el);} 2049function compile(template,options={hasGlobalValues:false,}){const ast=parse(template,options.customDirectives);const hasSafeContext=template instanceof Node?!(template instanceof Element)||template.querySelector("[t-set], [t-call]")===null:!template.includes("t-set")&&!template.includes("t-call");const codeGenerator=new CodeGenerator(ast,{...options,hasSafeContext});const code=codeGenerator.generateCode();try{return new Function("app, bdom, helpers",code);} 2050catch(originalError){const{name}=options;const nameStr=name?`template "${name}"`:"anonymous template";const err=new OwlError(`Failed to compile ${nameStr}: ${originalError.message}\n\ngenerated code:\nfunction(app, bdom, helpers) {\n${code}\n}`);err.cause=originalError;throw err;}} 2051const version="2.8.2";class Scheduler{constructor(){this.tasks=new Set();this.frame=0;this.delayedRenders=[];this.cancelledNodes=new Set();this.processing=false;this.requestAnimationFrame=Scheduler.requestAnimationFrame;} 2052addFiber(fiber){this.tasks.add(fiber.root);} 2053scheduleDestroy(node){this.cancelledNodes.add(node);if(this.frame===0){this.frame=this.requestAnimationFrame(()=>this.processTasks());}} 2054flush(){if(this.delayedRenders.length){let renders=this.delayedRenders;this.delayedRenders=[];for(let f of renders){if(f.root&&f.node.status!==3&&f.node.fiber===f){f.render();}}} 2055if(this.frame===0){this.frame=this.requestAnimationFrame(()=>this.processTasks());}} 2056processTasks(){if(this.processing){return;} 2057this.processing=true;this.frame=0;for(let node of this.cancelledNodes){node._destroy();} 2058this.cancelledNodes.clear();for(let task of this.tasks){this.processFiber(task);} 2059for(let task of this.tasks){if(task.node.status===3){this.tasks.delete(task);}} 2060this.processing=false;} 2061processFiber(fiber){if(fiber.root!==fiber){this.tasks.delete(fiber);return;} 2062const hasError=fibersInError.has(fiber);if(hasError&&fiber.counter!==0){this.tasks.delete(fiber);return;} 2063if(fiber.node.status===3){this.tasks.delete(fiber);return;} 2064if(fiber.counter===0){if(!hasError){fiber.complete();} 2065if(fiber.appliedToDom){this.tasks.delete(fiber);}}}} 2066Scheduler.requestAnimationFrame=window.requestAnimationFrame.bind(window);let hasBeenLogged=false;const apps=new Set();window.__OWL_DEVTOOLS__||(window.__OWL_DEVTOOLS__={apps,Fiber,RootFiber,toRaw,reactive});class App extends TemplateSet{constructor(Root,config={}){super(config);
2066this.scheduler=new Scheduler();this.subRoots=new Set();this.root=null;this.name=config.name||"";this.Root=Root;apps.add(this);if(config.test){this.dev=true;} 2067this.warnIfNoStaticProps=config.warnIfNoStaticProps||false;if(this.dev&&!config.test&&!hasBeenLogged){console.info(`Owl is running in 'dev' mode.`);hasBeenLogged=true;} 2068const env=config.env||{};const descrs=Object.getOwnPropertyDescriptors(env);this.env=Object.freeze(Object.create(Object.getPrototypeOf(env),descrs));this.props=config.props||{};} 2069mount(target,options){const root=this.createRoot(this.Root,{props:this.props});this.root=root.node;this.subRoots.delete(root.node);return root.mount(target,options);} 2070createRoot(Root,config={}){const props=config.props||{};const env=this.env;if(config.env){this.env=config.env;} 2071const restore=saveCurrent();const node=this.makeNode(Root,props);restore();if(config.env){this.env=env;} 2072this.subRoots.add(node);return{node,mount:(target,options)=>{App.validateTarget(target);if(this.dev){validateProps(Root,props,{__owl__:{app:this}});} 2073const prom=this.mountNode(node,target,options);return prom;},destroy:()=>{this.subRoots.delete(node);node.destroy();this.scheduler.processTasks();},};} 2074makeNode(Component,props){return new ComponentNode(Component,props,this,null,null);} 2075mountNode(node,target,options){const promise=new Promise((resolve,reject)=>{let isResolved=false;node.mounted.push(()=>{resolve(node.component);isResolved=true;});let handlers=nodeErrorHandlers.get(node);if(!handlers){handlers=[];nodeErrorHandlers.set(node,handlers);} 2076handlers.unshift((e)=>{if(!isResolved){reject(e);} 2077throw e;});});node.mountComponent(target,options);return promise;} 2078destroy(){if(this.root){for(let subroot of this.subRoots){subroot.destroy();} 2079this.root.destroy();this.scheduler.processTasks();} 2080apps.delete(this);} 2081createComponent(name,isStatic,hasSlotsProp,hasDynamicPropList,propList){const isDynamic=!isStatic;let arePropsDifferent;const hasNoProp=propList.length===0;if(hasSlotsProp){arePropsDifferent=(_1,_2)=>true;} 2082else if(hasDynamicPropList){arePropsDifferent=function(props1,props2){for(let k in props1){if(props1[k]!==props2[k]){return true;}} 2083return Object.keys(props1).length!==Object.keys(props2).length;};} 2084else if(hasNoProp){arePropsDifferent=(_1,_2)=>false;} 2085else{arePropsDifferent=function(props1,props2){for(let p of propList){if(props1[p]!==props2[p]){return true;}} 2086return false;};} 2087const updateAndRender=ComponentNode.prototype.updateAndRender;const initiateRender=ComponentNode.prototype.initiateRender;return(props,key,ctx,parent,C)=>{let children=ctx.children;let node=children[key];if(isDynamic&&node&&node.component.constructor!==C){node=undefined;} 2088const parentFiber=ctx.fiber;if(node){if(arePropsDifferent(node.props,props)||parentFiber.deep||node.forceNextRender){node.forceNextRender=false;updateAndRender.call(node,props,parentFiber);}} 2089else{if(isStatic){const components=parent.constructor.components;if(!components){throw new OwlError(`Cannot find the definition of component "${name}", missing static components key in parent`);} 2090C=components[name];if(!C){throw new OwlError(`Cannot find the definition of component "${name}"`);} 2091else if(!(C.prototype instanceof Component)){throw new OwlError(`"${name}" is not a Component. It must inherit from the Component class`);}} 2092node=new ComponentNode(C,props,this,ctx,key);children[key]=node;initiateRender.call(node,new Fiber(node,parentFiber));} 2093parentFiber.childrenMap[key]=node;return node;};} 2094handleError(...args){return handleError(...args);}} 2095App.validateTarget=validateTarget;App.apps=apps;App.version=version;async function mount(C,target,config={}){return new App(C,config).mount(target,config);} 2096const mainEventHandler=(data,ev,currentTarget)=>{const{data:_data,modifiers}=filterOutModifiersFromData(data);data=_data;let stopped=false;if(modifiers.length){let selfMode=false;const isSelf=ev.target===currentTarget;for(const mod of modifiers){switch(mod){case"self":selfMode=true;if(isSelf){continue;} 2097else{return stopped;} 2098case"prevent":if((selfMode&&isSelf)||!selfMode) 2099ev.preventDefault();continue;case"stop":if((selfMode&&isSelf)||!selfMode) 2100ev.stopPropagation();stopped=true;continue;}}} 2101if(Object.hasOwnProperty.call(data,0)){const handler=data[0];if(typeof handler!=="function"){throw new OwlError(`Invalid handler (expected a function, received: '${handler}')`);} 2102let node=data[1]?data[1].__owl__:null;if(node?node.status===1:true){handler.call(node?node.component:null,ev);}} 2103return stopped;};function status(component){switch(component.__owl__.status){case 0:return"new";case 2:return"cancelled";case 1:return"mounted";case 3:return"destroyed";}} 2104function useRef(name){const node=getCurrent();const refs=node.refs;return{get el(){const el=refs[name];return inOwnerDocument(el)?el:null;},};} 2105function useEnv(){return getCurrent().component.env;} 2106function extendEnv(currentEnv,extension){const env=Object.create(currentEnv);const descrs=Object.getOwnPropertyDescriptors(extension);return Object.freeze(Object.defineProperties(env,descrs));} 2107function useSubEnv(envExtension){const node=getCurrent();node.component.env=extendEnv(node.component.env,envExtension);useChildSubEnv(envExtension);} 2108function useChildSubEnv(envExtension){const node=getCurrent();node.childEnv=extendEnv(node.childEnv,envExtension);} 2109function useEffect(effect,computeDependencies=()=>[NaN]){let cleanup;let dependencies;onMounted(()=>{dependencies=computeDependencies();cleanup=effect(...dependencies);});onPatched(()=>{const newDeps=computeDependencies();const shouldReapply=newDeps.some((val,i)=>val!==dependencies[i]);if(shouldReapply){dependencies=newDeps;if(cleanup){cleanup();} 2110cleanup=effect(...dependencies);}});onWillUnmount(()=>cleanup&&cleanup());} 2111function useExternalListener(target,eventName,handler,eventParam
2111s){const node=getCurrent();const boundHandler=handler.bind(node.component);onMounted(()=>target.addEventListener(eventName,boundHandler,eventParams));onWillUnmount(()=>target.removeEventListener(eventName,boundHandler,eventParams));} 2112config.shouldNormalizeDom=false;config.mainEventHandler=mainEventHandler;const blockDom={config,mount:mount$1,patch,remove,list,multi,text,toggler,createBlock,html,comment,};const __info__={version:App.version,};TemplateSet.prototype._compileTemplate=function _compileTemplate(name,template){return compile(template,{name,dev:this.dev,translateFn:this.translateFn,translatableAttributes:this.translatableAttributes,customDirectives:this.customDirectives,hasGlobalValues:this.hasGlobalValues,});};exports.App=App;exports.Component=Component;exports.EventBus=EventBus;exports.OwlError=OwlError;exports.__info__=__info__;exports.batched=batched;exports.blockDom=blockDom;exports.htmlEscape=htmlEscape;exports.loadFile=loadFile;exports.markRaw=markRaw;exports.markup=markup;exports.mount=mount;exports.onError=onError;exports.onMounted=onMounted;exports.onPatched=onPatched;exports.onRendered=onRendered;exports.onWillDestroy=onWillDestroy;exports.onWillPatch=onWillPatch;exports.onWillRender=onWillRender;exports.onWillStart=onWillStart;exports.onWillUnmount=onWillUnmount;exports.onWillUpdateProps=onWillUpdateProps;exports.reactive=reactive;exports.status=status;exports.toRaw=toRaw;exports.useChildSubEnv=useChildSubEnv;exports.useComponent=useComponent;exports.useEffect=useEffect;exports.useEnv=useEnv;exports.useExternalListener=useExternalListener;exports.useRef=useRef;exports.useState=useState;exports.useSubEnv=useSubEnv;exports.validate=validate;exports.validateType=validateType;exports.whenReady=whenReady;exports.xml=xml;Object.defineProperty(exports,'__esModule',{value:true});__info__.date='2026-01-30T07:49:47.618Z';__info__.hash='52abf8d';__info__.url='https://github.com/odoo/owl';})(this.owl=this.owl||{});; 2113 2114/* /web/static/lib/owl/odoo_module.js */ 2115odoo.define("@odoo/owl",function(){"use strict";return owl;});; 2116 2117/* /web/static/src/owl2_compatibility/app.js */ 2118(function(){const App=owl.App;const sharedTemplates={};owl.App=class extends App{constructor(_,config){if(!config.test){const missingKeys=["dev","translateFn","translatableAttributes"].filter((key)=>!(key in config));if(missingKeys.length){throw new Error(`Attempted to create an App without some required key(s) (${missingKeys.join( 2119 ", " 2120 )})`);}} 2121super(...arguments);} 2122_compileTemplate(name){if(!(name in sharedTemplates)){sharedTemplates[name]=super._compileTemplate(...arguments);} 2123return sharedTemplates[name];}};owl.App.sharedTemplates=sharedTemplates;owl.App.validateTarget=()=>{};})();; 2124 2125/* /web/static/src/owl2_compatibility/event_target.js */ 2126(function(){const{EventBus}=owl;function wrapCallback(owner,callback){return(ev)=>{callback.call(owner,ev.detail);};} 2127owl.EventBus=class extends EventBus{constructor(...args){super(...args);this.targetsCallbacks=new Map();} 2128on(type,target,callback){if(!this.targetsCallbacks.has(target)){this.targetsCallbacks.set(target,{});} 2129callback=wrapCallback(target,callback);const listeners=this.targetsCallbacks.get(target);if(!listeners[type]){listeners[type]=new Set();} 2130listeners[type].add(callback);return this.addEventListener(type,callback);} 2131off(type,target){const listeners=this.targetsCallbacks.get(target);if(!listeners||!Object.hasOwnProperty.call(listeners,type)){return;}
2132const cbs=listeners[type];for(const callback of cbs){this.removeEventListener(type,callback);} 2133delete listeners[type];if(Object.keys(listeners).length===0){this.targetsCallbacks.delete(target);}}};})();; 2134 2135/* /web/static/src/legacy/js/component_extension.js */ 2136(function(){owl.Component.env={};odoo.widgetSymbol=Symbol('widget');})();; 2137 2138/* /web/static/src/legacy/legacy_component.js */ 2139odoo.define('@web/legacy/legacy_component',async function(require){'use strict';let __exports={};const LegacyComponent=__exports.LegacyComponent=class LegacyComponent extends owl.Component{get el(){const bdom=this.__owl__.bdom;if(!bdom){return null;} 2140const el=(bdom.component&&bdom.component.el)||bdom.firstNode();return el.nodeType===Node.ELEMENT_NODE?el:null;} 2141rpc(){return new Promise((resolve,reject)=>{return this.env.services.rpc(...arguments).then((result)=>{if(owl.status(this)!=="destroyed"){resolve(result);}}).catch((reason)=>{if(owl.status(this)!=="destroyed"){reject(reason);}});});} 2142trigger(eventType,payload){this.__trigger(eventType,payload);} 2143__trigger(eventType,payload){if(this.env[odoo.widgetSymbol]){this.env[odoo.widgetSymbol](eventType);} 2144if(this.el){const ev=new CustomEvent(eventType,{bubbles:true,cancelable:true,detail:payload,});this.el.dispatchEvent(ev);}}} 2145return __exports;});; 2146 2147/* /web/static/lib/jquery/jquery.js */ 2148(function(global,factory){"use strict";if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document");} 2149return factory(w);};}else{factory(global);}})(typeof window!=="undefined"?window:this,function(window,noGlobal){"use strict";var arr=[];var document=window.document;var getProto=Object.getPrototypeOf;var slice=arr.slice;var concat=arr.concat;var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var fnToString=hasOwn.toString;var ObjectFunctionString=fnToString.call(Object);var support={};var isFunction=function isFunction(obj){return typeof obj==="function"&&typeof obj.nodeType!=="number";};var isWindow=function isWindow(obj){return obj!=null&&obj===obj.window;};var preservedScriptAttributes={type:true,src:true,noModule:true};function DOMEval(code,doc,node){doc=doc||document;var i,script=doc.createElement("script");script.text=code;if(node){for(i in preservedScriptAttributes){if(node[i]){script[i]=node[i];}}} 2150doc.head.appendChild(script).parentNode.removeChild(script);} 2151function toType(obj){if(obj==null){return obj+"";} 2152return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj;} 2153var 2154version="3.3.1",jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,length:0,toArray:function(){return slice.call(this);},get:function(num){if(num==null){return slice.call(this);} 2155return num<0?this[num+this.length]:this[num];},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;return ret;},each:function(callback){return jQuery.each(this,callback);},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},slice:function(){return this.pushStack(slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[]);},end:function(){return this.prevObject||this.constructor();},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++;} 2156if(typeof target!=="object"&&!isFunction(target)){target={};} 2157if(i===length){target=this;i--;} 2158for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(name==='__proto__'||target===copy){continue;} 2159if(deep&©&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&Array.isArray(src)?src:[];}else{clone=src&&jQuery.isPlainObject(src)?src:{};} 2160target[name]=jQuery.extend(deep,clone,copy);}
vendor: 38,529 bytes, lines 2160-2330
2160else if(copy!==undefined){target[name]=copy;}}}} 2161return target;};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function(msg){throw new Error(msg);},noop:function(){},isPlainObject:function(obj){var proto,Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return false;} 2162proto=getProto(obj);if(!proto){return true;} 2163Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString;},isEmptyObject:function(obj){var name;for(name in obj){return false;} 2164return true;},globalEval:function(code){DOMEval(code);},each:function(obj,callback){var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i<length;i++){if(callback.call(obj[i],i,obj[i])===false){break;}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===false){break;}}} 2165return obj;},trim:function(text){return text==null?"":(text+"").replace(rtrim,"");},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArrayLike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr);}else{push.call(ret,arr);}} 2166return ret;},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i);},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j];} 2167first.length=i;return first;},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i]);}} 2168return matches;},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems)){length=elems.length;for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}} 2169return concat.apply([],ret);},guid:1,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator];} 2170jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);if(isFunction(obj)||isWindow(obj)){return false;} 2171return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj;} 2172var Sizzle=(function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date(),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;} 2173return 0;},hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i;}} 2174return-1;},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+identifier+")"),"CLASS":new RegExp("^\\.("+identifier+")"),"TAG":new RegExp("^("+identifier+"|[*])"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ 2175whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD";} 2176return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ";} 2177return"\\"+ch;},unloadHandler=function(){setDocument();},disabledAncestor=addCombinator(function(elem){return elem.disabled===true&&("form"in elem||"label"in elem);},{dir:"parentNode",next:"legend"});try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){} 2178target.length=j-1;}};} 2179function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results;} 2180if(!seed){if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context);} 2181context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}} 2182if(support.qsa&&!compilerCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(nodeType!==1){newContext=context;newSelector=selector;}else if(context.nodeName.toLowerCase()!=="object"){if((nid=context.getAttribute("id"))){nid=nid.replace(rcssescape,fcssescape);}else{context.setAttribute("id",(nid=expando));} 2183groups=tokenize(selector);i=groups.length;while(i--){groups[i]="#"+nid+" "+toSelector(groups[i]);} 2184newSelector=groups.join(",");newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;} 2185if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){}finally{if(nid===expando){context.removeAttribute("id");}}}}}} 2186return select(selector.replace(rtrim,"$1"),context,results,seed);} 2187function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];} 2188return(cache[key+" "]=value);} 2189return cache;} 2190function markFunction(fn){fn[expando]=true;return fn;} 2191function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el);}catch(e){return false;}finally{if(el.parentNode){el.parentNode.removeChild(el);} 2192el=null;}} 2193function addHandle(attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler;}} 2194function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&a.sourceIndex-b.sourceIndex;if(diff){return diff;} 2195if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}} 2196return a?1:-1;} 2197function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};} 2198function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};} 2199function createDisabledPseudo(disabled){return function(elem){if("form"in elem){if(elem.parentNode&&elem.disabled===false){if("label"in elem){if("label"in elem.parentNode){return elem.parentNode.disabled===disabled;}else{return elem.disabled===disabled;}} 2200return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&disabledAncestor(elem)===disabled;} 2201return elem.disabled===disabled;}else if("label"in elem){return elem.disabled===disabled;} 2202return false;};} 2203function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});} 2204function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;} 2205support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document;} 2206document=doc;docElem=document.documentElement;documentIsHTML=!isXML(document);if(preferredDoc!==document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow){if(subWindow.addEventListener){subWindow.addEventListener("unload",unloadHandler,false);}else if(subWindow.attachEvent){subWindow.attachEvent("onunload",unloadHandler);}} 2207support.attributes=assert(function(el){el.className="i";return!el.getAttribute("className");});support.getElementsByTagName=assert(function(el){el.appendChild(document.createComment(""));return!el.getElementsByTagName("*").length;});support.getElementsByClassName=rnative.test(document.getElementsByClassName);support.getById=assert(function(el){docElem.appendChild(el).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length;});if(support.getById){Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[];}};}else{Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId;};};Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];} 2208elems=context.getElementsByName(id);i=0;while((elem=elems[i++])){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}}} 2209return[];}};} 2210Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else if(support.qsa){return context.querySelectorAll(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}} 2211return tmp;} 2212return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(document.querySelectorAll))){assert(function(el){docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a>"+"<select id='"+expando+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(el.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");} 2213if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");} 2214if(!el.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");} 2215if(!el.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");} 2216if(!el.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}});assert(function(el){el.innerHTML="<a href='' disabled='disabled'></a>"+"<select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input).setAttribute("name","D");if(el.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=");} 2217if(el.querySelectorAll(":enabled").length!==2){rbuggyQSA.push(":enabled",":disabled");} 2218docElem.appendChild(el).disabled=true;if(el.querySelectorAll(":disabled").length!==2){rbuggyQSA.push(":enabled",":disabled");} 2219el.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});} 2220if((support.matchesSelector=rnative.test((matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(el){support.disconnectedMatch=matches.call(el,"*");matches.call(el,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});} 2221rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}} 2222return false;};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0;} 2223var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;} 2224compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)){return-1;} 2225if(b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)){return 1;} 2226return sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;} 2227return compare&4?-1:1;}:function(a,b){if(a===b){hasDuplicate=true;return 0;} 2228var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);} 2229cur=a;while((cur=cur.parentNode)){ap.unshift(cur);} 2230cur=b;while((cur=cur.parentNode)){bp.unshift(cur);} 2231while(ap[i]===bp[i]){i++;} 2232return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0;};return document;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem);} 2233expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&!compilerCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){}} 2234return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context);} 2235return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem);} 2236var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null;};Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape);};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}} 2237while(j--){results.splice(duplicates[j],1);}} 2238sortInput=null;return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;} 2239return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";} 2240return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);} 2241match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){Sizzle.error(match[0]);} 2242return match;},"PSEUDO":function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;} 2243if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);} 2244return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";} 2245if(!operator){return true;} 2246result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}} 2247start=dir=type==="only"&&!start&&"nextSibling";} 2248return true;} 2249start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;} 2250if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff];} 2251if(node===elem){break;}}}}} 2252diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);} 2253if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};} 2254return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);} 2255lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":createDisabledPseudo(false),"disabled":createDisabledPseudo(true),"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;} 2256return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}} 2257return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text");},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i);} 2258return matchIndexes;}),"odd":createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i);} 2259return matchIndexes;}),"lt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;--i>=0;){matchIndexes.push(i);} 2260return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i);} 2261return matchIndexes;})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i);} 2262for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i);} 2263function setFilters(){} 2264setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0);} 2265soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar;} 2266groups.push((tokens=[]));} 2267matched=false;if((match=rcombinators.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length);} 2268for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length);}} 2269if(!matched){break;}} 2270return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0);};function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value;} 2271return selector;} 2272function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&key==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml);}} 2273return false;}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true;}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={});if(skip&&skip===elem.nodeName.toLowerCase()){elem=elem[dir]||elem;}else if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return(newCache[2]=oldCache[2]);}else{uniqueCache[key]=newCache;if((newCache[2]=matcher(elem,context,xml))){return true;}}}}} 2274return false;};} 2275function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}} 2276return true;}:matchers[0];} 2277function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results);} 2278return results;} 2279function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i);}}}} 2280return newUnmatched;} 2281function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter);} 2282if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector);} 2283return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml);} 2284if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem);}}} 2285if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem));}} 2286postFinder(null,(matcherOut=[]),temp,xml);} 2287i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});} 2288function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret;}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)];}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break;}} 2289return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens));} 2290matchers.push(matcher);}} 2291return elementMatcher(matchers);} 2292function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context===document||context||outermost;} 2293for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!==document){setDocument(elem);xml=!documentIsHTML;} 2294while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){results.push(elem);break;}} 2295if(outermost){dirruns=dirrunsUnique;}} 2296if(bySet){if((elem=!matcher&&elem)){matchedCount--;} 2297if(seed){unmatched.push(elem);}}} 2298matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);} 2299if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}} 2300setMatched=condense(setMatched);} 2301push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}} 2302if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;} 2303return unmatched;};return bySet?markFunction(superMatcher):superMatcher;} 2304compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);} 2305i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}} 2306cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;} 2307return cached;};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}else if(compiled){context=context.parentNode;} 2308selector=selector.slice(tokens.shift().value.length);} 2309i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;} 2310if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;} 2311break;}}}} 2312(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context);return results;};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(el){return el.compareDocumentPosition(document.createElement("fieldset"))&1;});if(!assert(function(el){el.innerHTML="<a href='#'></a>";return el.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});} 2313if(!support.attributes||!assert(function(el){el.innerHTML="<input/>";el.firstChild.setAttribute("value","");return el.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});} 2314if(!assert(function(el){return el.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null;}});} 2315return Sizzle;})(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break;} 2316matched.push(elem);}} 2317return matched;};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n);}} 2318return matched;};var rneedsContext=jQuery.expr.match.needsContext;function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();};var rsingleTag=(/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i);function winnow(elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});} 2319if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});} 2320if(typeof qualifier!=="string"){return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});} 2321return jQuery.filter(qualifier,elements,not);} 2322jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";} 2323if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(elem,expr)?[elem]:[];} 2324return jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));};jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true;}}}));} 2325ret=this.pushStack([]);for(i=0;i<len;i++){jQuery.find(selector,self[i],ret);} 2326return len>1?jQuery.uniqueSort(ret):ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;} 2327root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);} 2328if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}} 2329return this;}else{elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1;} 2330return this;}}else if(!context||context.jquery){return(context||root).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this[0]=selector;this.length=1;return this;}
vendor: 18,229 bytes, lines 2330-2419
2330else if(isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);} 2331return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets=typeof selectors!=="string"&&jQuery(selectors);if(!rneedsContext.test(selectors)){for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(targets?targets.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break;}}}} 2332return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;} 2333if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);} 2334return indexOf.call(this,elem.jquery?elem[0]:elem);},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){} 2335return cur;} 2336jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return dir(elem,"nextSibling");},prevAll:function(elem){return dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until);},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem);},children:function(elem){return siblings(elem.firstChild);},contents:function(elem){if(nodeName(elem,"iframe")){return elem.contentDocument;} 2337if(nodeName(elem,"template")){elem=elem.content||elem;} 2338return jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;} 2339if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);} 2340if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);} 2341if(rparentsprev.test(name)){matched.reverse();}} 2342return this.pushStack(matched);};});var rnothtmlwhite=(/[^\x20\t\r\n\f]+/g);function createOptions(options){var object={};jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=true;});return object;} 2343jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var 2344firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1])===false&&options.stopOnFalse){firingIndex=list.length;memory=false;}}} 2345if(!options.memory){memory=false;} 2346firing=false;if(locked){if(memory){list=[];}else{list="";}}},self={add:function(){if(list){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory);} 2347(function add(args){jQuery.each(args,function(_,arg){if(isFunction(arg)){if(!options.unique||!self.has(arg)){list.push(arg);}}else if(arg&&arg.length&&toType(arg)!=="string"){add(arg);}});})(arguments);if(memory&&!firing){fire();}} 2348return this;},remove:function(){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(index<=firingIndex){firingIndex--;}}});return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0;},empty:function(){if(list){list=[];} 2349return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];if(!memory&&!firing){list=memory="";} 2350return this;},locked:function(){return!!locked;},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire();}} 2351return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};function Identity(v){return v;} 2352function Thrower(ex){throw ex;} 2353function adoptValue(value,resolve,reject,noValue){var method;try{if(value&&isFunction((method=value.promise))){method.call(value).done(resolve).fail(reject);}else if(value&&isFunction((method=value.then))){method.call(value,resolve,reject);}else{resolve.apply(undefined,[value].slice(noValue));}}catch(value){reject.apply(undefined,[value]);}} 2354jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},"catch":function(fn){return promise.then(null,fn);},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);}else{newDefer[tuple[0]+"With"](this,fn?[returned]:arguments);}});});fns=null;}).promise();},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(depth<maxDepth){return;} 2355returned=handler.apply(that,args);if(returned===deferred.promise()){throw new TypeError("Thenable self-resolution");} 2356then=returned&&(typeof returned==="object"||typeof returned==="function")&&returned.then;if(isFunction(then)){if(special){then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special));}else{maxDepth++;then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith));}}else{if(handler!==Identity){that=undefined;args=[returned];} 2357(special||deferred.resolveWith)(that,args);}},process=special?mightThrow:function(){try{mightThrow();}catch(e){if(jQuery.Deferred.exceptionHook){jQuery.Deferred.exceptionHook(e,process.stackTrace);} 2358if(depth+1>=maxDepth){if(handler!==Thrower){that=undefined;args=[e];} 2359deferred.rejectWith(that,args);}}};if(depth){process();}else{if(jQuery.Deferred.getStackHook){process.stackTrace=jQuery.Deferred.getStackHook();} 2360window.setTimeout(process);}};} 2361return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith));tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity));tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower));}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock);} 2362list.add(tuple[3].fire);deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?undefined:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);} 2363return deferred;},when:function(singleValue){var 2364remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i]=arguments.length>1?slice.call(arguments):value;if(!(--remaining)){master.resolveWith(resolveContexts,resolveValues);}};};if(remaining<=1){adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject,!remaining);if(master.state()==="pending"||isFunction(resolveValues[i]&&resolveValues[i].then)){return master.then();}} 2365while(i--){adoptValue(resolveValues[i],updateFunc(i),master.reject);} 2366return master.promise();}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){if(window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack);}};jQuery.readyException=function(error){window.setTimeout(function(){throw error;});};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){readyList.then(fn).catch(function(error){jQuery.readyException(error);});return this;};jQuery.extend({isReady:false,readyWait:1,ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;} 2367jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;} 2368readyList.resolveWith(document,[jQuery]);}});jQuery.ready.then=readyList.then;function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();} 2369if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);} 2370var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(toType(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!isFunction(value)){raw=true;} 2371if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value);};}} 2372if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));}}} 2373if(chainable){return elems;} 2374if(bulk){return fn.call(elems);} 2375return len?fn(elems[0],key):emptyGet;};var rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(all,letter){return letter.toUpperCase();} 2376function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);} 2377var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!(+owner.nodeType);};function Data(){this.expando=jQuery.expando+Data.uid++;} 2378Data.uid=1;Data.prototype={cache:function(owner){var value=owner[this.expando];if(!value){value={};if(acceptData(owner)){if(owner.nodeType){owner[this.expando]=value;}else{Object.defineProperty(owner,this.expando,{value:value,configurable:true});}}} 2379return value;},set:function(owner,data,value){var prop,cache=this.cache(owner);if(typeof data==="string"){cache[camelCase(data)]=value;}else{for(prop in data){cache[camelCase(prop)]=data[prop];}} 2380return cache;},get:function(owner,key){return key===undefined?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)];},access:function(owner,key,value){if(key===undefined||((key&&typeof key==="string")&&value===undefined)){return this.get(owner,key);} 2381this.set(owner,key,value);return value!==undefined?value:key;},remove:function(owner,key){var i,cache=owner[this.expando];if(cache===undefined){return;} 2382if(key!==undefined){if(Array.isArray(key)){key=key.map(camelCase);}else{key=camelCase(key);key=key in cache?[key]:(key.match(rnothtmlwhite)||[]);} 2383i=key.length;while(i--){delete cache[key[i]];}} 2384if(key===undefined||jQuery.isEmptyObject(cache)){if(owner.nodeType){owner[this.expando]=undefined;}else{delete owner[this.expando];}}},hasData:function(owner){var cache=owner[this.expando];return cache!==undefined&&!jQuery.isEmptyObject(cache);}};var dataPriv=new Data();var dataUser=new Data();var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function getData(data){if(data==="true"){return true;} 2385if(data==="false"){return false;} 2386if(data==="null"){return null;} 2387if(data===+data+""){return+data;} 2388if(rbrace.test(data)){return JSON.parse(data);} 2389return data;} 2390function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=getData(data);}catch(e){} 2391dataUser.set(elem,key,data);}else{data=undefined;}} 2392return data;} 2393jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem);},data:function(elem,name,data){return dataUser.access(elem,name,data);},removeData:function(elem,name){dataUser.remove(elem,name);},_data:function(elem,name,data){return dataPriv.access(elem,name,data);},_removeData:function(elem,name){dataPriv.remove(elem,name);}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem);if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=camelCase(name.slice(5));dataAttr(elem,name,data[name]);}}} 2394dataPriv.set(elem,"hasDataAttrs",true);}} 2395return data;} 2396if(typeof key==="object"){return this.each(function(){dataUser.set(this,key);});} 2397return access(this,function(value){var data;if(elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data;} 2398data=dataAttr(elem,key);if(data!==undefined){return data;} 2399return;} 2400this.each(function(){dataUser.set(this,key,value);});},null,value,arguments.length>1,null,true);},removeData:function(key){return this.each(function(){dataUser.remove(this,key);});}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||Array.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data));}else{queue.push(data);}} 2401return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;} 2402if(fn){if(type==="fx"){queue.unshift("inprogress");} 2403delete hooks.stop;fn.call(elem,next,hooks);} 2404if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key]);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;} 2405if(arguments.length<setter){return jQuery.queue(this[0],type);} 2406return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements]);}};if(typeof type!=="string"){obj=type;type=undefined;} 2407type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}} 2408resolve();return defer.promise(obj);}});var pnum=(/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right","Bottom","Left"];var isHiddenWithinTree=function(elem,el){elem=el||elem;return elem.style.display==="none"||elem.style.display===""&&jQuery.contains(elem.ownerDocument,elem)&&jQuery.css(elem,"display")==="none";};var swap=function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];} 2409ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name];} 2410return ret;};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur();}:function(){return jQuery.css(elem,prop,"");},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=(jQuery.cssNumber[prop]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){initial=initial/2;unit=unit||initialInUnit[3];initialInUnit=+initial||1;while(maxIterations--){jQuery.style(elem,prop,initialInUnit+unit);if((1-scale)*(1-(scale=currentValue()/initial||0.5))<=0){maxIterations=0;} 2411initialInUnit=initialInUnit/scale;} 2412initialInUnit=initialInUnit*2;jQuery.style(elem,prop,initialInUnit+unit);valueParts=valueParts||[];} 2413if(valueParts){initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;tween.end=adjusted;}} 2414return adjusted;} 2415var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(display){return display;} 2416temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block";} 2417defaultDisplayMap[nodeName]=display;return display;} 2418function showHide(elements,show){var display,elem,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue;} 2419display=elem.style.display;
vendor: 5,720 bytes, lines 2419-2453
2419if(show){if(display==="none"){values[index]=dataPriv.get(elem,"display")||null;if(!values[index]){elem.style.display="";}} 2420if(elem.style.display===""&&isHiddenWithinTree(elem)){values[index]=getDefaultDisplay(elem);}}else{if(display!=="none"){values[index]="none";dataPriv.set(elem,"display",display);}}} 2421for(index=0;index<length;index++){if(values[index]!=null){elements[index].style.display=values[index];}} 2422return elements;} 2423jQuery.fn.extend({show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();} 2424return this.each(function(){if(isHiddenWithinTree(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});var rcheckableType=(/^(?:checkbox|radio)$/i);var rtagName=(/<([a-z][^\/\0>\x20\t\r\n\f]+)/i);var rscriptType=(/^$|^module$|\/(?:java|ecma)script/i);var wrapMap={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function getAll(context,tag){var ret;if(typeof context.getElementsByTagName!=="undefined"){ret=context.getElementsByTagName(tag||"*");}else if(typeof context.querySelectorAll!=="undefined"){ret=context.querySelectorAll(tag||"*");}else{ret=[];} 2425if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret);} 2426return ret;} 2427function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"));}} 2428var rhtml=/<|&#?\w+;/;function buildFragment(elems,context,scripts,selection,ignored){var elem,tmp,tag,wrap,contains,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(toType(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem);}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem));}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild;} 2429jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent="";}}} 2430fragment.textContent="";i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem);} 2431continue;} 2432contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(fragment.appendChild(elem),"script");if(contains){setGlobalEval(tmp);} 2433if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}} 2434return fragment;} 2435(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue;})();var documentElement=document.documentElement;var 2436rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;} 2437function returnFalse(){return false;} 2438function safeActiveElement(){try{return document.activeElement;}catch(err){}} 2439function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;} 2440for(type in types){on(elem,type,selector,data,types[type],one);} 2441return elem;} 2442if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}} 2443if(fn===false){fn=returnFalse;}else if(!fn){return elem;} 2444if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);} 2445return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});} 2446jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!elemData){return;} 2447if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;} 2448if(selector){jQuery.find.matchesSelector(documentElement,selector);} 2449if(!handler.guid){handler.guid=jQuery.guid++;} 2450if(!(events=elemData.events)){events=elemData.events={};} 2451if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};} 2452types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;} 2453special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;
vendor: 3,631 bytes, lines 2453-2469
2453if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}} 2454if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}} 2455if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);} 2456jQuery.event.global[type]=true;}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return;} 2457types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);} 2458continue;} 2459special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;} 2460if(special.remove){special.remove.call(elem,handleObj);}}} 2461if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);} 2462delete events[type];}} 2463if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events");}},dispatch:function(nativeEvent){var event=jQuery.event.fix(nativeEvent);var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;for(i=1;i<arguments.length;i++){args[i]=arguments[i];} 2464event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;} 2465handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.rnamespace||event.rnamespace.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}} 2466if(special.postDispatch){special.postDispatch.call(this,event);} 2467return event.result;},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!(event.type==="click"&&event.button>=1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&!(event.type==="click"&&cur.disabled===true)){matchedHandlers=[];matchedSelectors={};for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matchedSelectors[sel]===undefined){matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length;} 2468if(matchedSelectors[sel]){matchedHandlers.push(handleObj);}} 2469if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers});}}
vendor: 3,326 bytes, lines 2469-2480
2469}} 2470cur=this;if(delegateCount<handlers.length){handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)});} 2471return handlerQueue;},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:true,configurable:true,get:isFunction(hook)?function(){if(this.originalEvent){return hook(this.originalEvent);}}:function(){if(this.originalEvent){return this.originalEvent[name];}},set:function(value){Object.defineProperty(this,name,{enumerable:true,configurable:true,writable:true,value:value});}});},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent);},special:{load:{noBubble:true},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus){this.focus();return false;}},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur){this.blur();return false;}},delegateType:"focusout"},click:{trigger:function(){if(this.type==="checkbox"&&this.click&&nodeName(this,"input")){this.click();return false;}},_default:function(event){return nodeName(event.target,"a");}},beforeunload:{postDispatch:function(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result;}}}}};jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle);}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props);} 2472if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse;this.target=(src.target&&src.target.nodeType===3)?src.target.parentNode:src.target;this.currentTarget=src.currentTarget;this.relatedTarget=src.relatedTarget;}else{this.type=src;} 2473if(props){jQuery.extend(this,props);} 2474this.timeStamp=src&&src.timeStamp||Date.now();this[jQuery.expando]=true;};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:false,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e&&!this.isSimulated){e.preventDefault();}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopPropagation();}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopImmediatePropagation();} 2475this.stopPropagation();}};jQuery.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,"char":true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,targetTouches:true,toElement:true,touches:true,which:function(event){var button=event.button;if(event.which==null&&rkeyEvent.test(event.type)){return event.charCode!=null?event.charCode:event.keyCode;} 2476if(!event.which&&button!==undefined&&rmouseEvent.test(event.type)){if(button&1){return 1;} 2477if(button&2){return 3;} 2478if(button&4){return 2;} 2479return 0;} 2480return event.which;}},jQuery.event.addProp);
vendor: 69,938 bytes, lines 2480-2814
2480jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix;} 2481return ret;}};});jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn);},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1);},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this;} 2482if(typeof types==="object"){for(type in types){this.off(type,selector,types[type]);} 2483return this;} 2484if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;} 2485if(fn===false){fn=returnFalse;} 2486return this.each(function(){jQuery.event.remove(this,types,fn,selector);});}});var 2487rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function manipulationTarget(elem,content){if(nodeName(elem,"table")&&nodeName(content.nodeType!==11?content:content.firstChild,"tr")){return jQuery(elem).children("tbody")[0]||elem;} 2488return elem;} 2489function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;} 2490function restoreScript(elem){if((elem.type||"").slice(0,5)==="true/"){elem.type=elem.type.slice(5);}else{elem.removeAttribute("type");} 2491return elem;} 2492function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(dest.nodeType!==1){return;} 2493if(dataPriv.hasData(src)){pdataOld=dataPriv.access(src);pdataCur=dataPriv.set(dest,pdataOld);events=pdataOld.events;if(events){delete pdataCur.handle;pdataCur.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i]);}}}} 2494if(dataUser.hasData(src)){udataOld=dataUser.access(src);udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur);}} 2495function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked;}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue;}} 2496function domManip(collection,args,callback,ignored){args=concat.apply([],args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],valueIsFunction=isFunction(value);if(valueIsFunction||(l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(valueIsFunction){args[0]=value.call(this,index,self.html());} 2497domManip(self,args,callback,ignored);});} 2498if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;} 2499if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"));}} 2500callback.call(collection[i],node,i);} 2501if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src&&(node.type||"").toLowerCase()!=="module"){if(jQuery._evalUrl){jQuery._evalUrl(node.src);}}else{DOMEval(node.textContent.replace(rcleanScript,""),doc,node);}}}}}} 2502return collection;} 2503function remove(elem,selector,keepData){var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;for(;(node=nodes[i])!=null;i++){if(!keepData&&node.nodeType===1){jQuery.cleanData(getAll(node));} 2504if(node.parentNode){if(keepData&&jQuery.contains(node.ownerDocument,node)){setGlobalEval(getAll(node,"script"));} 2505node.parentNode.removeChild(node);}} 2506return elem;} 2507jQuery.extend({htmlPrefilter:function(html){return html.replace(rxhtmlTag,"<$1></$2>");},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=jQuery.contains(elem.ownerDocument,elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i]);}} 2508if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i]);}}else{cloneCopyEvent(elem,clone);}} 2509destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));} 2510return clone;},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}} 2511elem[dataPriv.expando]=undefined;} 2512if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({detach:function(selector){return remove(this,selector,true);},remove:function(selector){return remove(this,selector);},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value;}});},null,value,arguments.length);},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent="";}} 2513return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML;} 2514if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value;}} 2515elem=0;}catch(e){}} 2516if(elem){this.empty().append(value);}},null,value,arguments.length);},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;if(jQuery.inArray(this,ignored)<0){jQuery.cleanData(getAll(this));if(parent){parent.replaceChild(elem,this);}}},ignored);}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);push.apply(ret,elems.get());} 2517return this.pushStack(ret);};});var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window;} 2518return view.getComputedStyle(elem);};var rboxStyle=new RegExp(cssExpand.join("|"),"i");(function(){function computeStyleTests(){if(!div){return;} 2519container.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0";div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%";documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=roundPixelMeasures(divStyle.marginLeft)===12;div.style.right="60%";pixelBoxStylesVal=roundPixelMeasures(divStyle.right)===36;boxSizingReliableVal=roundPixelMeasures(divStyle.width)===36;div.style.position="absolute";scrollboxSizeVal=div.offsetWidth===36||"absolute";documentElement.removeChild(container);div=null;} 2520function roundPixelMeasures(measure){return Math.round(parseFloat(measure));} 2521var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return;} 2522div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";jQuery.extend(support,{boxSizingReliable:function(){computeStyleTests();return boxSizingReliableVal;},pixelBoxStyles:function(){computeStyleTests();return pixelBoxStylesVal;},pixelPosition:function(){computeStyleTests();return pixelPositionVal;},reliableMarginLeft:function(){computeStyleTests();return reliableMarginLeftVal;},scrollboxSize:function(){computeStyleTests();return scrollboxSizeVal;}});})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name);} 2523if(!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}} 2524return ret!==undefined?ret+"":ret;} 2525function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return;} 2526return(this.get=hookFn).apply(this,arguments);}};} 2527var 2528rdisplayswap=/^(none|table(?!-c[ea]).+)/,rcustomProp=/^--/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style;function vendorPropName(name){if(name in emptyStyle){return name;} 2529var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}} 2530function finalPropName(name){var ret=jQuery.cssProps[name];if(!ret){ret=jQuery.cssProps[name]=vendorPropName(name)||name;} 2531return ret;} 2532function setPositiveNumber(elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value;} 2533function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i=dimension==="width"?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content")){return 0;} 2534for(;i<4;i+=2){if(box==="margin"){delta+=jQuery.css(elem,box+cssExpand[i],true,styles);} 2535if(!isBorderBox){delta+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(box!=="padding"){delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}else{extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{if(box==="content"){delta-=jQuery.css(elem,"padding"+cssExpand[i],true,styles);} 2536if(box!=="margin"){delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}} 2537if(!isBorderBox&&computedVal>=0){delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]- 2538computedVal- 2539delta- 2540extra- 25410.5));} 2542return delta;} 2543function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),val=curCSS(elem,dimension,styles),isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box",valueIsBorderBox=isBorderBox;if(rnumnonpx.test(val)){if(!extra){return val;} 2544val="auto";} 2545valueIsBorderBox=valueIsBorderBox&&(support.boxSizingReliable()||val===elem.style[dimension]);if(val==="auto"||!parseFloat(val)&&jQuery.css(elem,"display",false,styles)==="inline"){val=elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)];valueIsBorderBox=true;} 2546val=parseFloat(val)||0;return(val+ 2547boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val))+"px";} 2548jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"animationIterationCount":true,"columnCount":true,"fillOpacity":true,"flexGrow":true,"flexShrink":true,"fontWeight":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;} 2549var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){name=finalPropName(origName);} 2550hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){value=adjustCSS(elem,name,ret);type="number";} 2551if(value==null||value!==value){return;} 2552if(type==="number"){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px");} 2553if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";} 2554if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){if(isCustomProp){style.setProperty(name,value);}else{style[name]=value;}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;} 2555return style[name];}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){name=finalPropName(origName);} 2556hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra);} 2557if(val===undefined){val=curCSS(elem,name,styles);} 2558if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];} 2559if(extra===""||extra){num=parseFloat(val);return extra===true||isFinite(num)?num||0:val;} 2560return val;}});jQuery.each(["height","width"],function(i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&(!elem.getClientRects().length||!elem.getBoundingClientRect().width)?swap(elem,cssShow,function(){return getWidthOrHeight(elem,dimension,extra);}):getWidthOrHeight(elem,dimension,extra);}},set:function(elem,value,extra){var matches,styles=getStyles(elem),isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box",subtract=extra&&boxModelAdjustment(elem,dimension,extra,isBorderBox,styles);if(isBorderBox&&support.scrollboxSize()===styles.position){subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]- 2561parseFloat(styles[dimension])- 2562boxModelAdjustment(elem,dimension,"border",false,styles)- 25630.5);} 2564if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[dimension]=value;value=jQuery.css(elem,dimension);} 2565return setPositiveNumber(elem,value,subtract);}};});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left- 2566swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left;}))+"px";}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];} 2567return expanded;}};if(prefix!=="margin"){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles);} 2568return map;} 2569return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name);},name,value,arguments.length>1);}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);} 2570jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;} 2571this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);} 2572if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);} 2573return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop];} 2574result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.nodeType===1&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var 2575fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(document.hidden===false&&window.requestAnimationFrame){window.requestAnimationFrame(schedule);}else{window.setTimeout(schedule,jQuery.fx.interval);} 2576jQuery.fx.tick();}} 2577function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=Date.now());} 2578function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;} 2579if(includeWidth){attrs.opacity=attrs.width=type;} 2580return attrs;} 2581function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween;}}} 2582function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire();}};} 2583hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire();}});});} 2584for(prop in props){value=props[prop];if(rfxtypes.test(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true;}else{continue;}} 2585orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop);}} 2586propTween=!jQuery.isEmptyObject(props);if(!propTween&&jQuery.isEmptyObject(orig)){return;} 2587if(isBox&&elem.nodeType===1){opts.overflow=[style.overflow,style.overflowX,style.overflowY];restoreDisplay=dataShow&&dataShow.display;if(restoreDisplay==null){restoreDisplay=dataPriv.get(elem,"display");} 2588display=jQuery.css(elem,"display");if(display==="none"){if(restoreDisplay){display=restoreDisplay;}else{showHide([elem],true);restoreDisplay=elem.style.display||restoreDisplay;display=jQuery.css(elem,"display");showHide([elem]);}} 2589if(display==="inline"||display==="inline-block"&&restoreDisplay!=null){if(jQuery.css(elem,"float")==="none"){if(!propTween){anim.done(function(){style.display=restoreDisplay;});if(restoreDisplay==null){display=style.display;restoreDisplay=display==="none"?"":display;}} 2590style.display="inline-block";}}} 2591if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2];});} 2592propTween=false;for(prop in orig){if(!propTween){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden;}}else{dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay});} 2593if(toggle){dataShow.hidden=!hidden;} 2594if(hidden){showHide([elem],true);} 2595anim.done(function(){if(!hidden){showHide([elem]);} 2596dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop]);}});} 2597propTween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=propTween.start;if(hidden){propTween.end=propTween.start;propTween.start=0;}}}} 2598function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=camelCase(index);easing=specialEasing[name];value=props[index];if(Array.isArray(value)){easing=value[1];value=props[index]=value[0];} 2599if(index!==name){props[name]=value;delete props[index];} 2600hooks=jQuery.cssHooks[name];if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing;}}}else{specialEasing[name]=easing;}}} 2601function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem;}),tick=function(){if(stopped){return false;} 2602var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent);} 2603deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining;} 2604if(!length){deferred.notifyWith(elem,[animation,1,0]);} 2605deferred.resolveWith(elem,[animation]);return false;},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween;},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this;} 2606stopped=true;for(;index<length;index++){animation.tweens[index].run(1);} 2607if(gotoEnd){deferred.notifyWith(elem,[animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd]);}else{deferred.rejectWith(elem,[animation,gotoEnd]);} 2608return this;}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=Animation.prefilters[index].call(animation,elem,props,animation.opts);if(result){if(isFunction(result.stop)){jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result);} 2609return result;}} 2610jQuery.map(props,createTween,animation);if(isFunction(animation.opts.start)){animation.opts.start.call(elem,animation);} 2611animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation;} 2612jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);adjustCSS(tween.elem,prop,rcssNum.exec(value),tween);return tween;}]},tweener:function(props,callback){if(isFunction(props)){callback=props;props=["*"];}else{props=props.match(rnothtmlwhite);} 2613var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];Animation.tweeners[prop]=Animation.tweeners[prop]||[];Animation.tweeners[prop].unshift(callback);}},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){if(prepend){Animation.prefilters.unshift(callback);}else{Animation.prefilters.push(callback);}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};if(jQuery.fx.off){opt.duration=0;}else{if(typeof opt.duration!=="number"){if(opt.duration in jQuery.fx.speeds){opt.duration=jQuery.fx.speeds[opt.duration];}else{opt.duration=jQuery.fx.speeds._default;}}} 2614if(opt.queue==null||opt.queue===true){opt.queue="fx";} 2615opt.old=opt.complete;opt.complete=function(){if(isFunction(opt.old)){opt.old.call(this);} 2616if(opt.queue){jQuery.dequeue(this,opt.queue);}};return opt;};jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback);},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||dataPriv.get(this,"finish")){anim.stop(true);}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation);},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd);};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined;} 2617if(clearQueue&&type!==false){this.queue(type||"fx",[]);} 2618return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index]);}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index]);}}} 2619for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1);}} 2620if(dequeue||!gotoEnd){jQuery.dequeue(this,type);}});},finish:function(type){if(type!==false){type=type||"fx";} 2621return this.each(function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true);} 2622for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1);}} 2623for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this);}} 2624delete data.finish;});}});jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback);};});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback);};});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=Date.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1);}} 2625if(!timers.length){jQuery.fx.stop();} 2626fxNow=undefined;};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);jQuery.fx.start();};jQuery.fx.interval=13;jQuery.fx.start=function(){if(inProgress){return;} 2627inProgress=true;schedule();};jQuery.fx.stop=function(){inProgress=null;};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout);};});};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t";})();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;} 2628if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);} 2629if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);} 2630if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;} 2631if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;} 2632elem.setAttribute(name,value+"");return value;} 2633if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;} 2634ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;} 2635return value;}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){elem.removeAttribute(name);}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);} 2636return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();if(!isXML){handle=attrHandle[lowercaseName];attrHandle[lowercaseName]=ret;ret=getter(elem,name,isXML)!=null?lowercaseName:null;attrHandle[lowercaseName]=handle;} 2637return ret;};});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name];});}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;} 2638if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];} 2639if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;} 2640return(elem[name]=value);} 2641if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;} 2642return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){return parseInt(tabindex,10);} 2643if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href){return 0;} 2644return-1;}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex;} 2645return null;},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}};} 2646jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(" ");} 2647function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";} 2648function classesToArray(value){if(Array.isArray(value)){return value;} 2649if(typeof value==="string"){return value.match(rnothtmlwhite)||[];} 2650return[];} 2651jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});} 2652classes=classesToArray(value);if(classes.length){while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" ";}} 2653finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}} 2654return this;},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});} 2655if(!arguments.length){return this.attr("class","");} 2656classes=classesToArray(value);if(classes.length){while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>-1){cur=cur.replace(" "+clazz+" "," ");}} 2657finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}} 2658return this;},toggleClass:function(value,stateVal){var type=typeof value,isValidValue=type==="string"||Array.isArray(value);if(typeof stateVal==="boolean"&&isValidValue){return stateVal?this.addClass(value):this.removeClass(value);} 2659if(isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});} 2660return this.each(function(){var className,i,self,classNames;if(isValidValue){i=0;self=jQuery(this);classNames=classesToArray(value);while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className);} 2661if(this.setAttribute){this.setAttribute("class",className||value===false?"":dataPriv.get(this,"__className__")||"");}}});},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1){return true;}} 2662return false;}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;} 2663ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"");} 2664return ret==null?"":ret;} 2665return;} 2666valueIsFunction=isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;} 2667if(valueIsFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;} 2668if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(Array.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});} 2669hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:stripAndCollapse(jQuery.text(elem));}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one",values=one?null:[],max=one?index+1:options.length;if(index<0){i=max;}else{i=one?index:0;} 2670for(;i<max;i++){option=options[i];if((option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;} 2671values.push(value);}} 2672return values;},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1){optionSet=true;}} 2673if(!optionSet){elem.selectedIndex=-1;} 2674return values;}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1);}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation();};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=lastElement=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;} 2675if(rfocusMorph.test(type+jQuery.event.triggered)){return;} 2676if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();} 2677ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;} 2678data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;} 2679if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;} 2680for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;} 2681if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}} 2682i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){lastElement=cur;event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data);} 2683handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}} 2684event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&isFunction(elem[type])&&!isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;} 2685jQuery.event.triggered=type;if(event.isPropagationStopped()){lastElement.addEventListener(type,stopPropagationCallback);} 2686elem[type]();if(event.isPropagationStopped()){lastElement.removeEventListener(type,stopPropagationCallback);} 2687jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}} 2688return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});jQuery.event.trigger(e,null,elem);}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});if(!support.focusin){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event));};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true);} 2689dataPriv.access(doc,fix,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix);}else{dataPriv.access(doc,fix,attaches);}}};});} 2690var location=window.location;var nonce=Date.now();var rquery=(/\?/);jQuery.parseXML=function(data){var xml;if(!data||typeof data!=="string"){return null;} 2691try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){xml=undefined;} 2692if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);} 2693return xml;};var 2694rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add);}});}else if(!traditional&&toType(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}} 2695jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+ 2696encodeURIComponent(value==null?"":value);};if(Array.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}} 2697return s.join("&");};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type));}).map(function(i,elem){var val=jQuery(this).val();if(val==null){return null;} 2698if(Array.isArray(val)){return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};});} 2699return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});var 2700r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";} 2701var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};} 2702function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;} 2703return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");} 2704function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}} 2705if(deep){jQuery.extend(true,target,deep);} 2706return target;} 2707function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}} 2708if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} 2709if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;} 2710if(!firstDataType){firstDataType=type;}} 2711finalDataType=finalDataType||firstDataType;} 2712if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);} 2713return responses[finalDataType];}} 2714function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}} 2715current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;} 2716if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);} 2717prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);} 2718break;}}}} 2719if(conv!==true){if(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}} 2720return{state:"success",data:response};} 2721jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;} 2722options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}} 2723match=responseHeaders[key.toLowerCase()];} 2724return match==null?null:match;},getAllResponseHeaders:function(){return completed?responseHeadersString:null;},setRequestHeader:function(name,value){if(completed==null){name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name;requestHeaders[name]=value;} 2725return this;},overrideMimeType:function(type){if(completed==null){s.mimeType=type;} 2726return this;},statusCode:function(map){var code;if(map){if(completed){jqXHR.always(map[jqXHR.status]);}else{for(code in map){statusCode[code]=[statusCode[code],map[code]];}}} 2727return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);} 2728done(0,finalText);return this;}};deferred.promise(jqXHR);s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host;}catch(e){s.crossDomain=true;}} 2729if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);} 2730inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(completed){return jqXHR;} 2731fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");} 2732s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url.replace(rhash,"");if(!s.hasContent){uncached=s.url.slice(cacheURL.length);if(s.data&&(s.processData||typeof s.data==="string")){cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data;} 2733if(s.cache===false){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(cacheURL)?"&":"?")+"_="+(nonce++)+uncached;} 2734s.url=cacheURL+uncached;}else if(s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){s.data=s.data.replace(r20,"+");} 2735if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);} 2736if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}} 2737if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);} 2738jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+ 2739(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);} 2740if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||completed)){return jqXHR.abort();} 2741strAbort="abort";completeDeferred.add(s.complete);jqXHR.done(s.success);jqXHR.fail(s.error);transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);} 2742if(completed){return jqXHR;} 2743if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);} 2744try{completed=false;transport.send(requestHeaders,done);}catch(e){if(completed){throw e;} 2745done(-1,e);}} 2746function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return;} 2747completed=true;if(timeoutTimer){window.clearTimeout(timeoutTimer);} 2748transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);} 2749response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;} 2750modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}} 2751if(status===204||s.type==="HEAD"){statusText="nocontent";}else if(status===304){statusText="notmodified";}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error;}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0;}}} 2752jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);} 2753jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);} 2754completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}} 2755return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(isFunction(data)){type=type||callback;callback=data;data=undefined;} 2756return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url));};});jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:true,async:false,global:false,"throws":true});};jQuery.fn.extend({wrapAll:function(html){var wrap;if(this[0]){if(isFunction(html)){html=html.call(this[0]);} 2757wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);} 2758wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;} 2759return elem;}).append(this);} 2760return this;},wrapInner:function(html){if(isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});} 2761return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html);});},unwrap:function(selector){this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes);});return this;}});jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem);};jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length);};jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest();}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials"in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i];}} 2762if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);} 2763if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";} 2764for(i in headers){xhr.setRequestHeader(i,headers[i]);} 2765callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort();}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error");}else{complete(xhr.status,xhr.statusText);}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders());}}};};xhr.onload=callback();errorCallback=xhr.onerror=xhr.ontimeout=callback("error");if(xhr.onabort!==undefined){xhr.onabort=errorCallback;}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback();}});}};} 2766callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null);}catch(e){if(callback){throw e;}}},abort:function(){if(callback){callback();}}};}});jQuery.ajaxPrefilter(function(s){if(s.crossDomain){s.contents.script=false;}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;} 2767if(s.crossDomain){s.type="GET";}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery("<script>").prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type);}});document.head.appendChild(script[0]);},abort:function(){if(callback){callback();}}};}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(nonce++));this[callback]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName);}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;} 2768s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called");} 2769return responseContainer[0];};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments;};jqXHR.always(function(){if(overwritten===undefined){jQuery(window).removeProp(callbackName);}else{window[callbackName]=overwritten;} 2770if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName);} 2771if(responseContainer&&isFunction(overwritten)){overwritten(responseContainer[0]);} 2772responseContainer=overwritten=undefined;});return"script";}});support.createHTMLDocument=(function(){var body=document.implementation.createHTMLDocument("").body;body.innerHTML="<form></form><form></form>";return body.childNodes.length===2;})();jQuery.parseHTML=function(data,context,keepScripts){if(typeof data!=="string"){return[];} 2773if(typeof context==="boolean"){keepScripts=context;context=false;} 2774var base,parsed,scripts;if(!context){if(support.createHTMLDocument){context=document.implementation.createHTMLDocument("");base=context.createElement("base");base.href=document.location.href;context.head.appendChild(base);}else{context=document;}} 2775parsed=rsingleTag.exec(data);scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];} 2776parsed=buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove();} 2777return jQuery.merge([],parsed.childNodes);};jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");if(off>-1){selector=stripAndCollapse(url.slice(off));url=url.slice(0,off);} 2778if(isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";} 2779if(self.length>0){jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText);}).always(callback&&function(jqXHR,status){self.each(function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR]);});});} 2780return this;};jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn);};});jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative";} 2781curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;} 2782if(isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset));} 2783if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;} 2784if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;} 2785if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i);});} 2786var rect,win,elem=this[0];if(!elem){return;} 2787if(!elem.getClientRects().length){return{top:0,left:0};} 2788rect=elem.getBoundingClientRect();win=elem.ownerDocument.defaultView;return{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset};},position:function(){if(!this[0]){return;} 2789var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect();}else{offset=this.offset();doc=elem.ownerDocument;offsetParent=elem.offsetParent||doc.documentElement;while(offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.parentNode;} 2790if(offsetParent&&offsetParent!==elem&&offsetParent.nodeType===1){parentOffset=jQuery(offsetParent).offset();parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",true);}} 2791return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent;} 2792return offsetParent||documentElement;});}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win;if(isWindow(elem)){win=elem;}else if(elem.nodeType===9){win=elem.defaultView;} 2793if(val===undefined){return win?win[prop]:elem[method];} 2794if(win){win.scrollTo(!top?val:win.pageXOffset,top?val:win.pageYOffset);}else{elem[method]=val;}},method,val,arguments.length);};});jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed;}});});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;if(isWindow(elem)){return funcName.indexOf("outer")===0?elem["inner"+name]:elem.document.documentElement["client"+name];} 2795if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name]);} 2796return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra);},type,chainable?margin:undefined,chainable);};});});jQuery.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn);}});jQuery.proxy=function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp;} 2797if(!isFunction(fn)){return undefined;} 2798args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy;};jQuery.holdReady=function(hold){if(hold){jQuery.readyWait++;}else{jQuery.ready(true);}};jQuery.isArray=Array.isArray;jQuery.parseJSON=JSON.parse;jQuery.nodeName=nodeName;jQuery.isFunction=isFunction;jQuery.isWindow=isWindow;jQuery.camelCase=camelCase;jQuery.type=toType;jQuery.now=Date.now;jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return(type==="number"||type==="string")&&!isNaN(obj-parseFloat(obj));};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery;});} 2799var 2800_jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$;} 2801if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;} 2802return jQuery;};if(!noGlobal){window.jQuery=window.$=jQuery;} 2803return jQuery;});; 2804 2805/* /web/static/lib/jquery.ui/jquery-ui.js */ 2806(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}}(function($){$.ui=$.ui||{};var version=$.ui.version="1.12.1";var widgetUuid=0;var widgetSlice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove");}}catch(e){}} 2807orig(elems);};})($.cleanData);$.widget=function(name,base,prototype){var existingConstructor,constructor,basePrototype;var proxiedPrototype={};var namespace=name.split(".")[0];name=name.split(".")[1];var fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;} 2808if($.isArray(prototype)){prototype=$.extend.apply(null,[{}].concat(prototype));} 2809$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);} 2810if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(!$.isFunction(value)){proxiedPrototype[prop]=value;return;} 2811proxiedPrototype[prop]=(function(){function _super(){return base.prototype[prop].apply(this,arguments);} 2812function _superApply(args){return base.prototype[prop].apply(this,args);} 2813return function(){var __super=this._super;var __superApply=this._superApply;var returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);} 2814$.widget.bridge(name,constructor);return constructor;};$.widget.extend=function(target){var input=widgetSlice.call(arguments,1
vendor: 7,223 bytes, lines 2814-2840
2814);var inputIndex=0;var inputLength=input.length;var key;var value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}} 2815return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string";var args=widgetSlice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined;}else{this.each(function(){var methodValue;var instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return false;} 2816if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");} 2817if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");} 2818methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));} 2819this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{$.data(this,fullName,new object(options,this));}});} 2820return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widgetUuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=$();this.hoverable=$();this.focusable=$();this.classesElementLookup={};if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);} 2821this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled);} 2822this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:function(){return{};},_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){var that=this;this._destroy();$.each(this.classesElementLookup,function(key,value){that._removeClass(value,key);});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace);},_destroy:$.noop,widget:function(){return this.element;},option:function(key,value){var options=key;var parts;var curOption;var i;if(arguments.length===0){return $.widget.extend({},this.options);} 2823if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]];} 2824key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];} 2825curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];} 2826options[key]=value;}} 2827this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);} 2828return this;},_setOption:function(key,value){if(key==="classes"){this._setOptionClasses(value);} 2829this.options[key]=value;if(key==="disabled"){this._setOptionDisabled(value);} 2830return this;},_setOptionClasses:function(value){var classKey,elements,currentElements;for(classKey in value){currentElements=this.classesElementLookup[classKey];if(value[classKey]===this.options.classes[classKey]||!currentElements||!currentElements.length){continue;} 2831elements=$(currentElements.get());this._removeClass(currentElements,classKey);elements.addClass(this._classes({element:elements,keys:classKey,classes:value,add:true}));}},_setOptionDisabled:function(value){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!value);if(value){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus");}},enable:function(){return this._setOptions({disabled:false});},disable:function(){return this._setOptions({disabled:true});},_classes:function(options){var full=[];var that=this;options=$.extend({element:this.element,classes:this.options.classes||{}},options);function processClassString(classes,checkOption){var current,i;for(i=0;i<classes.length;i++){current=that.classesElementLookup[classes[i]]||$();if(options.add){current=$($.unique(current.get().concat(options.element.get())));}else{current=$(current.not(options.element).get());} 2832that.classesElementLookup[classes[i]]=current;full.push(classes[i]);if(checkOption&&options.classes[classes[i]]){full.push(options.classes[classes[i]]);}}} 2833this._on(options.element,{"remove":"_untrackClassesElement"});if(options.keys){processClassString(options.keys.match(/\S+/g)||[],true);} 2834if(options.extra){processClassString(options.extra.match(/\S+/g)||[]);} 2835return full.join(" ");},_untrackClassesElement:function(event){var that=this;$.each(that.classesElementLookup,function(key,value){if($.inArray(event.target,value)!==-1){that.classesElementLookup[key]=$(value.not(event.target).get());}});},_removeClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,false);},_addClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,true);},_toggleClass:function(element,keys,extra,add){add=(typeof add==="boolean")?add:extra;var shift=(typeof element==="string"||element===null),options={extra:shift?keys:extra,keys:shift?element:keys,element:shift?this.element:element,add:add};options.element.toggleClass(this._classes(options),add);return this;},_on:function(suppressDisabledCheck,element,handlers){var delegateElement;var instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false;} 2836if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);} 2837$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;} 2838return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);} 2839if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;} 2840var match=event.match(/^([\w:-]*)\s*(.*)$/);var eventName=match[1]+instance.eventNamespace;var selector=match[2];
vendor: 9,143 bytes, lines 2840-2870
2840if(selector){delegateElement.on(eventName,selector,handlerProxy);}else{element.on(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+ 2841this.eventNamespace;element.off(eventName).off(eventName);this.bindings=$(this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());this.hoverable=$(this.hoverable.not(element).get());},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);} 2842var instance=this;return setTimeout(handlerProxy,delay||0);},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){this._addClass($(event.currentTarget),null,"ui-state-hover");},mouseleave:function(event){this._removeClass($(event.currentTarget),null,"ui-state-hover");}});},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){this._addClass($(event.currentTarget),null,"ui-state-focus");},focusout:function(event){this._removeClass($(event.currentTarget),null,"ui-state-focus");}});},_trigger:function(type,event,data){var prop,orig;var callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop];}}} 2843this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};} 2844var hasOptions;var effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};} 2845hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);} 2846if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options);}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback);}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0]);} 2847next();});}};});var widget=$.widget;(function(){var cachedScrollbarWidth,max=Math.max,abs=Math.abs,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)];} 2848function parseCss(element,property){return parseInt($.css(element,property),10)||0;} 2849function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}};} 2850if($.isWindow(raw)){return{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}};} 2851if(raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}};} 2852return{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};} 2853$.position={scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth;} 2854var w1,w2,div=$("<div "+"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>"+"<div style='height:100px;width:auto;'></div></div>"),innerDiv=div.children()[0];$("body").append(div);w1=innerDiv.offsetWidth;div.css("overflow","scroll");w2=innerDiv.offsetWidth;if(w1===w2){w2=div[0].clientWidth;} 2855div.remove();return(cachedScrollbarWidth=w1-w2);},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX=overflowX==="scroll"||(overflowX==="auto"&&within.width<within.element[0].scrollWidth),hasOverflowY=overflowY==="scroll"||(overflowY==="auto"&&within.height<within.element[0].scrollHeight);return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0};},getWithinInfo:function(element){var withinElement=$(element||window),isWindow=$.isWindow(withinElement[0]),isDocument=!!withinElement[0]&&withinElement[0].nodeType===9,hasOffset=!isWindow&&!isDocument;return{element:withinElement,isWindow:isWindow,isDocument:isDocument,offset:hasOffset?$(element).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:withinElement.outerWidth(),height:withinElement.outerHeight()};}};$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments);} 2856options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};dimensions=getDimensions(target);if(target[0].preventDefault){options.at="left top";} 2857targetWidth=dimensions.width;targetHeight=dimensions.height;targetOffset=dimensions.offset;basePosition=$.extend({},targetOffset);$.each(["my","at"],function(){var pos=(options[this]||"").split(" "),horizontalOffset,verticalOffset;if(pos.length===1){pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"];} 2858pos[0]=rhorizontal.test(pos[0])?pos[0]:"center";pos[1]=rvertical.test(pos[1])?pos[1]:"center";horizontalOffset=roffset.exec(pos[0]);verticalOffset=roffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0];options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]];});if(collision.length===1){collision[1]=collision[0];} 2859if(options.at[0]==="right"){basePosition.left+=targetWidth;}else if(options.at[0]==="center"){basePosition.left+=targetWidth/2;} 2860if(options.at[1]==="bottom"){basePosition.top+=targetHeight;}else if(options.at[1]==="center"){basePosition.top+=targetHeight/2;} 2861atOffset=getOffsets(offsets.at,targetWidth,targetHeight);basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+ 2862scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+ 2863scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());if(options.my[0]==="right"){position.left-=elemWidth;}else if(options.my[0]==="center"){position.left-=elemWidth/2;} 2864if(options.my[1]==="bottom"){position.top-=elemHeight;}else if(options.my[1]==="center"){position.top-=elemHeight/2;} 2865position.left+=myOffset[0];position.top+=myOffset[1];collisionPosition={marginLeft:marginLeft,marginTop:marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem});}});if(options.using){using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};if(targetWidth<elemWidth&&abs(left+right)<targetWidth){feedback.horizontal="center";} 2866if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle";} 2867if(max(abs(left),abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal";}else{feedback.important="vertical";} 2868options.using.call(this,props,feedback);};} 2869elem.offset($.extend(position,{using:using}));});};$.ui.position={fit:{left:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset,newOverRight;if(data.collisionWidth>outerWidth){if(overLeft>0&&overRight<=0){newOverRight=position.left+overLeft+data.collisionWidth-outerWidth- 2870withinOffset;position.left+=overLeft-newOverRight;}else if(overRight>
vendor: 16,589 bytes, lines 2870-2922
28700&&overLeft<=0){position.left=withinOffset;}else{if(overLeft>overRight){position.left=withinOffset+outerWidth-data.collisionWidth;}else{position.left=withinOffset;}}}else if(overLeft>0){position.left+=overLeft;}else if(overRight>0){position.left-=overRight;}else{position.left=max(position.left-collisionPosLeft,position.left);}},top:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset,newOverBottom;if(data.collisionHeight>outerHeight){if(overTop>0&&overBottom<=0){newOverBottom=position.top+overTop+data.collisionHeight-outerHeight- 2871withinOffset;position.top+=overTop-newOverBottom;}else if(overBottom>0&&overTop<=0){position.top=withinOffset;}else{if(overTop>overBottom){position.top=withinOffset+outerHeight-data.collisionHeight;}else{position.top=withinOffset;}}}else if(overTop>0){position.top+=overTop;}else if(overBottom>0){position.top-=overBottom;}else{position.top=max(position.top-collisionPosTop,position.top);}}},flip:{left:function(position,data){var within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:data.at[0]==="right"?-data.targetWidth:0,offset=-2*data.offset[0],newOverRight,newOverLeft;if(overLeft<0){newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth- 2872outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset;}}else if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+ 2873atOffset+offset-offsetLeft;if(newOverLeft>0||abs(newOverLeft)<overRight){position.left+=myOffset+atOffset+offset;}}},top:function(position,data){var within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top=data.my[1]==="top",myOffset=top?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:data.at[1]==="bottom"?-data.targetHeight:0,offset=-2*data.offset[1],newOverTop,newOverBottom;if(overTop<0){newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight- 2874outerHeight-withinOffset;if(newOverBottom<0||newOverBottom<abs(overTop)){position.top+=myOffset+atOffset+offset;}}else if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+ 2875offset-offsetTop;if(newOverTop>0||abs(newOverTop)<overBottom){position.top+=myOffset+atOffset+offset;}}}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments);$.ui.position.fit.left.apply(this,arguments);},top:function(){$.ui.position.flip.top.apply(this,arguments);$.ui.position.fit.top.apply(this,arguments);}}};})();var position=$.ui.position;var data=$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);}});var disableSelection=$.fn.extend({disableSelection:(function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault();});};})(),enableSelection:function(){return this.off(".ui-disableSelection");}});$.ui.focusable=function(element,hasTabindex){var map,mapName,img,focusableIfVisible,fieldset,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;} 2876img=$("img[usemap='#"+mapName+"']");return img.length>0&&img.is(":visible");} 2877if(/^(input|select|textarea|button|object)$/.test(nodeName)){focusableIfVisible=!element.disabled;if(focusableIfVisible){fieldset=$(element).closest("fieldset")[0];if(fieldset){focusableIfVisible=!fieldset.disabled;}}}else if("a"===nodeName){focusableIfVisible=element.href||hasTabindex;}else{focusableIfVisible=hasTabindex;} 2878return focusableIfVisible&&$(element).is(":visible")&&visible($(element));};function visible(element){var visibility=element.css("visibility");while(visibility==="inherit"){element=element.parent();visibility=element.css("visibility");} 2879return visibility!=="hidden";} 2880$.extend($.expr[":"],{focusable:function(element){return $.ui.focusable(element,$.attr(element,"tabindex")!=null);}});var focusable=$.ui.focusable;var keycode=$.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};var scrollParent=$.fn.scrollParent=function(includeHidden){var position=this.css("position"),excludeStaticParent=position==="absolute",overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){return false;} 2881return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+ 2882parent.css("overflow-x"));}).eq(0);return position==="fixed"||!scrollParent.length?$(this[0].ownerDocument||document):scrollParent;};var uniqueId=$.fn.extend({uniqueId:(function(){var uuid=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});};})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){$(this).removeAttr("id");}});}});var ie=$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var mouseHandled=false;$(document).on("mouseup",function(){mouseHandled=false;});var widgetsMouse=$.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.on("mousedown."+this.widgetName,function(event){return that._mouseDown(event);}).on("click."+this.widgetName,function(event){if(true===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);}},_mouseDown:function(event){if(mouseHandled){return;} 2883this._mouseMoved=false;(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var that=this,btnIsLeft=(event.which===1),elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;} 2884this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=true;},this.options.delay);} 2885if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}} 2886if(true===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent");} 2887this._mouseMoveDelegate=function(event){return that._mouseMove(event);};this._mouseUpDelegate=function(event){return that._mouseUp(event);};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true;},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event);}else if(!event.which){if(event.originalEvent.altKey||event.originalEvent.ctrlKey||event.originalEvent.metaKey||event.originalEvent.shiftKey){this.ignoreMissingWhich=true;}else if(!this.ignoreMissingWhich){return this._mouseUp(event);}}} 2888if(event.which||event.button){this._mouseMoved=true;} 2889if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();} 2890if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));} 2891return!this._mouseStarted;},_mouseUp:function(event){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",true);} 2892this._mouseStop(event);} 2893if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer;} 2894this.ignoreMissingWhich=false;mouseHandled=false;event.preventDefault();},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});var plugin=$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return;} 2895if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){return;} 2896for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}};var safeActiveElement=$.ui.safeActiveElement=function(document){var activeElement;try{activeElement=document.activeElement;}catch(error){activeElement=document.body;} 2897if(!activeElement){activeElement=document.body;} 2898if(!activeElement.nodeName){activeElement=document.body;} 2899return activeElement;};var safeBlur=$.ui.safeBlur=function(element){if(element&&element.nodeName.toLowerCase()!=="body"){$(element).trigger("blur");}};$.widget("ui.draggable",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative();} 2900if(this.options.addClasses){this._addClass("ui-draggable");} 2901this._setHandleClassName();this._mouseInit();},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._removeHandleClassName();this._setHandleClassName();}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return;} 2902this._removeHandleClassName();this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return false;} 2903this.handle=this._getHandle(event);if(!this.handle){return false;} 2904this._blurActiveElement(event);this._blockFrames(o.iframeFix===true?"iframe":o.iframeFix);return true;},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_blurActiveElement:function(event){var activeElement=$.ui.safeActiveElement(this.document[0]),target=$(event.target);if(target.closest(activeElement).length){return;} 2905$.ui.safeBlur(activeElement);},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this;} 2906this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return $(this).css("position")==="fixed";}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(event);this.originalPosition=this.position=this._generatePosition(event,false);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this._setContainment();if(this._trigger("start",event)===false){this._clear();return false;} 2907this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);} 2908this._mouseDrag(event,true);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event);} 2909return true;},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top};},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset();} 2910this.position=this._generatePosition(event,true);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp(new $.Event("mouseup",event));return false;} 2911this.position=ui.position;} 2912this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);} 2913return false;},_mouseStop:function(event){var that=this,dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event);} 2914if(this.dropped){dropped=this.dropped;this.dropped=false;} 2915if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==false){that._clear();}});}else{if(this._trigger("stop",event)!==false){this._clear();}} 2916return false;},_mouseUp:function(event){this._unblockFrames();if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event);} 2917if(this.handleElement.is(event.target)){this.element.trigger("focus");} 2918return $.ui.mouse.prototype._mouseUp.call(this,event);},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new $.Event("mouseup",{target:this.element[0]}));}else{this._clear();} 2919return this;},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:true;},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle");},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle");},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):(o.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo==="parent"?this.element[0].parentNode:o.appendTo));} 2920if(helperIsFunction&&helper[0]===this.element[0]){this._setPositionRelative();} 2921if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute");} 2922return helper;},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative";}}
vendor: 11,144 bytes, lines 2922-2991
2922,_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");} 2923if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};} 2924if("left"in obj){this.offset.click.left=obj.left+this.margins.left;} 2925if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;} 2926if("top"in obj){this.offset.click.top=obj.top+this.margins.top;} 2927if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_isRootNode:function(element){return(/(html|body)/i).test(element.tagName)||element===this.document[0];},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();} 2928if(this._isRootNode(this.offsetParent[0])){po={top:0,left:0};} 2929return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0};} 2930var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+ 2931(!scrollIsRootNode?this.scrollParent.scrollTop():0),left:p.left-(parseInt(this.helper.css("left"),10)||0)+ 2932(!scrollIsRootNode?this.scrollParent.scrollLeft():0)};},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];this.relativeContainer=null;if(!o.containment){this.containment=null;return;} 2933if(o.containment==="window"){this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()- 2934this.helperProportions.width-this.margins.left,$(window).scrollTop()+ 2935($(window).height()||document.body.parentNode.scrollHeight)- 2936this.helperProportions.height-this.margins.top];return;} 2937if(o.containment==="document"){this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)- 2938this.helperProportions.height-this.margins.top];return;} 2939if(o.containment.constructor===Array){this.containment=o.containment;return;} 2940if(o.containment==="parent"){o.containment=this.helper[0].parentNode;} 2941c=$(o.containment);ce=c[0];if(!ce){return;} 2942isUserScrollable=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+ 2943(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+ 2944(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)- 2945(parseInt(c.css("borderRightWidth"),10)||0)- 2946(parseInt(c.css("paddingRight"),10)||0)- 2947this.helperProportions.width- 2948this.margins.left- 2949this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)- 2950(parseInt(c.css("borderBottomWidth"),10)||0)- 2951(parseInt(c.css("paddingBottom"),10)||0)- 2952this.helperProportions.height- 2953this.margins.top- 2954this.margins.bottom];this.relativeContainer=c;},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;} 2955var mod=d==="absolute"?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:(pos.top+ 2956this.offset.relative.top*mod+ 2957this.offset.parent.top*mod- 2958((this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))*mod)),left:(pos.left+ 2959this.offset.relative.left*mod+ 2960this.offset.parent.left*mod- 2961((this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left))*mod))};},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;if(!scrollIsRootNode||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};} 2962if(constrainPosition){if(this.containment){if(this.relativeContainer){co=this.relativeContainer.offset();containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top];}else{containment=this.containment;} 2963if(event.pageX-this.offset.click.left<containment[0]){pageX=containment[0]+this.offset.click.left;} 2964if(event.pageY-this.offset.click.top<containment[1]){pageY=containment[1]+this.offset.click.top;} 2965if(event.pageX-this.offset.click.left>containment[2]){pageX=containment[2]+this.offset.click.left;} 2966if(event.pageY-this.offset.click.top>containment[3]){pageY=containment[3]+this.offset.click.top;}} 2967if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((pageY- 2968this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;pageY=containment?((top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3])?top:((top-this.offset.click.top>=containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=o.grid[0]?this.originalPageX+ 2969Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;pageX=containment?((left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2])?left:((left-this.offset.click.left>=containment[0])?left-o.grid[0]:left+o.grid[0])):left;} 2970if(o.axis==="y"){pageX=this.originalPageX;} 2971if(o.axis==="x"){pageY=this.originalPageY;}} 2972return{top:(pageY- 2973this.offset.click.top- 2974this.offset.relative.top- 2975this.offset.parent.top+ 2976(this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))),left:(pageX- 2977this.offset.click.left- 2978this.offset.relative.left- 2979this.offset.parent.left+ 2980(this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left)))};},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove();} 2981this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy();}},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui,this],true);if(/^(drag|start|stop)/.test(type)){this.positionAbs=this._convertPositionTo("absolute");ui.offset=this.positionAbs;} 2982return $.Widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[];$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");if(sortable&&!sortable.options.disabled){draggable.sortables.push(sortable);sortable.refreshPositions();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=false;$.each(draggable.sortables,function(){var sortable=this;if(sortable.isOver){sortable.isOver=0;draggable.cancelHelperRemoval=true;sortable.cancelHelperRemoval=false;sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")};sortable._mouseStop(event);sortable.options.helper=sortable.options._helper;}else{sortable.cancelHelperRemoval=true;sortable._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=false,sortable=this;sortable.positionAbs=draggable.positionAbs;sortable.helperProportions=draggable.helperProportions;sortable.offset.click=draggable.offset.click;if(sortable._intersectsWith(sortable.containerCache)){innermostIntersecting=true;$.each(draggable.sortables,function(){this.positionAbs=draggable.positionAbs;this.helperProportions=draggable.helperProportions;this.offset.click=draggable.offset.click;if(this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])){innermostIntersecting=false;} 2983return innermostIntersecting;});} 2984if(innermostIntersecting){if(!sortable.isOver){sortable.isOver=1;draggable._parent=ui.helper.parent();sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",true);sortable.options._helper=sortable.options.helper;sortable.options.helper=function(){return ui.helper[0];};event.target=sortable.currentItem[0];sortable._mouseCapture(event,true);sortable._mouseStart(event,true,true);sortable.offset.click.top=draggable.offset.click.top;sortable.offset.click.left=draggable.offset.click.left;sortable.offset.parent.left-=draggable.offset.parent.left- 2985sortable.offset.parent.left;sortable.offset.parent.top-=draggable.offset.parent.top- 2986sortable.offset.parent.top;draggable._trigger("toSortable",event);draggable.dropped=sortable.element;$.each(draggable.sortables,function(){this.refreshPositions();});draggable.currentItem=draggable.element;sortable.fromOutside=draggable;} 2987if(sortable.currentItem){sortable._mouseDrag(event);ui.position=sortable.position;}}else{if(sortable.isOver){sortable.isOver=0;sortable.cancelHelperRemoval=true;sortable.options._revert=sortable.options.revert;sortable.options.revert=false;sortable._trigger("out",event,sortable._uiHash(sortable));sortable._mouseStop(event,true);sortable.options.revert=sortable.options._revert;sortable.options.helper=sortable.options._helper;if(sortable.placeholder){sortable.placeholder.remove();} 2988ui.helper.appendTo(draggable._parent);draggable._refreshOffsets(event);ui.position=draggable._generatePosition(event,true);draggable._trigger("fromSortable",event);draggable.dropped=false;$.each(draggable.sortables,function(){this.refreshPositions();});}}});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;if(t.css("cursor")){o._cursor=t.css("cursor");} 2989t.css("cursor",o.cursor);},stop:function(event,ui,instance){var o=instance.options;if(o._cursor){$("body").css("cursor",o._cursor);}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("opacity")){o._opacity=t.css("opacity");} 2990t.css("opacity",o.opacity);},stop:function(event,ui,instance){var o=instance.options;if(o._opacity){$(ui.helper).css("opacity",o._opacity);}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false);} 2991if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset();}}
vendor: 4,715 bytes, lines 2991-3008
2991,drag:function(event,ui,i){var o=i.options,scrolled=false,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];if(scrollParent!==document&&scrollParent.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((i.overflowOffset.top+scrollParent.offsetHeight)-event.pageY<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed;}else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed;}} 2992if(!o.axis||o.axis!=="y"){if((i.overflowOffset.left+scrollParent.offsetWidth)-event.pageX<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed;}else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed;}}}else{if(!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}} 2993if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}} 2994if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event);}}});$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[];$(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var $t=$(this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});}});},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){l=inst.snapElements[i].left-inst.margins.left;r=l+inst.snapElements[i].width;t=inst.snapElements[i].top-inst.margins.top;b=t+inst.snapElements[i].height;if(x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)){if(inst.snapElements[i].snapping){(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));} 2995inst.snapElements[i].snapping=false;continue;} 2996if(o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top;} 2997if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top;} 2998if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left;} 2999if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left;}} 3000first=(ts||bs||ls||rs);if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top;} 3001if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top;} 3002if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left;} 3003if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left;}} 3004if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));} 3005inst.snapElements[i].snapping=(ts||bs||ls||rs||first);}}});$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)- 3006(parseInt($(b).css("zIndex"),10)||0);});if(!group.length){return;} 3007min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){$(this).css("zIndex",min+i);});this.css("zIndex",(min+group.length));}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("zIndex")){o._zIndex=t.css("zIndex");} 3008t.css("zIndex",o.zIndex);},stop:function(event,ui,instance){var o=instance.options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex);}}});var widgetsDraggable=$.ui.draggable;$.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",o
vendor: 5,347 bytes, lines 3008-3020
3008ptions:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=false;this.isout=true;this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept);};this.proportions=function(){if(arguments.length){proportions=arguments[0];}else{return proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};}};this._addToManager(o.scope);o.addClasses&&this._addClass("ui-droppable");},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[];$.ui.ddmanager.droppables[scope].push(this);},_splice:function(drop){var i=0;for(;i<drop.length;i++){if(drop[i]===this){drop.splice(i,1);}}},_destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);},_setOption:function(key,value){if(key==="accept"){this.accept=$.isFunction(value)?value:function(d){return d.is(value);};}else if(key==="scope"){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);this._addToManager(value);} 3009this._super(key,value);},_activate:function(event){var draggable=$.ui.ddmanager.current;this._addActiveClass();if(draggable){this._trigger("activate",event,this.ui(draggable));}},_deactivate:function(event){var draggable=$.ui.ddmanager.current;this._removeActiveClass();if(draggable){this._trigger("deactivate",event,this.ui(draggable));}},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;} 3010if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._addHoverClass();this._trigger("over",event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;} 3011if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._removeHoverClass();this._trigger("out",event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=false;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return false;} 3012this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$(this).droppable("instance");if(inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],(draggable.currentItem||draggable.element))&&intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance,event)){childrenIntersection=true;return false;}});if(childrenIntersection){return false;} 3013if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",event,this.ui(draggable));return this.element;} 3014return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,offset:c.positionAbs};},_addHoverClass:function(){this._addClass("ui-droppable-hover");},_removeHoverClass:function(){this._removeClass("ui-droppable-hover");},_addActiveClass:function(){this._addClass("ui-droppable-active");},_removeActiveClass:function(){this._removeClass("ui-droppable-active");}});var intersect=$.ui.intersect=(function(){function isOverAxis(x,reference,size){return(x>=reference)&&(x<(reference+size));} 3015return function(draggable,droppable,toleranceMode,event){if(!droppable.offset){return false;} 3016var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return(l<=x1&&x2<=r&&t<=y1&&y2<=b);case"intersect":return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);case"pointer":return isOverAxis(event.pageY,t,droppable.proportions().height)&&isOverAxis(event.pageX,l,droppable.proportions().width);case"touch":return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));default:return false;}};})();$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0],(t.currentItem||t.element)))){continue;} 3017for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop;}} 3018m[i].visible=m[i].element.css("display")!=="none";if(!m[i].visible){continue;} 3019if(type==="mousedown"){m[i]._activate.call(m[i],event);} 3020m[i].offset=m[i].element.offset();m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight});}},drop:function(draggable,event){var dropped=false;
vendor: 15,135 bytes, lines 3020-3077
3020$.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){if(!this.options){return;} 3021if(!this.options.disabled&&this.visible&&intersect(draggable,this,this.options.tolerance,event)){dropped=this._drop.call(this,event)||dropped;} 3022if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=true;this.isover=false;this._deactivate.call(this,event);}});return dropped;},dragStart:function(draggable,event){draggable.element.parentsUntil("body").on("scroll.droppable",function(){if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}});},drag:function(draggable,event){if(draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);} 3023$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return;} 3024var parentInstance,scope,parent,intersects=intersect(draggable,this,this.options.tolerance,event),c=!intersects&&this.isover?"isout":(intersects&&!this.isover?"isover":null);if(!c){return;} 3025if(this.options.greedy){scope=this.options.scope;parent=this.element.parents(":data(ui-droppable)").filter(function(){return $(this).droppable("instance").options.scope===scope;});if(parent.length){parentInstance=$(parent[0]).droppable("instance");parentInstance.greedyChild=(c==="isover");}} 3026if(parentInstance&&c==="isover"){parentInstance.isover=false;parentInstance.isout=true;parentInstance._out.call(parentInstance,event);} 3027this[c]=true;this[c==="isout"?"isover":"isout"]=false;this[c==="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c==="isout"){parentInstance.isout=false;parentInstance.isover=true;parentInstance._over.call(parentInstance,event);}});},dragStop:function(draggable,event){draggable.element.parentsUntil("body").off("scroll.droppable");if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}}};if($.uiBackCompat!==false){$.widget("ui.droppable",$.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass);}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass);}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass);}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass);}}});} 3028var widgetsDroppable=$.ui.droppable;$.widget("ui.resizable",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,odoo_isRTL:false,resize:null,start:null,stop:null},_num:function(value){return parseFloat(value)||0;},_isNumber:function(value){return!isNaN(parseFloat(value));},_hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false;} 3029var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true;} 3030el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},_create:function(){var margins,o=this.options,that=this;this._addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;margins={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(margins);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(margins);this._proportionallyResize();} 3031this._setupHandles();if(o.autoHide){$(this.element).on("mouseenter",function(){if(o.disabled){return;} 3032that._removeClass("ui-resizable-autohide");that._handles.show();}).on("mouseleave",function(){if(o.disabled){return;} 3033if(!that.resizing){that._addClass("ui-resizable-autohide");that._handles.hide();}});} 3034this._mouseInit();},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove();};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);wrapper.remove();} 3035this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this;},_setOption:function(key,value){this._super(key,value);switch(key){case"handles":this._removeHandles();this._setupHandles();break;default:break;}},_setupHandles:function(){var o=this.options,handle,i,n,hname,axis,that=this;this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=$();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw";} 3036n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){handle=$.trim(n[i]);hname="ui-resizable-"+handle;axis=$("<div>");this._addClass(axis,"ui-resizable-handle "+hname);axis.css({zIndex:o.zIndex});this.handles[handle]=".ui-resizable-"+handle;this.element.append(axis);}} 3037this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=this.element.children(this.handles[i]).first().show();}else if(this.handles[i].jquery||this.handles[i].nodeType){this.handles[i]=$(this.handles[i]);this._on(this.handles[i],{"mousedown":that._mouseDown});} 3038if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize();} 3039this._handles=this._handles.add(this.handles[i]);}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!that.resizing){if(this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);} 3040that.axis=axis&&axis[1]?axis[1]:"se";}});if(o.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide");}},_removeHandles:function(){this._handles.remove();},_mouseCapture:function(event){var i,handle,capture=false;for(i in this.handles){handle=$(this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=true;}} 3041return!this.options.disabled&&capture;},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;this.resizing=true;this._renderProxy();curleft=this._num(this.helper.css("left"));curtop=this._num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;} 3042this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalPosition={left:curleft,top:curtop};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio==="number")?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor==="auto"?this.axis+"-resize":cursor);this._addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0,trigger=this._change[a];dx=this.options.odoo_isRTL?-dx:dx;this._updatePrevProperties();if(!trigger){return false;} 3043data=trigger.apply(this,[event,dx,dy]);this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event);} 3044data=this._respectSize(data,event);this._updateCache(data);this._propagate("resize",event);props=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize();} 3045if(!$.isEmptyObject(props)){this._updatePrevProperties();this._trigger("resize",event,this.ui());this._applyChanges();} 3046return false;},_mouseStop:function(event){this.resizing=false;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){pr=this._proportionallyResizeElements;ista=pr.length&&(/textarea/i).test(pr[0].nodeName);soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height;soffsetw=ista?0:that.sizeDiff.width;s={width:(that.helper.width()-soffsetw),height:(that.helper.height()-soffseth)};left=(parseFloat(that.element.css("left"))+ 3047(that.position.left-that.originalPosition.left))||null;top=(parseFloat(that.element.css("top"))+ 3048(that.position.top-that.originalPosition.top))||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}));} 3049that.helper.height(that.size.height);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize();}} 3050$("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove();} 3051return false;},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height};},_applyChanges:function(){var props={};if(this.position.top!==this.prevPosition.top){props.top=this.position.top+"px";} 3052if(this.position.left!==this.prevPosition.left){props.left=this.position.left+"px";} 3053if(this.size.width!==this.prevSize.width){props.width=this.size.width+"px";} 3054if(this.size.height!==this.prevSize.height){props.height=this.size.height+"px";} 3055this.helper.css(props);return props;},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth;} 3056if(pMinHeight>b.minHeight){b.minHeight=pMinHeight;} 3057if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth;} 3058if(pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight;}} 3059this._vBoundaries=b;},_updateCache:function(data){this.offset=this.helper.offset();if(this._isNumber(data.left)){this.position.left=data.left;} 3060if(this._isNumber(data.top)){this.position.top=data.top;} 3061if(this._isNumber(data.height)){this.size.height=data.height;} 3062if(this._isNumber(data.width)){this.size.width=data.width;}},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(this._isNumber(data.height)){data.width=(data.height*this.aspectRatio);}else if(this._isNumber(data.width)){data.height=(data.width/this.aspectRatio);} 3063if(a==="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null;} 3064if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);} 3065return data;},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=this._isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=this._isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=this._isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height),dw=this.originalPosition.left+this.originalSize.width,dh=this.originalPosition.top+this.originalSize.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw){data.width=o.minWidth;} 3066if(isminh){data.height=o.minHeight;} 3067if(ismaxw){data.width=o.maxWidth;} 3068if(ismaxh){data.height=o.maxHeight;} 3069if(isminw&&cw){data.left=dw-o.minWidth;} 3070if(ismaxw&&cw){data.left=dw-o.maxWidth;} 3071if(isminh&&ch){data.top=dh-o.minHeight;} 3072if(ismaxh&&ch){data.top=dh-o.maxHeight;} 3073if(!data.width&&!data.height&&!data.left&&data.top){data.top=null;}else if(!data.width&&!data.height&&!data.top&&data.left){data.left=null;} 3074return data;},_getPaddingPlusBorderDimensions:function(element){var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];for(;i<4;i++){widths[i]=(parseFloat(borders[i])||0);widths[i]+=(parseFloat(paddings[i])||0);} 3075return{height:widths[0]+widths[2],width:widths[1]+widths[3]};},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return;} 3076var prel,i=0,element=this.helper||this.element;for(;i<this._proportionallyResizeElements.length;i++){prel=this._proportionallyResizeElements[i];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(prel);} 3077prel.css({height:(element.height()-this.outerDimensions.height)||0,width:(element.width()-this.outerDimensions.width)||0});}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$("<div style='overflow:hidden;'></div>");this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",to
vendor: 2,626 bytes, lines 3077-3080
3077p:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx){return{width:this.originalSize.width+dx};},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!=="resize"&&this._trigger(n,event,this.ui()));},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:(that.size.width-soffsetw),height:(that.size.height-soffseth)},left=(parseFloat(that.element.css("left"))+ 3078(that.position.left-that.originalPosition.left))||null,top=(parseFloat(that.element.css("top"))+ 3079(that.position.top-that.originalPosition.top))||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseFloat(that.element.css("width")),height:parseFloat(that.element.css("height")),top:parseFloat(that.element.css("top")),left:parseFloat(that.element.css("left"))};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height});} 3080that._updateCache(data);that._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;
vendor: 15,910 bytes, lines 3080-3123
3080if(!ce){return;} 3081that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}else{element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name));});that.containerOffset=element.offset();that.containerPosition=element.position();that.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};co=that.containerOffset;ch=that.containerSize.height;cw=that.containerSize.width;width=(that._hasScroll(ce,"left")?ce.scrollWidth:cw);height=(that._hasScroll(ce)?ce.scrollHeight:ch);that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=true;if(ce[0]!==document&&(/static/).test(ce.css("position"))){cop=co;} 3082if(cp.left<(that._helper?co.left:0)){that.size.width=that.size.width+ 3083(that._helper?(that.position.left-co.left):(that.position.left-cop.left));if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false;} 3084that.position.left=o.helper?co.left:0;} 3085if(cp.top<(that._helper?co.top:0)){that.size.height=that.size.height+ 3086(that._helper?(that.position.top-co.top):that.position.top);if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false;} 3087that.position.top=that._helper?co.top:0;} 3088isParent=that.containerElement.get(0)===that.element.parent().get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(isParent&&isOffsetRelative){that.offset.left=that.parentData.left+that.position.left;that.offset.top=that.parentData.top+that.position.top;}else{that.offset.left=that.element.offset().left;that.offset.top=that.element.offset().top;} 3089woset=Math.abs(that.sizeDiff.width+ 3090(that._helper?that.offset.left-cop.left:(that.offset.left-co.left)));hoset=Math.abs(that.sizeDiff.height+ 3091(that._helper?that.offset.top-cop.top:(that.offset.top-co.top)));if(woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false;}} 3092if(hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false;}} 3093if(!continueResize){that.position.left=that.prevPosition.left;that.position.top=that.prevPosition.top;that.size.width=that.prevSize.width;that.size.height=that.prevSize.height;}},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});} 3094if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}}});$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseFloat(el.width()),height:parseFloat(el.height()),left:parseFloat(el.css("left")),top:parseFloat(el.css("top"))});});},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:(that.size.height-os.height)||0,width:(that.size.width-os.width)||0,top:(that.position.top-op.top)||0,left:(that.position.left-op.left)||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null;}});el.css(style);});},stop:function(){$(this).removeData("ui-resizable-alsoresize");}});$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:0.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0});that._addClass(that.ghost,"ui-resizable-ghost");if($.uiBackCompat!==false&&typeof that.options.ghost==="string"){that.ghost.addClass(this.options.ghost);} 3095that.ghost.appendTo(that.helper);},resize:function(){var that=$(this).resizable("instance");if(that.ghost){that.ghost.css({position:"relative",height:that.size.height,width:that.size.width});}},stop:function(){var that=$(this).resizable("instance");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0));}}});$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=(grid[0]||1),gridY=(grid[1]||1),ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&(o.maxWidth<newWidth),isMaxHeight=o.maxHeight&&(o.maxHeight<newHeight),isMinWidth=o.minWidth&&(o.minWidth>newWidth),isMinHeight=o.minHeight&&(o.minHeight>newHeight);o.grid=grid;if(isMinWidth){newWidth+=gridX;} 3096if(isMinHeight){newHeight+=gridY;} 3097if(isMaxWidth){newWidth-=gridX;} 3098if(isMaxHeight){newHeight-=gridY;} 3099if(/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;}else if(/^(ne)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy;}else if(/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox;}else{if(newHeight-gridY<=0||newWidth-gridX<=0){outerDimensions=that._getPaddingPlusBorderDimensions(this);} 3100if(newHeight-gridY>0){that.size.height=newHeight;that.position.top=op.top-oy;}else{newHeight=gridY-outerDimensions.height;that.size.height=newHeight;that.position.top=op.top+os.height-newHeight;} 3101if(newWidth-gridX>0){that.size.width=newWidth;if(that.options.odoo_isRTL){that.position.left=op.left+ox;}else{that.position.left=op.left-ox;}}else{newWidth=gridX-outerDimensions.width;that.size.width=newWidth;if(that.options.odoo_isRTL){that.position.left=op.left-os.width+newWidth;}else{that.position.left=op.left+os.width-newWidth;}}}}});var widgetsResizable=$.ui.resizable;var widgetsSelectable=$.widget("ui.selectable",$.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var that=this;this._addClass("ui-selectable");this.dragged=false;this.refresh=function(){that.elementPos=$(that.element[0]).offset();that.selectees=$(that.options.filter,that.element[0]);that._addClass(that.selectees,"ui-selectee");that.selectees.each(function(){var $this=$(this),selecteeOffset=$this.offset(),pos={left:selecteeOffset.left-that.elementPos.left,top:selecteeOffset.top-that.elementPos.top};$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")});});};this.refresh();this._mouseInit();this.helper=$("<div>");this._addClass(this.helper,"ui-selectable-helper");},_destroy:function(){this.selectees.removeData("selectable-item");this._mouseDestroy();},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY];this.elementPos=$(this.element[0]).offset();if(this.options.disabled){return;} 3102this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"left":event.pageX,"top":event.pageY,"width":0,"height":0});if(options.autoRefresh){this.refresh();} 3103this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!event.metaKey&&!event.ctrlKey){that._removeClass(selectee.$element,"ui-selected");selectee.selected=false;that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}});$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");if(selectee){doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected");that._removeClass(selectee.$element,doSelect?"ui-unselecting":"ui-selected")._addClass(selectee.$element,doSelect?"ui-selecting":"ui-unselecting");selectee.unselecting=!doSelect;selectee.selecting=doSelect;selectee.selected=doSelect;if(doSelect){that._trigger("selecting",event,{selecting:selectee.element});}else{that._trigger("unselecting",event,{unselecting:selectee.element});} 3104return false;}});},_mouseDrag:function(event){this.dragged=true;if(this.options.disabled){return;} 3105var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){tmp=x2;x2=x1;x1=tmp;} 3106if(y1>y2){tmp=y2;y2=y1;y1=tmp;} 3107this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=false,offset={};if(!selectee||selectee.element===that.element[0]){return;} 3108offset.left=selectee.left+that.elementPos.left;offset.right=selectee.right+that.elementPos.left;offset.top=selectee.top+that.elementPos.top;offset.bottom=selectee.bottom+that.elementPos.top;if(options.tolerance==="touch"){hit=(!(offset.left>x2||offset.right<x1||offset.top>y2||offset.bottom<y1));}else if(options.tolerance==="fit"){hit=(offset.left>x1&&offset.right<x2&&offset.top>y1&&offset.bottom<y2);} 3109if(hit){if(selectee.selected){that._removeClass(selectee.$element,"ui-selected");selectee.selected=false;} 3110if(selectee.unselecting){that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=false;} 3111if(!selectee.selecting){that._addClass(selectee.$element,"ui-selecting");selectee.selecting=true;that._trigger("selecting",event,{selecting:selectee.element});}}else{if(selectee.selecting){if((event.metaKey||event.ctrlKey)&&selectee.startselected){that._removeClass(selectee.$element,"ui-selecting");selectee.selecting=false;that._addClass(selectee.$element,"ui-selected");selectee.selected=true;}else{that._removeClass(selectee.$element,"ui-selecting");selectee.selecting=false;if(selectee.startselected){that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=true;} 3112that._trigger("unselecting",event,{unselecting:selectee.element});}} 3113if(selectee.selected){if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){that._removeClass(selectee.$element,"ui-selected");selectee.selected=false;that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}}}});return false;},_mouseStop:function(event){var that=this;this.dragged=false;$(".ui-unselecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=false;selectee.startselected=false;that._trigger("unselected",event,{unselected:selectee.element});});$(".ui-selecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,"ui-selecting")._addClass(selectee.$element,"ui-selected");selectee.selecting=false;selectee.selected=true;selectee.startselected=true;that._trigger("selected",event,{selected:selectee.element});});this._trigger("stop",event);this.helper.remove();return false;}});var widgetsSortable=$.widget("ui.sortable",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return(x>=reference)&&(x<(reference+size));},_isFloating:function(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"));},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true;},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._setHandleClassName();}},_setHandleClassName:function(){var that=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");$.each(this.items,function(){that._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle");});},_destroy:function(){this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item");} 3114return this;},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=false,that=this;if(this.reverting){return false;} 3115if(this.options.disabled||this.options.type==="static"){return false;} 3116this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that){currentItem=$(this);return false;}});if($.data(event.target,that.widgetName+"-item")===that){currentItem=$(event.target);} 3117if(!currentItem){return false;} 3118if(this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(function(){if(this===event.target){validHandle=true;}});if(!validHandle){return false;}} 3119this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide();} 3120this._createPlaceholder();if(o.containment){this._setContainment();} 3121if(o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");body.css("cursor",o.cursor);this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body);} 3122if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity");} 3123this.helper.css("opacity",o.opacity);}
vendor: 16,733 bytes, lines 3124-3197
3124if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex");} 3125this.helper.css("zIndex",o.zIndex);} 3126if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset();} 3127this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions();} 3128if(!noActivation){for(i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,this._uiHash(this));}} 3129if($.ui.ddmanager){$.ui.ddmanager.current=this;} 3130if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);} 3131this.dragging=true;this._addClass(this.helper,"ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=false;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;} 3132if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)- 3133event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;}else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;} 3134if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)- 3135event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;}else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(event.pageY-this.document.scrollTop()<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed);}else if(this.window.height()-(event.pageY-this.document.scrollTop())<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed);} 3136if(event.pageX-this.document.scrollLeft()<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed);}else if(this.window.width()-(event.pageX-this.document.scrollLeft())<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed);}} 3137if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}} 3138this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";} 3139if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px";} 3140for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue;} 3141if(item.instance!==this.currentContainer){continue;} 3142if(itemElement!==this.currentItem[0]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):true)){this.direction=intersection===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;} 3143this._trigger("change",event,this._uiHash());break;}} 3144this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);} 3145this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event){return;} 3146if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event);} 3147if(this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+ 3148(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft);} 3149if(!axis||axis==="y"){animation.top=cur.top-this.offset.parent.top-this.margins.top+ 3150(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop);} 3151this.reverting=true;$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event);});}else{this._clear(event,noPropagation);} 3152return false;},cancel:function(){if(this.dragging){this._mouseUp(new $.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper");}else{this.currentItem.show();} 3153for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0;}}} 3154if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0]);} 3155if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove();} 3156$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}} 3157return this;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]));}});if(!str.length&&o.key){str.push(o.key+"=");} 3158return str.join("&");},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"");});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight=(this.options.axis==="x")||((y1+dyClick)>t&&(y1+dyClick)<b),isOverElementWidth=(this.options.axis==="y")||((x1+dxClick)>l&&(x1+dxClick)<r),isOverElement=isOverElementHeight&&isOverElementWidth;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var verticalDirection,horizontalDirection,isOverElementHeight=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth;if(!isOverElement){return false;} 3159verticalDirection=this._getDragVerticalDirection();horizontalDirection=this._getDragHorizontalDirection();return this.floating?((horizontalDirection==="right"||verticalDirection==="down")?2:1):(verticalDirection&&(verticalDirection==="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+ 3160this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=this._isOverAxis(this.positionAbs.left+ 3161this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!==0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this._setHandleClassName();this.refreshPositions();return this;},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);}}}} 3162queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this);} 3163for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems);} 3164return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[0]){return false;}} 3165return true;});},_refreshItems:function(event){this.items=[];this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}}}} 3166for(i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});}}},refreshPositions:function(fast){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();} 3167var i,item,t,p;for(i=this.items.length-1;i>=0;i--){item=this.items[i];if(item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]){continue;} 3168t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();} 3169p=t.offset();item.left=p.left;item.top=p.top;} 3170if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(i=this.containers.length-1;i>=0;i--){p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();}} 3171return this;},_createPlaceholder:function(that){that=that||this;var className,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){className=o.placeholder;o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]);that._addClass(element,"ui-sortable-placeholder",className||that.currentItem[0].className)._removeClass(element,"ui-sortable-helper");if(nodeName==="tbody"){that._createTrPlaceholder(that.currentItem.find("tr").eq(0),$("<tr>",that.document[0]).appendTo(element));}else if(nodeName==="tr"){that._createTrPlaceholder(that.currentItem,element);}else if(nodeName==="img"){element.attr("src",that.currentItem.attr("src"));} 3172if(!className){element.css("visibility","hidden");} 3173return element;},update:function(container,p){if(className&&!o.forcePlaceholderSize){return;} 3174if(!p.height()){p.height(that.currentItem.innerHeight()- 3175parseInt(that.currentItem.css("paddingTop")||0,10)- 3176parseInt(that.currentItem.css("paddingBottom")||0,10));} 3177if(!p.width()){p.width(that.currentItem.innerWidth()- 3178parseInt(that.currentItem.css("paddingLeft")||0,10)- 3179parseInt(that.currentItem.css("paddingRight")||0,10));}}};} 3180that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder);},_createTrPlaceholder:function(sourceTr,targetTr){var that=this;sourceTr.children().each(function(){$("<td> </td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(targetTr);});},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0])){continue;} 3181if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){continue;} 3182innermostContainer=this.containers[i];innermostIndex=i;}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}} 3183if(!innermostContainer){return;} 3184if(this.containers.length===1){if(!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}}else{dist=10000;itemWithLeastDistance=null;floating=innermostContainer.floating||this._isFloating(this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";axis=floating?"pageX":"pageY";for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue;} 3185if(this.items[j].item[0]===this.currentItem[0]){continue;} 3186cur=this.items[j].item.offset()[posProperty];nearBottom=false;if(event[axis]-cur>this.items[j][sizeProperty]/2){nearBottom=true;} 3187if(Math.abs(event[axis]-cur)<dist){dist=Math.abs(event[axis]-cur);itemWithLeastDistance=this.items[j];this.direction=nearBottom?"up":"down";}} 3188if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return;} 3189if(this.currentContainer===this.containers[innermostIndex]){if(!this.currentContainer.containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash());this.currentContainer.containerCache.over=1;} 3190return;} 3191itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[innermostIndex].element,true);this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper==="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){$(o.appendTo!=="parent"?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);} 3192if(helper[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};} 3193if(!helper[0].style.width||o.forceHelperSize){helper.width(this.currentItem.width());} 3194if(!helper[0].style.height||o.forceHelperSize){helper.height(this.currentItem.height());} 3195return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");} 3196if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};} 3197if("left"in obj){this.offset.click.left=obj.left+this.margins.left;}
vendor: 4,920 bytes, lines 3198-3226
3198if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;} 3199if("top"in obj){this.offset.click.top=obj.top+this.margins.top;} 3200if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();} 3201if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0};} 3202return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+ 3203this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+ 3204this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var ce,co,over,o=this.options;if(o.containment==="parent"){o.containment=this.helper[0].parentNode;} 3205if(o.containment==="document"||o.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,o.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(o.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];} 3206if(!(/^(document|window|parent)$/).test(o.containment)){ce=$(o.containment)[0];co=$(o.containment).offset();over=($(ce).css("overflow")!=="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+ 3207(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+ 3208(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)- 3209(parseInt($(ce).css("borderLeftWidth"),10)||0)- 3210(parseInt($(ce).css("paddingRight"),10)||0)- 3211this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)- 3212(parseInt($(ce).css("borderTopWidth"),10)||0)- 3213(parseInt($(ce).css("paddingBottom"),10)||0)- 3214this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;} 3215var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+ 3216this.offset.relative.top*mod+ 3217this.offset.parent.top*mod- 3218((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+ 3219this.offset.relative.left*mod+ 3220this.offset.parent.left*mod- 3221((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();} 3222if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left;} 3223if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top;} 3224if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left;} 3225if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top;}} 3226if(o.grid){top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?((top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3])?top:((top-this.offset.click.top>=this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;
vendor: 4,076 bytes, lines 3226-3252
3226left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?((left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2])?left:((left-this.offset.click.left>=this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}} 3227return{top:(pageY- 3228this.offset.click.top- 3229this.offset.relative.top- 3230this.offset.parent.top+ 3231((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX- 3232this.offset.click.left- 3233this.offset.relative.left- 3234this.offset.parent.left+ 3235((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){if(counter===this.counter){this.refreshPositions(!hardRefresh);}});},_clear:function(event,noPropagation){this.reverting=false;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem);} 3236this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]="";}} 3237this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper");}else{this.currentItem.show();} 3238if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});} 3239if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});} 3240if(this!==this.currentContainer){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.currentContainer));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.currentContainer));}} 3241function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};} 3242for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]));} 3243if(this.containers[i].containerCache.over){delayedTriggers.push(delayEvent("out",this,this.containers[i]));this.containers[i].containerCache.over=0;}} 3244if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove();} 3245if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity);} 3246if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);} 3247this.dragging=false;if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());} 3248this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove();} 3249this.helper=null;} 3250if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);} 3251this._trigger("stop",event,this._uiHash());} 3252this.fromOutside=false;return!this.cancelHelperRemoval;},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null};}});var widgetsMenu=$.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"}
vendor: 5,098 bytes, lines 3252-3260
3252,role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=false;this.element.uniqueId().attr({role:this.options.role,tabIndex:0});this._addClass("ui-menu","ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(event){event.preventDefault();},"click .ui-menu-item":function(event){var target=$(event.target);var active=$($.ui.safeActiveElement(this.document[0]));if(!this.mouseHandled&&target.not(".ui-state-disabled").length){this.select(event);if(!event.isPropagationStopped()){this.mouseHandled=true;} 3253if(target.has(".ui-menu").length){this.expand(event);}else if(!this.element.is(":focus")&&active.closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer);}}}},"mouseenter .ui-menu-item":function(event){if(this.previousFilter){return;} 3254var actualTarget=$(event.target).closest(".ui-menu-item"),target=$(event.currentTarget);if(actualTarget[0]!==target[0]){return;} 3255this._removeClass(target.siblings().children(".ui-state-active"),null,"ui-state-active");this.focus(event,target);},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this.element.find(this.options.items).eq(0);if(!keepActiveItem){this.focus(event,item);}},blur:function(event){this._delay(function(){var notContained=!$.contains(this.element[0],$.ui.safeActiveElement(this.document[0]));if(notContained){this.collapseAll(event);}});},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(event){if(this._closeOnDocumentClick(event)){this.collapseAll(event);} 3256this.mouseHandled=false;}});},_destroy:function(){var items=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),submenus=items.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled "+"tabIndex").removeUniqueId().show();submenus.children().each(function(){var elem=$(this);if(elem.data("ui-menu-submenu-caret")){elem.remove();}});},_keydown:function(event){var match,prev,character,skip,preventDefault=true;switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(event);} 3257break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=false;prev=this.previousFilter||"";skip=false;character=event.keyCode>=96&&event.keyCode<=105?(event.keyCode-96).toString():String.fromCharCode(event.keyCode);clearTimeout(this.filterTimer);if(character===prev){skip=true;}else{character=prev+character;} 3258match=this._filterMenuItems(character);match=skip&&match.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):match;if(!match.length){character=String.fromCharCode(event.keyCode);match=this._filterMenuItems(character);} 3259if(match.length){this.focus(event,match);this.previousFilter=character;this.filterTimer=this._delay(function(){delete this.previousFilter;},1000);}else{delete this.previousFilter;}} 3260if(preventDefault){event.preventDefault();}},_activate:function(event){if(this.active&&!this.active.is(".ui-state-disabled")){if(this.active.children("[aria-haspopup='true']").length){this.expand(event);}else{this.select(event);}}},refresh:function(){var menus,items,newSubmenus,newItems,newWrappers,that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length);newSubmenus=submenus.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.prev(),submenuCaret=$("<span>").data("ui-menu-submenu-caret",true);that._addClass(submenuCaret,"ui-menu-icon","ui-icon "+icon);item.attr("aria-haspopup","true").prepend(submenuCaret);menu.attr("aria-labelledby",item.attr("id"));});this._addClass(newSubmenus,"ui-menu","ui-widget ui-widget-content ui-front");menus=submenus.add(this.element);items=menus.find(this.options.items);items.not(".ui-menu-item").each(function(){var item=$(this);if(that._isDivider(item)){that._addClass(item,"ui-menu-divider","ui-widget-content");}});newItems=items.not(".ui-menu-item, .ui-menu-divider");newWrappers=newItems.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()});this._addClass(newItems,"ui-menu-item")._addClass(newWrappers,"ui-menu-item-wrapper");items.filter(".ui-state-disabled").attr("aria-disabled","true");
vendor: 1,420 bytes, lines 3260-3264
3260if(this.active&&!$.contains(this.element[0],this.active[0])){this.blur();}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role];},_setOption:function(key,value){if(key==="icons"){var icons=this.element.find(".ui-menu-icon");this._removeClass(icons,null,this.options.icons.submenu)._addClass(icons,null,value.submenu);} 3261this._super(key,value);},_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",String(value));this._toggleClass(null,"ui-state-disabled",!!value);},focus:function(event,item){var nested,focused,activeParent;this.blur(event,event&&event.type==="focus");this._scrollIntoView(item);this.active=item.first();focused=this.active.children(".ui-menu-item-wrapper");this._addClass(focused,null,"ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",focused.attr("id"));} 3262activeParent=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");this._addClass(activeParent,null,"ui-state-active");if(event&&event.type==="keydown"){this._close();}else{this.timer=this._delay(function(){this._close();},this.delay);} 3263nested=item.children(".ui-menu");if(nested.length&&event&&(/^mouse/.test(event.type))){this._startOpening(nested);} 3264this.activeMenu=item.parent();this._trigger("focus",event,{item:item});},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;
vendor: 4,240 bytes, lines 3264-3279
3264if(this._hasScroll()){borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0;paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0;offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop;scroll=this.activeMenu.scrollTop();elementHeight=this.activeMenu.height();itemHeight=item.outerHeight();if(offset<0){this.activeMenu.scrollTop(scroll+offset);}else if(offset+itemHeight>elementHeight){this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight);}}},blur:function(event,fromFocus){if(!fromFocus){clearTimeout(this.timer);} 3265if(!this.active){return;} 3266this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active");this._trigger("blur",event,{item:this.active});this.active=null;},_startOpening:function(submenu){clearTimeout(this.timer);if(submenu.attr("aria-hidden")!=="true"){return;} 3267this.timer=this._delay(function(){this._close();this._open(submenu);},this.delay);},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true");submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position);},collapseAll:function(event,all){clearTimeout(this.timer);this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));if(!currentMenu.length){currentMenu=this.element;} 3268this._close(currentMenu);this.blur(event);this._removeClass(currentMenu.find(".ui-state-active"),null,"ui-state-active");this.activeMenu=currentMenu;},this.delay);},_close:function(startMenu){if(!startMenu){startMenu=this.active?this.active.parent():this.element;} 3269startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false");},_closeOnDocumentClick:function(event){return!$(event.target).closest(".ui-menu").length;},_isDivider:function(item){return!/[^\-\u2014\u2013\s]/.test(item.text());},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(newItem&&newItem.length){this._close();this.focus(event,newItem);}},expand:function(event){var newItem=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();if(newItem&&newItem.length){this._open(newItem.parent());this._delay(function(){this.focus(event,newItem);});}},next:function(event){this._move("next","first",event);},previous:function(event){this._move("prev","last",event);},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length;},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length;},_move:function(direction,filter,event){var next;if(this.active){if(direction==="first"||direction==="last"){next=this.active 3270[direction==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1);}else{next=this.active 3271[direction+"All"](".ui-menu-item").eq(0);}} 3272if(!next||!next.length||!this.active){next=this.activeMenu.find(this.options.items)[filter]();} 3273this.focus(event,next);},nextPage:function(event){var item,base,height;if(!this.active){this.next(event);return;} 3274if(this.isLastItem()){return;} 3275if(this._hasScroll()){base=this.active.offset().top;height=this.element.height();this.active.nextAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base-height<0;});this.focus(event,item);}else{this.focus(event,this.activeMenu.find(this.options.items) 3276[!this.active?"first":"last"]());}},previousPage:function(event){var item,base,height;if(!this.active){this.next(event);return;} 3277if(this.isFirstItem()){return;} 3278if(this._hasScroll()){base=this.active.offset().top;height=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base+height>0;});this.focus(event,item);}else{this.focus(event,this.activeMenu.find(this.options.items).first());}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight");},select:function(event){this.active=this.active||$(event.target).closest(".ui-menu-item");var ui={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(event,true);} 3279this._trigger("select",event,ui);}
vendor: 4,273 bytes, lines 3279-3292
3279,_filterMenuItems:function(character){var escapedCharacter=character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),regex=new RegExp("^"+escapedCharacter,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return regex.test($.trim($(this).children(".ui-menu-item-wrapper").text()));});}});$.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea=nodeName==="textarea",isInput=nodeName==="input";this.isMultiLine=isTextarea||!isInput&&this._isContentEditable(this.element);this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;suppressKeyPressRepeat=true;return;} 3280suppressKeyPress=false;suppressInput=false;suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next",event);break;case keyCode.ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();this.menu.select(event);} 3281break;case keyCode.TAB:if(this.menu.active){this.menu.select(event);} 3282break;case keyCode.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term);} 3283this.close(event);event.preventDefault();} 3284break;default:suppressKeyPressRepeat=true;this._searchTimeout(event);break;}},keypress:function(event){if(suppressKeyPress){suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault();} 3285return;} 3286if(suppressKeyPressRepeat){return;} 3287var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event);break;}},input:function(event){if(suppressInput){suppressInput=false;event.preventDefault();return;} 3288this._searchTimeout(event);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(event){if(this.cancelBlur){delete this.cancelBlur;return;} 3289clearTimeout(this.searching);this.close(event);this._change(event);}});this._initSource();this.menu=$("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance");this._addClass(this.menu.element,"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(event){event.preventDefault();this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");}});},menufocus:function(event,ui){var label,item;if(this.isNewMenu){this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent);});return;}} 3290item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){this._value(item.value);}} 3291label=ui.item.attr("aria-label")||item.value;if(label&&$.trim(label).length){this.liveRegion.children().hide();$("<div>").text(label).appendTo(this.liveRegion);}},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item;});} 3292if(false!==this._trigger("select",event,{item:item})){this._value(item.value);}
vendor: 4,710 bytes, lines 3293-3307
3293this.term=this._value();this.close(event);this.selectedItem=item;}});this.liveRegion=$("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(key,value){this._super(key,value);if(key==="source"){this._initSource();} 3294if(key==="appendTo"){this.menu.element.appendTo(this._appendTo());} 3295if(key==="disabled"&&value&&this.xhr){this.xhr.abort();}},_isEventTargetInWidget:function(event){var menuElement=this.menu.element[0];return event.target===this.element[0]||event.target===menuElement||$.contains(menuElement,event.target);},_closeOnClickOutside:function(event){if(!this._isEventTargetInWidget(event)){this.close();}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);} 3296if(!element||!element[0]){element=this.element.closest(".ui-front, dialog");} 3297if(!element.length){element=this.document[0].body;} 3298return element;},_initSource:function(){var array,url,that=this;if($.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term));};}else if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(that.xhr){that.xhr.abort();} 3299that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data);},error:function(){response([]);}});};}else{this.source=this.options.source;}},_searchTimeout:function(event){clearTimeout(this.searching);this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;if(!equalValues||(equalValues&&!menuVisible&&!modifierKey)){this.selectedItem=null;this.search(null,event);}},this.options.delay);},search:function(value,event){value=value!=null?value:this._value();this.term=this._value();if(value.length<this.options.minLength){return this.close(event);} 3300if(this._trigger("search",event)===false){return;} 3301return this._search(value);},_search:function(value){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:value},this._response());},_response:function(){var index=++this.requestIndex;return $.proxy(function(content){if(index===this.requestIndex){this.__response(content);} 3302this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading");}},this);},__response:function(content){if(content){content=this._normalize(content);} 3303this._trigger("response",null,{content:content});if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);this._trigger("open");}else{this._close();}},close:function(event){this.cancelSearch=true;this._close(event);},_close:function(event){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",event);}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{item:this.selectedItem});}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items;} 3304return $.map(items,function(item){if(typeof item==="string"){return{label:item,value:item};} 3305return $.extend({},item,{label:item.label||item.value,value:item.value||item.label});});},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next();} 3306this._on(this.document,{mousedown:"_closeOnClickOutside"});},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){return $("<li>").append($("<div>").text(item.label)).appendTo(ul);},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return;} 3307if(this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)){if
vendor: 10,103 bytes, lines 3307-3334
3307(!this.isMultiLine){this._value(this.term);} 3308this.menu.blur();return;} 3309this.menu[direction](event);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(keyEvent,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);event.preventDefault();}},_isContentEditable:function(element){if(!element.length){return false;} 3310var editable=element.prop("contentEditable");if(editable==="inherit"){return this._isContentEditable(element.parent());} 3311return editable==="true";}});$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value);});}});$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(content){var message;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return;} 3312if(content&&content.length){message=this.options.messages.results(content.length);}else{message=this.options.messages.noResults;} 3313this.liveRegion.children().hide();$("<div>").text(message).appendTo(this.liveRegion);}});var widgetsAutocomplete=$.ui.autocomplete;$.extend($.ui,{datepicker:{version:"1.12.1"}});var datepicker_instActive;function datepicker_getZindex(elem){var position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}} 3314elem=elem.parent();} 3315return 0;} 3316function Datepicker(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.regional.en=$.extend(true,{},this.regional[""]);this.regional["en-US"]=$.extend(true,{},this.regional.en);this.dpDiv=datepicker_bindHover($("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));} 3317$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(settings){datepicker_extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var nodeName,inline,inst;nodeName=target.nodeName.toLowerCase();inline=(nodeName==="div"||nodeName==="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid;} 3318inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{});if(nodeName==="input"){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:datepicker_bindHover($("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return;} 3319this._attachments(input,inst);input.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp);this._autoSize(inst);$.data(target,"datepicker",inst);if(inst.settings.disabled){this._disableDatepicker(target);}},_attachments:function(input,inst){var showOn,buttonText,buttonImage,appendText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove();} 3320if(appendText){inst.append=$("<span class='"+this._appendClass+"'>"+appendText+"</span>");input[isRTL?"before":"after"](inst.append);} 3321input.off("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove();} 3322showOn=this._get(inst,"showOn");if(showOn==="focus"||showOn==="both"){input.on("focus",this._showDatepicker);} 3323if(showOn==="button"||showOn==="both"){buttonText=this._get(inst,"buttonText");buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$("<button type='button'></button>").addClass(this._triggerClass).html(!buttonImage?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.on("click",function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]){$.datepicker._hideDatepicker();}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]){$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0]);}else{$.datepicker._showDatepicker(input[0]);} 3324return false;});}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var findMax,max,maxI,i,date=new Date(2009,12-1,20),dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){findMax=function(names){max=0;maxI=0;for(i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i;}} 3325return maxI;};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay());} 3326inst.input.attr("size",this._formatDate(inst,date).length);}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return;} 3327divSpan.addClass(this.markerClassName).append(inst.dpDiv);$.data(target,"datepicker",inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target);} 3328inst.dpDiv.css("display","block");},_dialogDatepicker:function(input,date,onSelect,settings,pos){var id,browserWidth,browserHeight,scrollX,scrollY,inst=this._dialogInst;if(!inst){this.uuid+=1;id="dp"+this.uuid;this._dialogInput=$("<input type='text' id='"+id+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.on("keydown",this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],"datepicker",inst);} 3329datepicker_extendRemove(inst.settings,settings||{});date=(date&&date.constructor===Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){browserWidth=document.documentElement.clientWidth;browserHeight=document.documentElement.clientHeight;scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];} 3330this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv);} 3331$.data(this._dialogInput[0],"datepicker",inst);return this;},_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;} 3332nodeName=target.nodeName.toLowerCase();$.removeData(target,"datepicker");if(nodeName==="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp);}else if(nodeName==="div"||nodeName==="span"){$target.removeClass(this.markerClassName).empty();} 3333if(datepicker_instActive===inst){datepicker_instActive=null;}},_enableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;} 3334nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false;}).end().filter("img").css({opacity:"1.0",cursor:""});}
vendor: 6,218 bytes, lines 3334-3361
3334else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false);} 3335this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});},_disableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;} 3336nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true;}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true);} 3337this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;} 3338for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]===target){return true;}} 3339return false;},_getInst:function(target){try{return $.data(target,"datepicker");} 3340catch(err){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(target,name,value){var settings,date,minDate,maxDate,inst=this._getInst(target);if(arguments.length===2&&typeof name==="string"){return(name==="defaults"?$.extend({},$.datepicker._defaults):(inst?(name==="all"?$.extend({},inst.settings):this._get(inst,name)):null));} 3341settings=name||{};if(typeof name==="string"){settings={};settings[name]=value;} 3342if(inst){if(this._curInst===inst){this._hideDatepicker();} 3343date=this._getDateDatepicker(target,true);minDate=this._getMinMaxDate(inst,"min");maxDate=this._getMinMaxDate(inst,"max");datepicker_extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate);} 3344if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate);} 3345if("disabled"in settings){if(settings.disabled){this._disableDatepicker(target);}else{this._enableDatepicker(target);}} 3346this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst);}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault);} 3347return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var onSelect,dateStr,sel,inst=$.datepicker._getInst(event.target),handled=true,isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:sel=$("td."+$.datepicker._dayOverClass+":not(."+ 3348$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);} 3349onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else{$.datepicker._hideDatepicker();} 3350return false;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target);} 3351handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target);} 3352handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D");} 3353handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");} 3354break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D");} 3355handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D");} 3356handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");} 3357break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D");} 3358handled=event.ctrlKey||event.metaKey;break;default:handled=false;}}else if(event.keyCode===36&&event.ctrlKey){$.datepicker._showDatepicker(this);}else{handled=false;} 3359if(handled){event.preventDefault();event.stopPropagation();}},_doKeyPress:function(event){var chars,chr,inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));chr=String.fromCharCode(event.charCode==null?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var date,inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal){try{date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst);}} 3360catch(err){}} 3361return true;}
vendor: 8,931 bytes, lines 3361-3388
3361,_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!=="input"){input=$("input",input.parentNode)[0];} 3362if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input){return;} 3363var inst,beforeShow,beforeShowSettings,isFixed,offset,showAnim,duration;inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!==inst){$.datepicker._curInst.dpDiv.stop(true,true);if(inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0]);}} 3364beforeShow=$.datepicker._get(inst,"beforeShow");beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return;} 3365datepicker_extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value="";} 3366if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;} 3367isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")==="fixed";return!isFixed;});offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){showAnim=$.datepicker._get(inst,"showAnim");duration=$.datepicker._get(inst,"duration");inst.dpDiv.css("z-index",datepicker_getZindex($(input))+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects.effect[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration);}else{inst.dpDiv[showAnim||"show"](showAnim?duration:null);} 3368if($.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus");} 3369$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){this.maxRows=4;datepicker_instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));this._attachHandlers(inst);var origyearshtml,numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],width=17,activeCell=inst.dpDiv.find("."+this._dayOverClass+" a");if(activeCell.length>0){datepicker_handleMouseover.apply(activeCell.get(0));} 3370inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em");} 3371inst.dpDiv[(numMonths[0]!==1||numMonths[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus");} 3372if(inst.yearshtml){origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);} 3373origyearshtml=inst.yearshtml=null;},0);}},_shouldFocusInput:function(inst){return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus");},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left===inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top===(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset;},_findPos:function(obj){var position,inst=this._getInst(obj),isRTL=this._get(inst,"isRTL");while(obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.filters.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"];} 3374position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input){var showAnim,duration,postProcess,onClose,inst=this._curInst;if(!inst||(input&&inst!==$.data(input,"datepicker"))){return;} 3375if(this._datepickerShowing){showAnim=this._get(inst,"showAnim");duration=this._get(inst,"duration");postProcess=function(){$.datepicker._tidyDialog(inst);};if($.effects&&($.effects.effect[showAnim]||$.effects[showAnim])){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess);}else{inst.dpDiv[(showAnim==="slideDown"?"slideUp":(showAnim==="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess);} 3376if(!showAnim){postProcess();} 3377this._datepickerShowing=false;onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst]);} 3378this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv);}} 3379this._inDialog=false;}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar");},_checkExternalClick:function(event){if(!$.datepicker._curInst){return;} 3380var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if((($target[0].id!==$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length===0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)))||($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!==inst)){$.datepicker._hideDatepicker();}},_adjustDate:function(id,offset,period){var target=$(id),inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return;} 3381this._adjustInstDate(inst,offset+ 3382(period==="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst);},_gotoToday:function(id){var date,target=$(id),inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}else{date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();} 3383this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id),inst=this._getInst(target[0]);inst["selected"+(period==="M"?"Month":"Year")]=inst["draw"+(period==="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_selectDay:function(id,month,year,td){var inst,target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;} 3384inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));},_clearDate:function(id){var target=$(id);this._selectDate(target,"");},_selectDate:function(id,dateStr){var onSelect,target=$(id),inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr);} 3385this._updateAlternate(inst);onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else if(inst.input){inst.input.trigger("change");} 3386if(inst.inline){this._updateDatepicker(inst);}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!=="object"){inst.input.trigger("focus");} 3387this._lastInput=null;}},_updateAlternate:function(inst){var altFormat,date,dateStr,altField=this._get(inst,"altField");if(altField){altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).val(dateStr);}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""];},iso8601Week:function(date){var time,checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1;},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments";} 3388value=(typeof value==="object"?value.toString():value+"");
vendor: 9,145 bytes, lines 3388-3418
3388if(value===""){return null;} 3389var iFormat,dim,extra,iValue=0,shortYearCutoffTemp=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,shortYearCutoff=(typeof shortYearCutoffTemp!=="string"?shortYearCutoffTemp:new Date().getFullYear()%100+parseInt(shortYearCutoffTemp,10)),dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,doy=-1,literal=false,date,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;} 3390return matches;},getNumber=function(match){var isDoubled=lookAhead(match),size=(match==="@"?14:(match==="!"?20:(match==="y"&&isDoubled?4:(match==="o"?3:2)))),minSize=(match==="y"?size:1),digits=new RegExp("^\\d{"+minSize+","+size+"}"),num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue;} 3391iValue+=num[0].length;return parseInt(num[0],10);},getName=function(match,shortNames,longNames){var index=-1,names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]];}).sort(function(a,b){return-(a[1].length-b[1].length);});$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()===name.toLowerCase()){index=pair[0];iValue+=name.length;return false;}});if(index!==-1){return index+1;}else{throw"Unknown name at position "+iValue;}},checkLiteral=function(){if(value.charAt(iValue)!==format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;} 3392iValue++;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral();}else{literal=true;} 3393break;default:checkLiteral();}}} 3394if(iValue<value.length){extra=value.substr(iValue);if(!/^\s+/.test(extra)){throw"Extra/unparsed characters found in date: "+extra;}} 3395if(year===-1){year=new Date().getFullYear();}else if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+ 3396(year<=shortYearCutoff?0:-100);} 3397if(doy>-1){month=1;day=doy;do{dim=this._getDaysInMonth(year,month-1);if(day<=dim){break;} 3398month++;day-=dim;}while(true);} 3399date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day){throw"Invalid date";} 3400return date;},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+ 3401Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return"";} 3402var iFormat,dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;} 3403return matches;},formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num;}} 3404return num;},formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);},output="",literal=false;if(date){for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{output+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getFullYear()%100<10?"0":"")+date.getFullYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'";}else{literal=true;} 3405break;default:output+=format.charAt(iFormat);}}}} 3406return output;},_possibleChars:function(format){var iFormat,chars="",literal=false,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;} 3407return matches;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{chars+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'";}else{literal=true;} 3408break;default:chars+=format.charAt(iFormat);}}} 3409return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst,noDefault){if(inst.input.val()===inst.lastVal){return;} 3410var dateFormat=this._get(inst,"dateFormat"),dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;}catch(event){dates=(noDefault?"":dates);} 3411inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()));},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;},offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst));} 3412catch(e){} 3413var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date(),year=date.getFullYear(),month=date.getMonth(),day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;} 3414matches=pattern.exec(offset);} 3415return new Date(year,month,day);},newDate=(date==null||date===""?defaultDate:(typeof date==="string"?offsetString(date):(typeof date==="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()==="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0);} 3416return this._daylightSavingAdjust(newDate);},_daylightSavingAdjust:function(date){if(!date){return null;} 3417date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,noChange){var clear=!date,origMonth=inst.selectedMonth,origYear=inst.selectedYear,newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){this._notifyChange(inst);} 3418this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst));}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()==="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate;},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),id="#"+inst.id.replace(/\\\\/g,"\\");
vendor: 4,349 bytes, lines 3418-3422
3418inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M");},next:function(){$.datepicker._adjustDate(id,+stepMonths,"M");},hide:function(){$.datepicker._hideDatepicker();},today:function(){$.datepicker._gotoToday(id);},selectDay:function(){$.datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false;},selectMonth:function(){$.datepicker._selectMonthYear(id,this,"M");return false;},selectYear:function(){$.datepicker._selectMonthYear(id,this,"Y");return false;}};$(this).on(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")]);});},_generateHTML:function(inst){var maxDraw,prevText,prev,nextText,next,currentText,gotoDate,controls,buttonPanel,firstDay,showWeek,dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,daysInMonth,leadDays,curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,tempDate=new Date(),today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel"),hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext"),navigationAsDateFormat=this._get(inst,"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),showCurrentAtPos=this._get(inst,"showCurrentAtPos"),stepMonths=this._get(inst,"stepMonths"),isMultiMonth=(numMonths[0]!==1||numMonths[1]!==1),currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay))),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-showCurrentAtPos,drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;} 3419if(maxDate){maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}} 3420inst.drawMonth=drawMonth;inst.drawYear=drawYear;prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'"+" title='"+prevText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")+"'>"+prevText+"</span></a>":(hideIfNoPrevNext?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+prevText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")+"'>"+prevText+"</span></a>"));nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'"+" title='"+nextText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")+"'>"+nextText+"</span></a>":(hideIfNoPrevNext?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+nextText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")+"'>"+nextText+"</span></a>"));currentText=this._get(inst,"currentText");gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));controls=(!inst.inline?"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+ 3421this._get(inst,"closeText")+"</button>":"");buttonPanel=(showButtonPanel)?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(isRTL?controls:"")+ 3422(this._isInRange(inst,gotoDate)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'"+">"+currentText+"</button>
vendor: 11,198 bytes, lines 3422-3469
3422":"")+(isRTL?"":controls)+"</div>":"";firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);showWeek=this._get(inst,"showWeek");dayNames=this._get(inst,"dayNames");dayNamesMin=this._get(inst,"dayNamesMin");monthNames=this._get(inst,"monthNames");monthNamesShort=this._get(inst,"monthNamesShort");beforeShowDay=this._get(inst,"beforeShowDay");showOtherMonths=this._get(inst,"showOtherMonths");selectOtherMonths=this._get(inst,"selectOtherMonths");defaultDate=this._getDefaultDate(inst);html="";for(row=0;row<numMonths[0];row++){group="";this.maxRows=4;for(col=0;col<numMonths[1];col++){selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));cornerClass=" ui-corner-all";calender="";if(isMultiMonth){calender+="<div class='ui-datepicker-group";if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break;}} 3423calender+="'>";} 3424calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+ 3425(/all|left/.test(cornerClass)&&row===0?(isRTL?next:prev):"")+ 3426(/all|right/.test(cornerClass)&&row===0?(isRTL?prev:next):"")+ 3427this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";thead=(showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"");for(dow=0;dow<7;dow++){day=(dow+firstDay)%7;thead+="<th scope='col'"+((dow+firstDay+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+dayNames[day]+"'>"+dayNamesMin[day]+"</span></th>";} 3428calender+=thead+"</tr></thead><tbody>";daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);} 3429leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;curRows=Math.ceil((leadDays+daysInMonth)/7);numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(dRow=0;dRow<numRows;dRow++){calender+="<tr>";tbody=(!showWeek?"":"<td class='ui-datepicker-week-col'>"+ 3430this._get(inst,"calculateWeek")(printDate)+"</td>");for(dow=0;dow<7;dow++){daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);otherMonth=(printDate.getMonth()!==drawMonth);unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+="<td class='"+ 3431((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+ 3432(otherMonth?" ui-datepicker-other-month":"")+ 3433((printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime())?" "+this._dayOverClass:"")+ 3434(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+ 3435(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+ 3436(printDate.getTime()===currentDate.getTime()?" "+this._currentClass:"")+ 3437(printDate.getTime()===today.getTime()?" ui-datepicker-today":""))+"'"+ 3438((!otherMonth||showOtherMonths)&&daySettings[2]?" title='"+daySettings[2].replace(/'/g,"'")+"'":"")+ 3439(unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth()+"' data-year='"+printDate.getFullYear()+"'")+">"+ 3440(otherMonth&&!showOtherMonths?" ":(unselectable?"<span class='ui-state-default'>"+printDate.getDate()+"</span>":"<a class='ui-state-default"+ 3441(printDate.getTime()===today.getTime()?" ui-state-highlight":"")+ 3442(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+ 3443(otherMonth?" ui-priority-secondary":"")+"' href='#'>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);} 3444calender+=tbody+"</tr>";} 3445drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;} 3446calender+="</tbody></table>"+(isMultiMonth?"</div>"+ 3447((numMonths[0]>0&&col===numMonths[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");group+=calender;} 3448html+=group;} 3449html+=buttonPanel;inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var inMinYear,inMaxYear,month,years,thisYear,determineYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth){monthHtml+="<span class='ui-datepicker-month'>"+monthNames[drawMonth]+"</span>";}else{inMinYear=(minDate&&minDate.getFullYear()===drawYear);inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear);monthHtml+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+="<option value='"+month+"'"+ 3450(month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>";}} 3451monthHtml+="</select>";} 3452if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?" ":"");} 3453if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+="<span class='ui-datepicker-year'>"+drawYear+"</span>";}else{years=this._get(inst,"yearRange").split(":");thisYear=new Date().getFullYear();determineYear=function(value){var year=(value.match(/c[+\-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+\-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year);};year=determineYear(years[0]);endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;year<=endYear;year++){inst.yearshtml+="<option value='"+year+"'"+ 3454(year===drawYear?" selected='selected'":"")+">"+year+"</option>";} 3455inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null;}} 3456html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?" ":"")+monthHtml;} 3457html+="</div>";return html;},_adjustInstDate:function(inst,offset,period){var year=inst.selectedYear+(period==="Y"?offset:0),month=inst.selectedMonth+(period==="M"?offset:0),day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period==="D"?offset:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period==="M"||period==="Y"){this._notifyChange(inst);}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),newDate=(minDate&&date<minDate?minDate:date);return(maxDate&&newDate>maxDate?maxDate:newDate);},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths==="number"?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null);},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst),date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));} 3458return this._isInRange(inst,date);},_isInRange:function(inst,date){var yearSplit,currentYear,minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),minYear=null,maxYear=null,years=this._get(inst,"yearRange");if(years){yearSplit=years.split(":");currentYear=new Date().getFullYear();minYear=parseInt(yearSplit[0],10);maxYear=parseInt(yearSplit[1],10);if(yearSplit[0].match(/[+\-].*/)){minYear+=currentYear;} 3459if(yearSplit[1].match(/[+\-].*/)){maxYear+=currentYear;}} 3460return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear()<=maxYear));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!=="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;} 3461var date=(day?(typeof day==="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst));}});function datepicker_bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.on("mouseout",selector,function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).removeClass("ui-datepicker-prev-hover");} 3462if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).removeClass("ui-datepicker-next-hover");}}).on("mouseover",selector,datepicker_handleMouseover);} 3463function datepicker_handleMouseover(){if(!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline?datepicker_instActive.dpDiv.parent()[0]:datepicker_instActive.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).addClass("ui-datepicker-prev-hover");} 3464if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).addClass("ui-datepicker-next-hover");}}} 3465function datepicker_extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=props[name];}} 3466return target;} 3467$.fn.datepicker=function(options){if(!this.length){return this;} 3468if(!$.datepicker.initialized){$(document).on("mousedown",$.datepicker._checkExternalClick);$.datepicker.initialized=true;} 3469if($("#"+$.datepicker._mainDivId).length===0){$("body").append($.datepicker.dpDiv);}
vendor: 10,916 bytes, lines 3470-3502
3470var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));} 3471if(options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));} 3472return this.each(function(){typeof options==="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options);});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.12.1";var widgetsDatepicker=$.datepicker;$.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var title=$(this).attr("title")||"";return $("<a>").text(title).html();},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,track:false,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id);elem.data("ui-tooltip-id",id).attr("aria-describedby",$.trim(describedby.join(" ")));},_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);if(index!==-1){describedby.splice(index,1);} 3473elem.removeData("ui-tooltip-id");describedby=$.trim(describedby.join(" "));if(describedby){elem.attr("aria-describedby",describedby);}else{elem.removeAttr("aria-describedby");}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.liveRegion=$("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=$([]);},_setOption:function(key,value){var that=this;this._super(key,value);if(key==="content"){$.each(this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element);});}},_setOptionDisabled:function(value){this[value?"_disable":"_enable"]();},_disable:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");event.target=event.currentTarget=tooltipData.element[0];that.close(event,true);});this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var element=$(this);if(element.is("[title]")){return element.data("ui-tooltip-title",element.attr("title")).removeAttr("title");}}));},_enable:function(){this.disabledTitles.each(function(){var element=$(this);if(element.data("ui-tooltip-title")){element.attr("title",element.data("ui-tooltip-title"));}});this.disabledTitles=$([]);},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);if(!target.length||target.data("ui-tooltip-id")){return;} 3474if(target.attr("title")){target.data("ui-tooltip-title",target.attr("title"));} 3475target.data("ui-tooltip-open",true);if(event&&event.type==="mouseover"){target.parents().each(function(){var parent=$(this),blurEvent;if(parent.data("ui-tooltip-open")){blurEvent=$.Event("blur");blurEvent.target=blurEvent.currentTarget=this;that.close(blurEvent,true);} 3476if(parent.attr("title")){parent.uniqueId();that.parents[this.id]={element:this,title:parent.attr("title")};parent.attr("title","");}});} 3477this._registerCloseHandlers(event,target);this._updateContent(target,event);},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;if(typeof contentOption==="string"||contentOption.nodeType||contentOption.jquery){return this._open(event,target,contentOption);} 3478content=contentOption.call(target[0],function(response){that._delay(function(){if(!target.data("ui-tooltip-open")){return;} 3479if(event){event.type=eventType;} 3480this._open(event,target,response);});});if(content){this._open(event,target,content);}},_open:function(event,target,content){var tooltipData,tooltip,delayedShow,a11yContent,positionOption=$.extend({},this.options.position);if(!content){return;} 3481tooltipData=this._find(target);if(tooltipData){tooltipData.tooltip.find(".ui-tooltip-content").html(content);return;} 3482if(target.is("[title]")){if(event&&event.type==="mouseover"){target.attr("title","");}else{target.removeAttr("title");}} 3483tooltipData=this._tooltip(target);tooltip=tooltipData.tooltip;this._addDescribedBy(target,tooltip.attr("id"));tooltip.find(".ui-tooltip-content").html(content);this.liveRegion.children().hide();a11yContent=$("<div>").html(tooltip.find(".ui-tooltip-content").html());a11yContent.removeAttr("name").find("[name]").removeAttr("name");a11yContent.removeAttr("id").find("[id]").removeAttr("id");a11yContent.appendTo(this.liveRegion);function position(event){positionOption.of=event;if(tooltip.is(":hidden")){return;} 3484tooltip.position(positionOption);} 3485if(this.options.track&&event&&/^mouse/.test(event.type)){this._on(this.document,{mousemove:position});position(event);}else{tooltip.position($.extend({of:target},this.options.position));} 3486tooltip.hide();this._show(tooltip,this.options.show);if(this.options.track&&this.options.show&&this.options.show.delay){delayedShow=this.delayedShow=setInterval(function(){if(tooltip.is(":visible")){position(positionOption.of);clearInterval(delayedShow);}},$.fx.interval);} 3487this._trigger("open",event,{tooltip:tooltip});},_registerCloseHandlers:function(event,target){var events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0];this.close(fakeEvent,true);}}};if(target[0]!==this.element[0]){events.remove=function(){this._removeTooltip(this._find(target).tooltip);};} 3488if(!event||event.type==="mouseover"){events.mouseleave="close";} 3489if(!event||event.type==="focusin"){events.focusout="close";} 3490this._on(true,target,events);},close:function(event){var tooltip,that=this,target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);if(!tooltipData){target.removeData("ui-tooltip-open");return;} 3491tooltip=tooltipData.tooltip;if(tooltipData.closing){return;} 3492clearInterval(this.delayedShow);if(target.data("ui-tooltip-title")&&!target.attr("title")){target.attr("title",target.data("ui-tooltip-title"));} 3493this._removeDescribedBy(target);tooltipData.hiding=true;tooltip.stop(true);this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this));});target.removeData("ui-tooltip-open");this._off(target,"mouseleave focusout keyup");if(target[0]!==this.element[0]){this._off(target,"remove");} 3494this._off(this.document,"mousemove");if(event&&event.type==="mouseleave"){$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title);delete that.parents[id];});} 3495tooltipData.closing=true;this._trigger("close",event,{tooltip:tooltip});if(!tooltipData.hiding){tooltipData.closing=false;}},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip"),content=$("<div>").appendTo(tooltip),id=tooltip.uniqueId().attr("id");this._addClass(content,"ui-tooltip-content");this._addClass(tooltip,"ui-tooltip","ui-widget ui-widget-content");tooltip.appendTo(this._appendTo(element));return this.tooltips[id]={element:element,tooltip:tooltip};},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null;},_removeTooltip:function(tooltip){tooltip.remove();delete this.tooltips[tooltip.attr("id")];},_appendTo:function(target){var element=target.closest(".ui-front, dialog");if(!element.length){element=this.document[0].body;} 3496return element;},_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur"),element=tooltipData.element;event.target=event.currentTarget=element[0];that.close(event,true);$("#"+id).remove();if(element.data("ui-tooltip-title")){if(!element.attr("title")){element.attr("title",element.data("ui-tooltip-title"));} 3497element.removeData("ui-tooltip-title");}});this.liveRegion.remove();}});if($.uiBackCompat!==false){$.widget("ui.tooltip",$.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var tooltipData=this._superApply(arguments);if(this.options.tooltipClass){tooltipData.tooltip.addClass(this.options.tooltipClass);} 3498return tooltipData;}});} 3499var widgetsTooltip=$.ui.tooltip;var dataSpace="ui-effects-",dataSpaceStyle="ui-effects-style",dataSpaceAnimated="ui-effects-animated",jQuery=$;$.effects={effect:{}};(function(jQuery,undefined){var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor "+"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]];}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1]*2.55,execResult[2]*2.55,execResult[3]*2.55,execResult[4]];}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16)];}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16)];}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]];}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha);},spaces={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={"byte":{floor:true,max:255},"percent":{max:1},"degrees":{mod:360,floor:true}},support=color.support={},supportElem=jQuery("<p>")[0],colors,each=jQuery.each;supportElem.style.cssText="background-color:rgba(1,1,1,.5)";support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1;each(spaces,function(spaceName,space){space.cache="_"+spaceName;space.props.alpha={idx:3,type:"percent",def:1};});function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){return(allowEmpty||!prop.def)?null:prop.def;} 3500value=type.floor?~~value:parseFloat(value);if(isNaN(value)){return prop.def;} 3501if(type.mod){return(value+type.mod)%type.mod;} 3502return 0>value?0:type.max<value?type.max:value;}
vendor: 6,007 bytes, lines 3503-3539
3503function stringParse(string){var inst=color(),rgba=inst._rgba=[];string=string.toLowerCase();each(stringParsers,function(i,parser){var parsed,match=parser.re.exec(string),values=match&&parser.parse(match),spaceName=parser.space||"rgba";if(values){parsed=inst[spaceName](values);inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache];rgba=inst._rgba=parsed._rgba;return false;}});if(rgba.length){if(rgba.join()==="0,0,0,0"){jQuery.extend(rgba,colors.transparent);} 3504return inst;} 3505return colors[string];} 3506color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined){this._rgba=[null,null,null,null];return this;} 3507if(red.jquery||red.nodeType){red=jQuery(red).css(green);green=undefined;} 3508var inst=this,type=jQuery.type(red),rgba=this._rgba=[];if(green!==undefined){red=[red,green,blue,alpha];type="array";} 3509if(type==="string"){return this.parse(stringParse(red)||colors._default);} 3510if(type==="array"){each(spaces.rgba.props,function(key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop);});return this;} 3511if(type==="object"){if(red instanceof color){each(spaces,function(spaceName,space){if(red[space.cache]){inst[space.cache]=red[space.cache].slice();}});}else{each(spaces,function(spaceName,space){var cache=space.cache;each(space.props,function(key,prop){if(!inst[cache]&&space.to){if(key==="alpha"||red[key]==null){return;} 3512inst[cache]=space.to(inst._rgba);} 3513inst[cache][prop.idx]=clamp(red[key],prop,true);});if(inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0){inst[cache][3]=1;if(space.from){inst._rgba=space.from(inst[cache]);}}});} 3514return this;}},is:function(compare){var is=color(compare),same=true,inst=this;each(spaces,function(_,space){var localCache,isCache=is[space.cache];if(isCache){localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[];each(space.props,function(_,prop){if(isCache[prop.idx]!=null){same=(isCache[prop.idx]===localCache[prop.idx]);return same;}});} 3515return same;});return same;},_space:function(){var used=[],inst=this;each(spaces,function(spaceName,space){if(inst[space.cache]){used.push(spaceName);}});return used.pop();},transition:function(other,distance){var end=color(other),spaceName=end._space(),space=spaces[spaceName],startColor=this.alpha()===0?color("transparent"):this,start=startColor[space.cache]||space.to(startColor._rgba),result=start.slice();end=end[space.cache];each(space.props,function(key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type]||{};if(endValue===null){return;} 3516if(startValue===null){result[index]=endValue;}else{if(type.mod){if(endValue-startValue>type.mod/2){startValue+=type.mod;}else if(startValue-endValue>type.mod/2){startValue-=type.mod;}} 3517result[index]=clamp((endValue-startValue)*distance+startValue,prop);}});return this[spaceName](result);},blend:function(opaque){if(this._rgba[3]===1){return this;} 3518var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v;}));},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){return v==null?(i>2?1:0):v;});if(rgba[3]===1){rgba.pop();prefix="rgb(";} 3519return prefix+rgba.join()+")";},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0;} 3520if(i&&i<3){v=Math.round(v*100)+"%";} 3521return v;});if(hsla[3]===1){hsla.pop();prefix="hsl(";} 3522return prefix+hsla.join()+")";},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){rgba.push(~~(alpha*255));} 3523return"#"+jQuery.map(rgba,function(v){v=(v||0).toString(16);return v.length===1?"0"+v:v;}).join("");},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString();}});color.fn.parse.prototype=color.fn;function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;} 3524if(h*2<1){return q;} 3525if(h*3<2){return p+(q-p)*((2/3)-h)*6;} 3526return p;} 3527spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,null,null,rgba[3]];} 3528var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=add*0.5,h,s;if(min===max){h=0;}else if(r===max){h=(60*(g-b)/diff)+360;}else if(g===max){h=(60*(b-r)/diff)+120;}else{h=(60*(r-g)/diff)+240;} 3529if(diff===0){s=0;}else if(l<=0.5){s=diff/add;}else{s=diff/(2-add);} 3530return[Math.round(h)%360,s,l,a==null?1:a];};spaces.hsla.from=function(hsla){if(hsla[0]==null||hsla[1]==null||hsla[2]==null){return[null,null,null,hsla[3]];} 3531var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=l<=0.5?l*(1+s):l+s-l*s,p=2*l-q;return[Math.round(hue2rgb(p,q,h+(1/3))*255),Math.round(hue2rgb(p,q,h)*255),Math.round(hue2rgb(p,q,h-(1/3))*255),a];};each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]){this[cache]=to(this._rgba);} 3532if(value===undefined){return this[cache].slice();} 3533var ret,type=jQuery.type(value),arr=(type==="array"||type==="object")?value:arguments,local=this[cache].slice();each(props,function(key,prop){var val=arr[type==="object"?key:prop.idx];if(val==null){val=local[prop.idx];} 3534local[prop.idx]=clamp(val,prop);});if(from){ret=color(from(local));ret[cache]=local;return ret;}else{return color(local);}};each(props,function(key,prop){if(color.fn[key]){return;} 3535color.fn[key]=function(value){var vtype=jQuery.type(value),fn=(key==="alpha"?(this._hsla?"hsla":"rgba"):spaceName),local=this[fn](),cur=local[prop.idx],match;if(vtype==="undefined"){return cur;} 3536if(vtype==="function"){value=value.call(this,cur);vtype=jQuery.type(value);} 3537if(value==null&&prop.empty){return this;} 3538if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[2])*(match[1]==="+"?1:-1);}} 3539local[prop.idx]=value;return this[fn](local);};});});color.hook=function(hook){var hooks=hook.split(" ");each(hooks,function(i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";
vendor: 12,845 bytes, lines 3539-3584
3539if(value!=="transparent"&&(jQuery.type(value)!=="string"||(parsed=stringParse(value)))){value=color(parsed||value);if(!support.rgba&&value._rgba[3]!==1){curElem=hook==="backgroundColor"?elem.parentNode:elem;while((backgroundColor===""||backgroundColor==="transparent")&&curElem&&curElem.style){try{backgroundColor=jQuery.css(curElem,"backgroundColor");curElem=curElem.parentNode;}catch(e){}} 3540value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default");} 3541value=value.toRgbaString();} 3542try{elem.style[hook]=value;}catch(e){}}};jQuery.fx.step[hook]=function(fx){if(!fx.colorInit){fx.start=color(fx.elem,hook);fx.end=color(fx.end);fx.colorInit=true;} 3543jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos));};});};color.hook(stepHooks);jQuery.cssHooks.borderColor={expand:function(value){var expanded={};each(["Top","Right","Bottom","Left"],function(i,part){expanded["border"+part+"Color"]=value;});return expanded;}};colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"};})(jQuery);(function(){var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){jQuery.style(fx.elem,prop,fx.end);fx.setAttr=true;}};});function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]]){len=style.length;while(len--){key=style[len];if(typeof style[key]==="string"){styles[$.camelCase(key)]=style[key];}}}else{for(key in style){if(typeof style[key]==="string"){styles[key]=style[key];}}} 3544return styles;} 3545function styleDifference(oldStyle,newStyle){var diff={},name,value;for(name in newStyle){value=newStyle[name];if(oldStyle[name]!==value){if(!shorthandStyles[name]){if($.fx.step[name]||!isNaN(parseFloat(value))){diff[name]=value;}}}} 3546return diff;} 3547if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};} 3548$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var animated=$(this),baseClass=animated.attr("class")||"",applyClassChange,allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(function(){var el=$(this);return{el:el,start:getElementStyles(this)};});applyClassChange=function(){$.each(classAnimationActions,function(i,action){if(value[action]){animated[action+"Class"](value[action]);}});};applyClassChange();allAnimations=allAnimations.map(function(){this.end=getElementStyles(this.el[0]);this.diff=styleDifference(this.start,this.end);return this;});animated.attr("class",baseClass);allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:false,complete:function(){dfd.resolve(styleInfo);}});this.el.animate(this.diff,opts);return dfd.promise();});$.when.apply($,allAnimations.get()).done(function(){applyClassChange();$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"");});});o.complete.call(animated[0]);});});};$.fn.extend({addClass:(function(orig){return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.addClass),removeClass:(function(orig){return function(classNames,speed,easing,callback){return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.removeClass),toggleClass:(function(orig){return function(classNames,force,speed,easing,callback){if(typeof force==="boolean"||force===undefined){if(!speed){return orig.apply(this,arguments);}else{return $.effects.animateClass.call(this,(force?{add:classNames}:{remove:classNames}),speed,easing,callback);}}else{return $.effects.animateClass.call(this,{toggle:classNames},force,speed,easing);}};})($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback);}});})();(function(){if($.expr&&$.expr.filters&&$.expr.filters.animated){$.expr.filters.animated=(function(orig){return function(elem){return!!$(elem).data(dataSpaceAnimated)||orig(elem);};})($.expr.filters.animated);} 3549if($.uiBackCompat!==false){$.extend($.effects,{save:function(element,set){var i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){element.data(dataSpace+set[i],element[0].style[set[i]]);}}},restore:function(element,set){var val,i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){val=element.data(dataSpace+set[i]);element.css(set[i],val);}}},setMode:function(el,mode){if(mode==="toggle"){mode=el.is(":hidden")?"show":"hide";} 3550return mode;},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent();} 3551var props={width:element.outerWidth(true),height:element.outerHeight(true),"float":element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id;}catch(e){active=document.body;} 3552element.wrap(wrapper);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus");} 3553wrapper=element.parent();if(element.css("position")==="static"){wrapper.css({position:"relative"});element.css({position:"relative"});}else{$.extend(props,{position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos]="auto";}});element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"});} 3554element.css(size);return wrapper.css(props).show();},removeWrapper:function(element){var active=document.activeElement;if(element.parent().is(".ui-effects-wrapper")){element.parent().replaceWith(element);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus");}} 3555return element;}});} 3556$.extend($.effects,{version:"1.12.1",define:function(name,mode,effect){if(!effect){effect=mode;mode="effect";} 3557$.effects.effect[name]=effect;$.effects.effect[name].mode=mode;return effect;},scaledDimensions:function(element,percent,direction){if(percent===0){return{height:0,width:0,outerHeight:0,outerWidth:0};} 3558var x=direction!=="horizontal"?((percent||100)/100):1,y=direction!=="vertical"?((percent||100)/100):1;return{height:element.height()*y,width:element.width()*x,outerHeight:element.outerHeight()*y,outerWidth:element.outerWidth()*x};},clipToBox:function(animation){return{width:animation.clip.right-animation.clip.left,height:animation.clip.bottom-animation.clip.top,left:animation.clip.left,top:animation.clip.top};},unshift:function(element,queueLength,count){var queue=element.queue();if(queueLength>1){queue.splice.apply(queue,[1,0].concat(queue.splice(queueLength,count)));} 3559element.dequeue();},saveStyle:function(element){element.data(dataSpaceStyle,element[0].style.cssText);},restoreStyle:function(element){element[0].style.cssText=element.data(dataSpaceStyle)||"";element.removeData(dataSpaceStyle);},mode:function(element,mode){var hidden=element.is(":hidden");if(mode==="toggle"){mode=hidden?"show":"hide";} 3560if(hidden?mode==="hide":mode==="show"){mode="none";} 3561return mode;},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;case"middle":y=0.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height;} 3562switch(origin[1]){case"left":x=0;break;case"center":x=0.5;break;case"right":x=1;break;default:x=origin[1]/original.width;} 3563return{x:x,y:y};},createPlaceholder:function(element){var placeholder,cssPosition=element.css("position"),position=element.position();element.css({marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());if(/^(static|relative)/.test(cssPosition)){cssPosition="absolute";placeholder=$("<"+element[0].nodeName+">").insertAfter(element).css({display:/^(inline|ruby)/.test(element.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight"),"float":element.css("float")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass("ui-effects-placeholder");element.data(dataSpace+"placeholder",placeholder);} 3564element.css({position:cssPosition,left:position.left,top:position.top});return placeholder;},removePlaceholder:function(element){var dataKey=dataSpace+"placeholder",placeholder=element.data(dataKey);if(placeholder){placeholder.remove();element.removeData(dataKey);}},cleanUp:function(element){$.effects.restoreStyle(element);$.effects.removePlaceholder(element);},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){var unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0]*factor+unit[1];}});return value;}});function _normalizeArguments(effect,options,speed,callback){if($.isPlainObject(effect)){options=effect;effect=effect.effect;} 3565effect={effect:effect};if(options==null){options={};} 3566if($.isFunction(options)){callback=options;speed=null;options={};} 3567if(typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={};} 3568if($.isFunction(speed)){callback=speed;speed=null;} 3569if(options){$.extend(effect,options);} 3570speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed==="number"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;} 3571function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){return true;} 3572if(typeof option==="string"&&!$.effects.effect[option]){return true;} 3573if($.isFunction(option)){return true;} 3574if(typeof option==="object"&&!option.effect){return true;} 3575return false;} 3576$.fn.extend({effect:function(){var args=_normalizeArguments.apply(this,arguments),effectMethod=$.effects.effect[args.effect],defaultMode=effectMethod.mode,queue=args.queue,queueName=queue||"fx",complete=args.complete,mode=args.mode,modes=[],prefilter=function(next){var el=$(this),normalizedMode=$.effects.mode(el,mode)||defaultMode;el.data(dataSpaceAnimated,true);modes.push(normalizedMode);if(defaultMode&&(normalizedMode==="show"||(normalizedMode===defaultMode&&normalizedMode==="hide"))){el.show();} 3577if(!defaultMode||normalizedMode!=="none"){$.effects.saveStyle(el);} 3578if($.isFunction(next)){next();}};if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,complete);}else{return this.each(function(){if(complete){complete.call(this);}});}} 3579function run(next){var elem=$(this);function cleanup(){elem.removeData(dataSpaceAnimated);$.effects.cleanUp(elem);if(args.mode==="hide"){elem.hide();} 3580done();} 3581function done(){if($.isFunction(complete)){complete.call(elem[0]);} 3582if($.isFunction(next)){next();}} 3583args.mode=modes.shift();if($.uiBackCompat!==false&&!defaultMode){if(elem.is(":hidden")?mode==="hide":mode==="show"){elem[mode]();done();}else{effectMethod.call(elem[0],args,done);}}else{if(args.mode==="none"){elem[mode]();done();}else{effectMethod.call(elem[0],args,cleanup);}}} 3584return queue===false?this.each(prefilter).each(run):this.queue(queueName,prefilter).queue(queueName,run);},show:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="show";return this.effect.call(this,args);}};})($.fn.show),hide:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="hide";return this.effect.call(this,args);}};})($.fn.hide),toggle:(function(orig){return function(option){if(standardAnimationOption(option)||typeof option==="boolean"){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="toggle";return this.effect.call(this,args);}};}
vendor: 3,918 bytes, lines 3584-3594
3584)($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%","pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit];}});return val;},cssClip:function(clipObj){if(clipObj){return this.css("clip","rect("+clipObj.top+"px "+clipObj.right+"px "+ 3585clipObj.bottom+"px "+clipObj.left+"px)");} 3586return parseClip(this.css("clip"),this);},transfer:function(options,done){var element=$(this),target=$(options.to),targetFixed=target.css("position")==="fixed",body=$("body"),fixTop=targetFixed?body.scrollTop():0,fixLeft=targetFixed?body.scrollLeft():0,endPosition=target.offset(),animation={top:endPosition.top-fixTop,left:endPosition.left-fixLeft,height:target.innerHeight(),width:target.innerWidth()},startPosition=element.offset(),transfer=$("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(options.className).css({top:startPosition.top-fixTop,left:startPosition.left-fixLeft,height:element.innerHeight(),width:element.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(animation,options.duration,options.easing,function(){transfer.remove();if($.isFunction(done)){done();}});}});function parseClip(str,element){var outerWidth=element.outerWidth(),outerHeight=element.outerHeight(),clipRegex=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,values=clipRegex.exec(str)||["",0,outerWidth,outerHeight,0];return{top:parseFloat(values[1])||0,right:values[2]==="auto"?outerWidth:parseFloat(values[2]),bottom:values[3]==="auto"?outerHeight:parseFloat(values[3]),left:parseFloat(values[4])||0};} 3587$.fx.step.clip=function(fx){if(!fx.clipInit){fx.start=$(fx.elem).cssClip();if(typeof fx.end==="string"){fx.end=parseClip(fx.end,fx.elem);} 3588fx.clipInit=true;} 3589$(fx.elem).cssClip({top:fx.pos*(fx.end.top-fx.start.top)+fx.start.top,right:fx.pos*(fx.end.right-fx.start.right)+fx.start.right,bottom:fx.pos*(fx.end.bottom-fx.start.bottom)+fx.start.bottom,left:fx.pos*(fx.end.left-fx.start.left)+fx.start.left});};})();(function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2);};});$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2);},Circ:function(p){return 1-Math.sqrt(1-p*p);},Elastic:function(p){return p===0||p===1?p:-Math.pow(2,8*(p-1))*Math.sin(((p-1)*80-7.5)*Math.PI/15);},Back:function(p){return p*p*(3*p-2);},Bounce:function(p){var pow2,bounce=4;while(p<((pow2=Math.pow(2,--bounce))-1)/11){} 3590return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((pow2*3-2)/22-p,2);}});$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn;$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p);};$.easing["easeInOut"+name]=function(p){return p<0.5?easeIn(p*2)/2:1-easeIn(p*-2+2)/2;};});})();var effect=$.effects;var effectsEffectBounce=$.effects.define("bounce",function(options,done){var upAnim,downAnim,refValue,element=$(this),mode=options.mode,hide=mode==="hide",show=mode==="show",direction=options.direction||"up",distance=options.distance,times=options.times||5,anims=times*2+(show||hide?1:0),speed=options.duration/anims,easing=options.easing,ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left"),i=0,queuelen=element.queue().length;$.effects.createPlaceholder(element);refValue=element.css(ref);if(!distance){distance=element[ref==="top"?"outerHeight":"outerWidth"]()/3;} 3591if(show){downAnim={opacity:1};downAnim[ref]=refValue;element.css("opacity",0).css(ref,motion?-distance*2:distance*2).animate(downAnim,speed,easing);} 3592if(hide){distance=distance/Math.pow(2,times-1);} 3593downAnim={};downAnim[ref]=refValue;for(;i<times;i++){upAnim={};upAnim[ref]=(motion?"-=":"+=")+distance;element.animate(upAnim,speed,easing).animate(downAnim,speed,easing);distance=hide?distance*2:distance/2;} 3594if(hide){upAnim={opacity:0}
vendor: 11,735 bytes, lines 3594-3686
3594;upAnim[ref]=(motion?"-=":"+=")+distance;element.animate(upAnim,speed,easing);} 3595element.queue(done);$.effects.unshift(element,queuelen,anims+1);});}));; 3596 3597/* /web/static/lib/jquery/jquery.browser.js */ 3598(function(){$.uaMatch=function(ua){var ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};};if(!$.browser){var matched=$.uaMatch(navigator.userAgent);var browser={};if(matched.browser){browser[matched.browser]=true;browser.version=matched.version;} 3599if(browser.chrome){browser.webkit=true;}else if(browser.webkit){browser.safari=true;} 3600$.browser=browser;}})();; 3601 3602/* /web/static/lib/jquery.blockUI/jquery.blockUI.js */ 3603;(function(){"use strict";function setup($){$.fn._fadeIn=$.fn.fadeIn;var noOp=$.noop||function(){};var msie=/MSIE/.test(navigator.userAgent);var ie6=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent);var mode=document.documentMode||0;var setExpr=$.isFunction(document.createElement('div').style.setExpression);$.blockUI=function(opts){install(window,opts);};$.unblockUI=function(opts){remove(window,opts);};$.growlUI=function(title,message,timeout,onClose){var $m=$('<div class="growlUI"></div>');if(title)$m.append('<h1>'+title+'</h1>');if(message)$m.append('<h2>'+message+'</h2>');if(timeout===undefined)timeout=3000;var callBlock=function(opts){opts=opts||{};$.blockUI({message:$m,fadeIn:typeof opts.fadeIn!=='undefined'?opts.fadeIn:700,fadeOut:typeof opts.fadeOut!=='undefined'?opts.fadeOut:1000,timeout:typeof opts.timeout!=='undefined'?opts.timeout:timeout,centerY:false,showOverlay:false,onUnblock:onClose,css:$.blockUI.defaults.growlCSS});};callBlock();var nonmousedOpacity=$m.css('opacity');$m.mouseover(function(){callBlock({fadeIn:0,timeout:30000});var displayBlock=$('.blockMsg');displayBlock.stop();displayBlock.fadeTo(300,1);}).mouseout(function(){$('.blockMsg').fadeOut(1000);});};$.fn.block=function(opts){if(this[0]===window){$.blockUI(opts);return this;} 3604var fullOpts=$.extend({},$.blockUI.defaults,opts||{});this.each(function(){var $el=$(this);if(fullOpts.ignoreIfBlocked&&$el.data('blockUI.isBlocked')) 3605return;$el.unblock({fadeOut:0});});return this.each(function(){if($.css(this,'position')=='static'){this.style.position='relative';$(this).data('blockUI.static',true);} 3606this.style.zoom=1;install(this,opts);});};$.fn.unblock=function(opts){if(this[0]===window){$.unblockUI(opts);return this;} 3607return this.each(function(){remove(this,opts);});};$.blockUI.version=2.70;$.blockUI.defaults={message:'<h1>Please wait...</h1>',title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:'30%',top:'40%',left:'35%',textAlign:'center',color:'#000',border:'3px solid #aaa',backgroundColor:'#fff',cursor:'wait'},themedCSS:{width:'30%',top:'40%',left:'35%'},overlayCSS:{backgroundColor:'#000',opacity:0.6,cursor:'wait'},cursorReset:'default',growlCSS:{width:'350px',top:'10px',left:'',right:'10px',border:'none',padding:'5px',opacity:0.6,cursor:'default',color:'#fff',backgroundColor:'#000','-webkit-border-radius':'10px','-moz-border-radius':'10px','border-radius':'10px'},iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank',forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,focusableElements:':input:enabled:visible',onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:'blockMsg',ignoreIfBlocked:false};var pageBlock=null;var pageBlockEls=[];function install(el,opts){var css,themedCSS;var full=(el==window);var msg=(opts&&opts.message!==undefined?opts.message:undefined);opts=$.extend({},$.blockUI.defaults,opts||{});if(opts.ignoreIfBlocked&&$(el).data('blockUI.isBlocked')) 3608return;opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{});css=$.extend({},$.blockUI.defaults.css,opts.css||{});if(opts.onOverlayClick) 3609opts.overlayCSS.cursor='pointer';themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{});msg=msg===undefined?opts.message:msg;if(full&&pageBlock) 3610remove(window,{fadeOut:0});if(msg&&typeof msg!='string'&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg;var data={};$(el).data('blockUI.history',data);data.el=node;data.parent=node.parentNode;data.display=node.style.display;data.position=node.style.position;if(data.parent) 3611data.parent.removeChild(node);} 3612$(el).data('blockUI.onUnblock',opts.onUnblock);var z=opts.baseZ;var lyr1,lyr2,lyr3,s;if(msie||opts.forceIframe) 3613lyr1=$('<iframe class="blockUI" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');else 3614lyr1=$('<div class="blockUI" style="display:none"></div>');if(opts.theme) 3615lyr2=$('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+(z++)+';display:none"></div>');else 3616lyr2=$('<div class="blockUI blockOverlay" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');if(opts.theme&&full){s='<div class="blockUI '+opts.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';if(opts.title){s+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title||' ')+'</div>';} 3617s+='<div class="ui-widget-content ui-dialog-content"></div>';s+='</div>';} 3618else if(opts.theme){s='<div class="blockUI '+opts.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';if(opts.title){s+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title||' ')+'</div>';} 3619s+='<div class="ui-widget-content ui-dialog-content"></div>';s+='</div>';} 3620else if(full){s='<div class="blockUI '+opts.blockMsgClass+' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';} 3621else{s='<div class="blockUI '+opts.blockMsgClass+' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';} 3622lyr3=$(s);if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass('ui-widget-content');} 3623else 3624lyr3.css(css);} 3625if(!opts.theme) 3626lyr2.css(opts.overlayCSS);lyr2.css('position',full?'fixed':'absolute');if(msie||opts.forceIframe) 3627lyr1.css('opacity',0.0);var layers=[lyr1,lyr2,lyr3],$par=full?$('body'):$(el);$.each(layers,function(){this.appendTo($par);});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:'.ui-dialog-titlebar',cancel:'li'});} 3628var expr=setExpr&&(!$.support.boxModel||$('object,embed',full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.support.boxModel) 3629$('html,body').css('height','100%');if((ie6||!$.support.boxModel)&&!full){var t=sz(el,'borderTopWidth'),l=sz(el,'borderLeftWidth');var fixT=t?'(0 - '+t+')':0;var fixL=l?'(0 - '+l+')':0;} 3630$.each(layers,function(i,o){var s=o[0].style;s.position='absolute';if(i<2){if(full) 3631s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');else 3632s.setExpression('height','this.parentNode.offsetHeight + "px"');if(full) 3633s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');else 3634s.setExpression('width','this.parentNode.offsetWidth + "px"');if(fixL)s.setExpression('left',fixL);if(fixT)s.setExpression('top',fixT);} 3635else if(opts.centerY){if(full)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0;} 3636else if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top,10):0;var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';s.setExpression('top',expression);}});} 3637if(msg){if(opts.theme) 3638lyr3.find('.ui-widget-content').append(msg);else 3639lyr3.append(msg);if(msg.jquery||msg.nodeType) 3640$(msg).show();} 3641if((msie||opts.forceIframe)&&opts.showOverlay) 3642lyr1.show();if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay) 3643lyr2._fadeIn(opts.fadeIn,cb1);if(msg) 3644lyr3._fadeIn(opts.fadeIn,cb2);} 3645else{if(opts.showOverlay) 3646lyr2.show();if(msg) 3647lyr3.show();if(opts.onBlock) 3648opts.onBlock.bind(lyr3)();} 3649bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(opts.focusableElements,pageBlock);if(opts.focusInput) 3650setTimeout(focus,20);} 3651else 3652center(lyr3[0],opts.centerX,opts.centerY);if(opts.timeout){var to=setTimeout(function(){if(full) 3653$.unblockUI(opts);else 3654$(el).unblock(opts);},opts.timeout);$(el).data('blockUI.timeout',to);}} 3655function remove(el,opts){var count;var full=(el==window);var $el=$(el);var data=$el.data('blockUI.history');var to=$el.data('blockUI.timeout');if(to){clearTimeout(to);$el.removeData('blockUI.timeout');} 3656opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);if(opts.onUnblock===null){opts.onUnblock=$el.data('blockUI.onUnblock');$el.removeData('blockUI.onUnblock');} 3657var els;if(full) 3658els=$('body').children().filter('.blockUI').add('body > .blockUI');else 3659els=$el.find('>.blockUI');if(opts.cursorReset){if(els.length>1) 3660els[1].style.cursor=opts.cursorReset;if(els.length>2) 3661els[2].style.cursor=opts.cursorReset;} 3662if(full) 3663pageBlock=pageBlockEls=null;if(opts.fadeOut){count=els.length;els.stop().fadeOut(opts.fadeOut,function(){if(--count===0) 3664reset(els,data,opts,el);});} 3665else 3666reset(els,data,opts,el);} 3667function reset(els,data,opts,el){var $el=$(el);if($el.data('blockUI.isBlocked')) 3668return;els.each(function(i,o){if(this.parentNode) 3669this.parentNode.removeChild(this);});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;data.el.style.cursor='default';if(data.parent) 3670data.parent.appendChild(data.el);$el.removeData('blockUI.history');} 3671if($el.data('blockUI.static')){$el.css('position','static');} 3672if(typeof opts.onUnblock=='function') 3673opts.onUnblock(el,opts);var body=$(document.body),w=body.width(),cssW=body[0].style.width;body.width(w-1).width(w);body[0].style.width=cssW;} 3674function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked'))) 3675return;$el.data('blockUI.isBlocked',b);if(!full||!opts.bindEvents||(b&&!opts.showOverlay)) 3676return;var events='mousedown mouseup keydown keypress keyup touchstart touchend touchmove';if(b) 3677$(document).bind(events,opts,handler);else 3678$(document).unbind(events,handler);} 3679function handler(e){if(e.type==='keydown'&&e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target===els[els.length-1];var back=e.shiftKey&&e.target===els[0];if(fwd||back){setTimeout(function(){focus(back);},10);return false;}}} 3680var opts=e.data;var target=$(e.target);if(target.hasClass('blockOverlay')&&opts.onOverlayClick) 3681opts.onOverlayClick(e);if(target.parents('div.'+opts.blockMsgClass).length>0) 3682return true;return target.parents().children().filter('div.blockUI').length===0;} 3683function focus(back){if(!pageBlockEls) 3684return;var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e) 3685e.focus();} 3686function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,'borderLeftWidth');var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,'borderTopWidth');
3686if(x)s.left=l>0?(l+'px'):'0';if(y)s.top=t>0?(t+'px'):'0';} 3687function sz(el,p){return parseInt($.css(el,p),10)||0;}} 3688if(typeof define==='function'&&define.amd&&define.amd.jQuery){define(['jquery'],setup);}else{setup(jQuery);}})();; 3689 3690/* /web/static/lib/jquery.hotkeys/jquery.hotkeys.js */ 3691(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return;} 3692var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text")){return;} 3693var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),key,modif="",possible={};if(event.altKey&&special!=="alt"){modif+="alt+";} 3694if(event.ctrlKey&&special!=="ctrl"){modif+="ctrl+";} 3695if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+";} 3696if(event.shiftKey&&special!=="shift"){modif+="shift+";} 3697if(special){possible[modif+special]=true;}else{possible[modif+character]=true;possible[modif+jQuery.hotkeys.shiftNums[character]]=true;if(modif==="shift+"){possible[jQuery.hotkeys.shiftNums[character]]=true;}} 3698for(var i=0,l=keys.length;i<l;i++){if(possible[keys[i]]){return origHandler.apply(this,arguments);}}};} 3699jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler};});})(jQuery);; 3700 3701/* /web/static/lib/jquery.placeholder/jquery.placeholder.js */ 3702;(function(window,document,$){var isInputSupported='placeholder'in document.createElement('input'),isTextareaSupported='placeholder'in document.createElement('textarea'),prototype=$.fn,valHooks=$.valHooks,hooks,placeholder;if(isInputSupported&&isTextareaSupported){placeholder=prototype.placeholder=function(){return this;};placeholder.input=placeholder.textarea=true;}else{placeholder=prototype.placeholder=function(){var $this=this;$this.filter((isInputSupported?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':clearPlaceholder,'blur.placeholder':setPlaceholder}).data('placeholder-enabled',true).trigger('blur.placeholder');return $this;};placeholder.input=isInputSupported;placeholder.textarea=isTextareaSupported;hooks={'get':function(element){var $element=$(element);return $element.data('placeholder-enabled')&&$element.hasClass('placeholder')?'':element.value;},'set':function(element,value){var $element=$(element);if(!$element.data('placeholder-enabled')){return element.value=value;} 3703if(value==''){element.value=value;if(element!=document.activeElement){setPlaceholder.call(element);}}else if($element.hasClass('placeholder')){clearPlaceholder.call(element,true,value)||(element.value=value);}else{element.value=value;} 3704return $element;}};isInputSupported||(valHooks.input=hooks);isTextareaSupported||(valHooks.textarea=hooks);$(function(){$(document).delegate('form','submit.placeholder',function(){var $inputs=$('.placeholder',this).each(clearPlaceholder);setTimeout(function(){$inputs.each(setPlaceholder);},10);});});$(window).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value='';});});} 3705function args(elem){var newAttrs={},rinlinejQuery=/^jQuery\d+$/;$.each(elem.attributes,function(i,attr){if(attr.specified&&!rinlinejQuery.test(attr.name)){newAttrs[attr.name]=attr.value;}});return newAttrs;}
3706function clearPlaceholder(event,value){var input=this,$input=$(input);if(input.value==$input.attr('placeholder')&&$input.hasClass('placeholder')){if($input.data('placeholder-password')){$input=$input.hide().next().show().attr('id',$input.removeAttr('id').data('placeholder-id'));if(event===true){return $input[0].value=value;} 3707$input.focus();}else{input.value='';$input.removeClass('placeholder');input==document.activeElement&&input.select();}}} 3708function setPlaceholder(){var $replacement,input=this,$input=$(input),$origInput=$input,id=this.id;if(input.value==''){if(input.type=='password'){if(!$input.data('placeholder-textinput')){try{$replacement=$input.clone().attr({'type':'text'});}catch(e){$replacement=$('<input>').attr($.extend(args(this),{'type':'text'}));} 3709$replacement.removeAttr('name').data({'placeholder-password':true,'placeholder-id':id}).bind('focus.placeholder',clearPlaceholder);$input.data({'placeholder-textinput':$replacement,'placeholder-id':id}).before($replacement);} 3710$input=$input.removeAttr('id').hide().prev().attr('id',id).show();} 3711$input.addClass('placeholder');$input[0].value=$input.attr('placeholder');}else{$input.removeClass('placeholder');}}}(this,document,jQuery));; 3712 3713/* /web/static/lib/jquery.form/jquery.form.js */ 3714(function(factory){"use strict";if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else{factory((typeof(jQuery)!='undefined')?jQuery:window.Zepto);}} 3715(function($){"use strict";var feature={};feature.fileapi=$("<input type='file'/>").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;var hasProp=!!$.fn.prop;$.fn.attr2=function(){if(!hasProp){return this.attr.apply(this,arguments);} 3716var val=this.prop.apply(this,arguments);if((val&&val.jquery)||typeof val==='string'){return val;} 3717return this.attr.apply(this,arguments);};$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;} 3718var method,action,url,$form=this;if(typeof options=='function'){options={success:options};} 3719else if(options===undefined){options={};} 3720method=options.type||this.attr2('method');action=options.url||this.attr2('action');url=(typeof action==='string')?$.trim(action):'';url=url||window.location.href||'';if(url){url=(url.match(/^([^#]+)/)||[])[1];} 3721options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||$.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options);var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;} 3722if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;} 3723var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;} 3724var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);} 3725if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;} 3726this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;} 3727var q=$.param(a,traditional);if(qx){q=(q?(q+'&'+qx):qx);} 3728if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;} 3729else{options.data=q;} 3730var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});} 3731if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});} 3732if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(oldSuccess,arguments);});} 3733else if(options.success){callbacks.push(options.success);} 3734options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}};if(options.error){var oldError=options.error;options.error=function(xhr,status,error){var context=options.context||this;oldError.apply(context,[xhr,status,error,$form]);};} 3735if(options.complete){var oldComplete=options.complete;options.complete=function(xhr,status){var context=options.context||this;oldComplete.apply(context,[xhr,status,$form]);};} 3736var fileInputs=$('input[type=file]:enabled',this).filter(function(){return $(this).val()!=='';});var hasFileInputs=fileInputs.length>0;var mp='multipart/form-data';var multipart=($form.attr('enctype')==mp||$form.attr('encoding')==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});} 3737else{jqxhr=fileUploadIframe(a);}} 3738else if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a);} 3739else{jqxhr=$.ajax(options);} 3740$form.removeData('jqxhr').data('jqxhr',jqxhr);for(var k=0;k<elements.length;k++){elements[k]=null;} 3741this.trigger('form-submit-notify',[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData,options.traditional).split('&');var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g,' ');part=serialized[i].split('=');result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);} 3742return result;} 3743function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++){formdata.append(a[i].name,a[i].value);} 3744if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++){if(serializedData[i]){formdata.append(serializedData[i][0],serializedData[i][1]);}}} 3745options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||'POST'});if(options.uploadProgress){s.xhr=function(){var xhr=$.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener('progress',function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100);} 3746options.uploadProgress(event,position,total,percent);},false);} 3747return xhr;};} 3748s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){if(options.formData){o.data=options.formData;} 3749else{o.data=formdata;}
3750if(beforeSend){beforeSend.call(this,xhr,o);}};return $.ajax(s);} 3751function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var deferred=$.Deferred();deferred.abort=function(status){xhr.abort(status);};if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(hasProp){el.prop('disabled',false);} 3752else{el.removeAttr('disabled');}}} 3753s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id='jqFormIO'+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr2('name');if(!n){$io.attr2('name',id);} 3754else{id=n;}} 3755else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:'absolute',top:'-1000px',left:'-1000px'});} 3756io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand('Stop');}} 3757catch(ignore){} 3758$io.attr('src',s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status);} 3759if(g){$.event.trigger("ajaxError",[xhr,s,e]);} 3760if(s.complete){s.complete.call(s.context,xhr,e);}}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");} 3761if(g){$.event.trigger("ajaxSend",[xhr,s]);} 3762if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;} 3763deferred.reject();return deferred;} 3764if(xhr.aborted){deferred.reject();return deferred;} 3765sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y;}}} 3766var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=null;try{if(frame.contentWindow){doc=frame.contentWindow.document;}}catch(err){log('cannot get iframe.contentWindow document: '+err);} 3767if(doc){return doc;} 3768try{doc=frame.contentDocument?frame.contentDocument:frame.document;}catch(err){log('cannot get iframe.contentDocument: '+err);doc=frame.document;} 3769return doc;} 3770var csrf_token=$('meta[name=csrf-token]').attr('content');var csrf_param=$('meta[name=csrf-param]').attr('content');if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;} 3771function doSubmit(){var t=$form.attr2('target'),a=$form.attr2('action'),mp='multipart/form-data',et=$form.attr('enctype')||$form.attr('encoding')||mp;form.setAttribute('target',id);if(!method||/post/i.test(method)){form.setAttribute('method','POST');} 3772if(a!=s.url){form.setAttribute('action',s.url);} 3773if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});} 3774if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);} 3775function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state&&state.toLowerCase()=='uninitialized'){setTimeout(checkState,50);}} 3776catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle);} 3777timeoutHandle=undefined;}} 3778var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty('name')&&s.extraData[n].hasOwnProperty('value')){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('<input type="hidden" name="'+n+'">').val(s.extraData[n]).appendTo(form)[0]);}}}} 3779if(!s.iframeTarget){$io.appendTo('body');} 3780if(io.attachEvent){io.attachEvent('onload',cb);} 3781else{io.addEventListener('load',cb,false);} 3782setTimeout(checkState,15);try{form.submit();}catch(err){var submitFn=document.createElement('form').submit;submitFn.apply(form);}} 3783finally{form.setAttribute('action',a);form.setAttribute('enctype',et);if(t){form.setAttribute('target',t);}else{$form.removeAttr('target');} 3784$(extraInputs).remove();}} 3785if(s.forceSync){doSubmit();} 3786else{setTimeout(doSubmit,10);} 3787var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;} 3788doc=getDoc(io);if(!doc){log('cannot access response document');e=SERVER_ABORT;} 3789if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');deferred.reject(xhr,'timeout');return;} 3790else if(e==SERVER_ABORT&&xhr){xhr.abort('server abort');deferred.reject(xhr,'error','server abort');return;} 3791if(!doc||doc.location.href==s.iframeSrc){if(!timedOut){return;}} 3792if(io.detachEvent){io.detachEvent('onload',cb);} 3793else{io.removeEventListener('load',cb,false);} 3794var status='success',errMsg;
3794try{if(timedOut){throw'timeout';} 3795var isXml=s.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}} 3796var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType='xml';} 3797xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header.toLowerCase()];};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText;} 3798var dt=(s.dataType||'').toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText;} 3799else if(scr){var pre=doc.getElementsByTagName('pre')[0];var b=doc.getElementsByTagName('body')[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;} 3800else if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}} 3801else if(dt=='xml'&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);} 3802try{data=httpData(xhr,dt,s);} 3803catch(err){status='parsererror';xhr.error=errMsg=(err||status);}} 3804catch(err){log('error caught: ',err);status='error';xhr.error=errMsg=(err||status);} 3805if(xhr.aborted){log('upload aborted');status=null;} 3806if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?'success':'error';} 3807if(status==='success'){if(s.success){s.success.call(s.context,data,'success',xhr);} 3808deferred.resolve(xhr.responseText,'success',xhr);if(g){$.event.trigger("ajaxSuccess",[xhr,s]);}} 3809else if(status){if(errMsg===undefined){errMsg=xhr.statusText;} 3810if(s.error){s.error.call(s.context,xhr,status,errMsg);} 3811deferred.reject(xhr,'error',errMsg);if(g){$.event.trigger("ajaxError",[xhr,s,errMsg]);}} 3812if(g){$.event.trigger("ajaxComplete",[xhr,s]);} 3813if(g&&!--$.active){$.event.trigger("ajaxStop");} 3814if(s.complete){s.complete.call(s.context,xhr,status);} 3815callbackProcessed=true;if(s.timeout){clearTimeout(timeoutHandle);} 3816setTimeout(function(){if(!s.iframeTarget){$io.remove();} 3817else{$io.attr('src',s.iframeSrc);} 3818xhr.responseXML=null;},100);} 3819var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);} 3820else{doc=(new DOMParser()).parseFromString(s,'text/xml');} 3821return(doc&&doc.documentElement&&doc.documentElement.nodeName!='parsererror')?doc:null;};var parseJSON=$.parseJSON||function(s){return window['eval']('('+s+')');};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=type==='xml'||!type&&ct.indexOf('xml')>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror'){if($.error){$.error('parsererror');}} 3822if(s&&s.dataFilter){data=s.dataFilter(data,type);} 3823if(typeof data==='string'){if(type==='json'||!type&&ct.indexOf('json')>=0){data=parseJSON(data);}else if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}} 3824return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options);});return this;} 3825log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this;} 3826if(options.delegation){$(document).off('submit.form-plugin',this.selector,doAjaxSubmit).off('click.form-plugin',this.selector,captureSubmittingElement).on('submit.form-plugin',this.selector,options,doAjaxSubmit).on('click.form-plugin',this.selector,options,captureSubmittingElement);return this;} 3827return this.ajaxFormUnbind().bind('submit.form-plugin',options,doAjaxSubmit).bind('click.form-plugin',options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(e.target).ajaxSubmit(options);}} 3828function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest('[type=submit]');if(t.length===0){return;} 3829target=t[0];} 3830var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}} 3831setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);} 3832$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;} 3833var form=this[0];var formId=this.attr('id');var els=semantic?form.getElementsByTagName('*'):form.elements;var els2;if(els&&!/MSIE [678]/.test(navigator.userAgent)){els=$(els).get();} 3834if(formId){els2=$(':input[form="'+formId+'"]').get();if(els2.length){els=(els||[]).concat(els2);}} 3835if(!els||!els.length){return a;} 3836var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n||el.disabled){continue;} 3837if(semantic&&form.clk&&el.type=="image"){if(form.clk==el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});} 3838continue;} 3839v=$.fieldValue(el,true);if(v&&v.constructor==Array){if(elements){elements.push(el);} 3840for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}} 3841else if(feature.fileapi&&el.type=='file'){if(elements){elements.push(el);} 3842var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type});}} 3843else{a.push({name:n,value:'',type:el.type});}} 3844else if(v!==null&&typeof v!='undefined'){if(elements){elements.push(el);} 3845a.push({name:n,value:v,type:el.type,required:el.required});}} 3846if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}} 3847return a;};
3847$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;} 3848var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}} 3849else if(v!==null&&typeof v!='undefined'){a.push({name:this.name,value:v});}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length)){continue;} 3850if(v.constructor==Array){$.merge(val,v);} 3851else{val.push(v);}} 3852return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;} 3853if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1)){return null;} 3854if(tag=='select'){var index=el.selectedIndex;if(index<0){return null;} 3855var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;} 3856if(one){return v;} 3857a.push(v);}} 3858return a;} 3859return $(el).val();};$.fn.clearForm=function(includeHidden){return this.each(function(){$('input,select,textarea',this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag=='textarea'){this.value='';} 3860else if(t=='checkbox'||t=='radio'){this.checked=false;} 3861else if(tag=='select'){this.selectedIndex=-1;} 3862else if(t=="file"){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone(true));}else{$(this).val('');}} 3863else if(includeHidden){if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden=='string'&&$(this).is(includeHidden))){this.value='';}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;} 3864return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;} 3865return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio'){this.checked=select;} 3866else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);} 3867this.selected=select;}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug){return;} 3868var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log){window.console.log(msg);} 3869else if(window.opera&&window.opera.postError){window.opera.postError(msg);}}}));; 3870 3871/* /web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js */ 3872(function($,window){'$:nomunge';var undefined,aps=Array.prototype.slice,decode=decodeURIComponent,jq_param=$.param,jq_param_sorted,jq_param_fragment,jq_deparam,jq_deparam_fragment,jq_bbq=$.bbq=$.bbq||{},jq_bbq_pushState,jq_bbq_getState,jq_elemUrlAttr,special=$.event.special,str_hashchange='hashchange',str_querystring='querystring',str_fragment='fragment',str_elemUrlAttr='elemUrlAttr',str_href='href',str_src='src',re_params_querystring=/^.*\?|#.*$/g,re_params_fragment,re_fragment,re_no_escape,ajax_crawlable,fragment_prefix,elemUrlAttr_cache={};function is_string(arg){return typeof arg==='string';};function curry(func){var args=aps.call(arguments,1);return function(){return func.apply(this,args.concat(aps.call(arguments)));};};function get_fragment(url){return url.replace(re_fragment,'$2');};function get_querystring(url){return url.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,'$1');};function jq_param_sub(is_fragment,get_func,url,params,merge_mode){var result,qs,matches,url_params,hash;if(params!==undefined){matches=url.match(is_fragment?re_fragment:/^([^#?]*)\??([^#]*)(#?.*)/);hash=matches[3]||'';if(merge_mode===2&&is_string(params)){qs=params.replace(is_fragment?re_params_fragment:re_params_querystring,'');}else{url_params=jq_deparam(matches[2]);params=is_string(params)?jq_deparam[is_fragment?str_fragment:str_querystring](params):params;qs=merge_mode===2?params:merge_mode===1?$.extend({},params,url_params):$.extend({},url_params,params);qs=jq_param_sorted(qs);if(is_fragment){qs=qs.replace(re_no_escape,decode);}} 3873result=matches[1]+(is_fragment?fragment_prefix:qs||!matches[1]?'?':'')+qs+hash;}else{result=get_func(url!==undefined?url:location.href);} 3874return result;};jq_param[str_querystring]=curry(jq_param_sub,0,get_querystring);jq_param[str_fragment]=jq_param_fragment=curry(jq_param_sub,1,get_fragment);jq_param.sorted=jq_param_sorted=function(a,traditional){var arr=[],obj={};$.each(jq_param(a,traditional).split('&'),function(i,v){var key=v.replace(/(?:%5B|=).*$/,''),key_obj=obj[key];if(!key_obj){key_obj=obj[key]=[];arr.push(key);} 3875key_obj.push(v);});return $.map(arr.sort(),function(v){return obj[v];}).join('&');};
3875jq_param_fragment.noEscape=function(chars){chars=chars||'';var arr=$.map(chars.split(''),encodeURIComponent);re_no_escape=new RegExp(arr.join('|'),'g');};jq_param_fragment.noEscape(',/');jq_param_fragment.ajaxCrawlable=function(state){if(state!==undefined){if(state){re_params_fragment=/^.*(?:#!|#)/;re_fragment=/^([^#]*)(?:#!|#)?(.*)$/;fragment_prefix='#!';}else{re_params_fragment=/^.*#/;re_fragment=/^([^#]*)#?(.*)$/;fragment_prefix='#';} 3876ajax_crawlable=!!state;} 3877return ajax_crawlable;};jq_param_fragment.ajaxCrawlable(0);$.deparam=jq_deparam=function(params,coerce){var obj={},coerce_types={'true':!0,'false':!1,'null':null};$.each(params.replace(/\+/g,' ').split('&'),function(j,v){var param=v.split('='),key=decode(param[0]),val,cur=obj,i=0,keys=key.split(']['),keys_last=keys.length-1;if(/\[/.test(keys[0])&&/\]$/.test(keys[keys_last])){keys[keys_last]=keys[keys_last].replace(/\]$/,'');keys=keys.shift().split('[').concat(keys);keys_last=keys.length-1;}else{keys_last=0;} 3878if(param.length===2){val=decode(param[1]);if(coerce){val=val&&!isNaN(val)?+val:val==='undefined'?undefined:coerce_types[val]!==undefined?coerce_types[val]:val;} 3879if(keys_last){for(;i<=keys_last;i++){key=keys[i]===''?cur.length:keys[i];if(key==="__proto__"||key==="prototype"||key==="constructor")break;cur=cur[key]=i<keys_last?cur[key]||(keys[i+1]&&isNaN(keys[i+1])?{}:[]):val;}}else{if($.isArray(obj[key])){obj[key].push(val);}else if(obj[key]!==undefined){obj[key]=[obj[key],val];}else{obj[key]=val;}}}else if(key){obj[key]=coerce?undefined:'';}});return obj;};function jq_deparam_sub(is_fragment,url_or_params,coerce){if(url_or_params===undefined||typeof url_or_params==='boolean'){coerce=url_or_params;url_or_params=jq_param[is_fragment?str_fragment:str_querystring]();}else{url_or_params=is_string(url_or_params)?url_or_params.replace(is_fragment?re_params_fragment:re_params_querystring,''):url_or_params;} 3880return jq_deparam(url_or_params,coerce);};jq_deparam[str_querystring]=curry(jq_deparam_sub,0);jq_deparam[str_fragment]=jq_deparam_fragment=curry(jq_deparam_sub,1);$[str_elemUrlAttr]||($[str_elemUrlAttr]=function(obj){return $.extend(elemUrlAttr_cache,obj);}
3880)({a:str_href,base:str_href,iframe:str_src,img:str_src,input:str_src,form:'action',link:str_href,script:str_src});jq_elemUrlAttr=$[str_elemUrlAttr];function jq_fn_sub(mode,force_attr,params,merge_mode){if(!is_string(params)&&typeof params!=='object'){merge_mode=params;params=force_attr;force_attr=undefined;} 3881return this.each(function(){var that=$(this),attr=force_attr||jq_elemUrlAttr()[(this.nodeName||'').toLowerCase()]||'',url=attr&&that.attr(attr)||'';that.attr(attr,jq_param[mode](url,params,merge_mode));});};$.fn[str_querystring]=curry(jq_fn_sub,str_querystring);$.fn[str_fragment]=curry(jq_fn_sub,str_fragment);jq_bbq.pushState=jq_bbq_pushState=function(params,merge_mode){if(is_string(params)&&/^#/.test(params)&&merge_mode===undefined){merge_mode=2;} 3882var has_args=params!==undefined,url=jq_param_fragment(location.href,has_args?params:{},has_args?merge_mode:2);location.href=url;};jq_bbq.getState=jq_bbq_getState=function(key,coerce){return key===undefined||typeof key==='boolean'?jq_deparam_fragment(key):jq_deparam_fragment(coerce)[key];};jq_bbq.removeState=function(arr){var state={};if(arr!==undefined){state=jq_bbq_getState();$.each($.isArray(arr)?arr:arguments,function(i,v){delete state[v];});} 3883jq_bbq_pushState(state,2);};special[str_hashchange]=$.extend(special[str_hashchange],{add:function(handleObj){var old_handler;function new_handler(e){var hash=e[str_fragment]=jq_param_fragment();e.getState=function(key,coerce){return key===undefined||typeof key==='boolean'?jq_deparam(hash,key):jq_deparam(hash,coerce)[key];};old_handler.apply(this,arguments);};if($.isFunction(handleObj)){old_handler=handleObj;return new_handler;}else{old_handler=handleObj.handler;handleObj.handler=new_handler;}}});})(jQuery,this);(function($,window,undefined){'$:nomunge';var str_hashchange='hashchange',doc=document,fake_onhashchange,special=$.event.special,doc_mode=doc.documentMode,supports_onhashchange='on'+str_hashchange in window&&(doc_mode===undefined||doc_mode>7);function get_fragment(url){url=url||location.href;return'#'+url.replace(/^[^#]*#?(.*)$/,'$1');};$.fn[str_hashchange]=function(fn){return fn?this.bind(str_hashchange,fn):this.trigger(str_hashchange);};$.fn[str_hashchange].delay=50;special[str_hashchange]=$.extend(special[str_hashchange],{setup:function(){if(supports_onhashchange){return false;} 3884$(fake_onhashchange.start);},teardown:function(){if(supports_onhashchange){return false;} 3885$(fake_onhashchange.stop);}});fake_onhashchange=(function(){var self={},timeout_id,last_hash=get_fragment(),fn_retval=function(val){return val;},history_set=fn_retval,history_get=fn_retval;self.start=function(){timeout_id||poll();};self.stop=function(){timeout_id&&clearTimeout(timeout_id);timeout_id=undefined;};function poll(){var hash=get_fragment(),history_hash=history_get(last_hash);if(hash!==last_hash){history_set(last_hash=hash,history_hash);$(window).trigger(str_hashchange);}else if(history_hash!==last_hash){location.href=location.href.replace(/#.*/,'')+history_hash;} 3886timeout_id=setTimeout(poll,$.fn[str_hashchange].delay);};$.browser.msie&&!supports_onhashchange&&(function(){var iframe,iframe_src;self.start=function(){if(!iframe){iframe_src=$.fn[str_hashchange].src;iframe_src=iframe_src&&iframe_src+get_fragment();iframe=$('<iframe tabindex="-1" title="empty"/>').hide().one('load',function(){iframe_src||history_set(get_fragment());poll();}).attr('src',iframe_src||'javascript:0').insertAfter('body')[0].contentWindow;doc.onpropertychange=function(){try{if(event.propertyName==='title'){iframe.document.title=doc.title;}}catch(e){}};}};self.stop=fn_retval;history_get=function(){return get_fragment(iframe.location.href);};history_set=function(hash,history_hash){var iframe_doc=iframe.document,domain=$.fn[str_hashchange].domain;if(hash!==history_hash){iframe_doc.title=doc.title;iframe_doc.open();domain&&iframe_doc.write('<script>document.domain="'+domain+'"</script>');iframe_doc.close();iframe.location.hash=hash;}};})();return self;})();})(jQuery,this);; 3887 3888/* /web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js */ 3889(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui/sortable"],factory);}else{factory(window.jQuery);}}(function($){"use strict";function isOverAxis(x,reference,size){return(x>reference)&&(x<(reference+size));} 3890$.widget("mjs.nestedSortable",$.extend({},$.ui.sortable.prototype,{options:{disableParentChange:false,doNotClear:false,expandOnHover:700,isAllowed:function(){return true;},isTree:false,listType:"ol",maxLevels:0,protectRoot:false,rootID:null,rtl:false,startCollapsed:false,tabSize:20,branchClass:"mjs-nestedSortable-branch",collapsedClass:"mjs-nestedSortable-collapsed",disableNestingClass:"mjs-nestedSortable-no-nesting",errorClass:"mjs-nestedSortable-error",expandedClass:"mjs-nestedSortable-expanded",hoveringClass:"mjs-nestedSortable-hovering",leafClass:"mjs-nestedSortable-leaf",disabledClass:"mjs-nestedSortable-disabled"},_create:function(){var self=this,err;this.element.data("ui-sortable",this.element.data("mjs-nestedSortable"));if(!this.element.is(this.options.listType)){err="nestedSortable: "+"Please check that the listType option is set to your actual list type";throw new Error(err);} 3891if(this.options.isTree&&this.options.expandOnHover){this.options.tolerance="intersect";} 3892$.ui.sortable.prototype._create.apply(this,arguments);if(this.options.isTree){$(this.items).each(function(){var $li=this.item,hasCollapsedClass=$li.hasClass(self.options.collapsedClass),hasExpandedClass=$li.hasClass(self.options.expandedClass);if($li.children(self.options.listType).length){$li.addClass(self.options.branchClass);
3892if(!hasCollapsedClass&&!hasExpandedClass){if(self.options.startCollapsed){$li.addClass(self.options.collapsedClass);}else{$li.addClass(self.options.expandedClass);}}}else{$li.addClass(self.options.leafClass);}});}},_destroy:function(){this.element.removeData("mjs-nestedSortable").removeData("ui-sortable");return $.ui.sortable.prototype._destroy.apply(this,arguments);},_mouseDrag:function(event){var i,item,itemElement,intersection,self=this,o=this.options,scrolled=false,$document=$(document),previousTopOffset,parentItem,level,childLevels,itemAfter,itemBefore,newList,method,a,previousItem,nextItem,helperIsNotSibling;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;} 3893if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+ 3894this.scrollParent[0].offsetHeight)- 3895event.pageY<o.scrollSensitivity){scrolled=this.scrollParent.scrollTop()+o.scrollSpeed;this.scrollParent.scrollTop(scrolled);}else if(event.pageY- 3896this.overflowOffset.top<o.scrollSensitivity){scrolled=this.scrollParent.scrollTop()-o.scrollSpeed;this.scrollParent.scrollTop(scrolled);} 3897if((this.overflowOffset.left+ 3898this.scrollParent[0].offsetWidth)- 3899event.pageX<o.scrollSensitivity){scrolled=this.scrollParent.scrollLeft()+o.scrollSpeed;this.scrollParent.scrollLeft(scrolled);}else if(event.pageX- 3900this.overflowOffset.left<o.scrollSensitivity){scrolled=this.scrollParent.scrollLeft()-o.scrollSpeed;this.scrollParent.scrollLeft(scrolled);}}else{if(event.pageY- 3901$document.scrollTop()<o.scrollSensitivity){scrolled=$document.scrollTop()-o.scrollSpeed;$document.scrollTop(scrolled);}else if($(window).height()- 3902(event.pageY- 3903$document.scrollTop())<o.scrollSensitivity){scrolled=$document.scrollTop()+o.scrollSpeed;$document.scrollTop(scrolled);} 3904if(event.pageX- 3905$document.scrollLeft()<o.scrollSensitivity){scrolled=$document.scrollLeft()-o.scrollSpeed;$document.scrollLeft(scrolled);}else if($(window).width()- 3906(event.pageX- 3907$document.scrollLeft())<o.scrollSensitivity){scrolled=$document.scrollLeft()+o.scrollSpeed;$document.scrollLeft(scrolled);}} 3908if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}} 3909this.positionAbs=this._convertPositionTo("absolute");previousTopOffset=this.placeholder.offset().top;if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";} 3910if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=(this.position.top)+"px";} 3911this.hovering=this.hovering?this.hovering:null;this.mouseentered=this.mouseentered?this.mouseentered:false;(function(){var _parentItem=this.placeholder.parent().parent();if(_parentItem&&_parentItem.closest(".ui-sortable").length){parentItem=_parentItem;}}.call(this));level=this._getLevel(this.placeholder);childLevels=this._getChildLevels(this.helper);newList=document.createElement(o.listType);self.refreshPositions();for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue;} 3912if(item.instance!==this.currentContainer){continue;} 3913if(itemElement.className.indexOf(o.disabledClass)!==-1){if(intersection===2){itemAfter=this.items[i+1];if(itemAfter&&itemAfter.item.hasClass(o.disabledClass)){continue;}}else if(intersection===1){itemBefore=this.items[i-1];if(itemBefore&&itemBefore.item.hasClass(o.disabledClass)){continue;}}} 3914method=intersection===1?"next":"prev";if(itemElement!==this.currentItem[0]&&this.placeholder[method]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):true)){if(!this.mouseentered){$(itemElement).mouseenter();this.mouseentered=true;} 3915if(o.isTree&&$(itemElement).hasClass(o.collapsedClass)&&o.expandOnHover){if(!this.hovering){$(itemElement).addClass(o.hoveringClass);this.hovering=window.setTimeout(function(){$(itemElement).removeClass(o.collapsedClass).addClass(o.expandedClass);self.refreshPositions();self._trigger("expand",event,self._uiHash());},o.expandOnHover);}} 3916this.direction=intersection===1?"down":"up";if((this.options.tolerance==="pointer"||this._intersectsWithSides(item))&&(intersection===1||(itemElement.compareDocumentPosition(this.placeholder[0])&Node.DOCUMENT_POSITION_PRECEDING))){$(itemElement).mouseleave();this.mouseentered=false;$(itemElement).removeClass(o.hoveringClass);if(this.hovering){window.clearTimeout(this.hovering);} 3917this.hovering=null;if(o.protectRoot&&!(this.currentItem[0].parentNode===this.element[0]&&itemElement.parentNode!==this.element[0])){if(this.currentItem[0].parentNode!==this.element[0]&&itemElement.parentNode===this.element[0]){if(!$(itemElement).children(o.listType).length){itemElement.appendChild(newList);if(o.isTree){$(itemElement).removeClass(o.leafClass).addClass(o.branchClass+" "+o.expandedClass);}} 3918if(this.direction==="down"){a=$(itemElement).prev().children(o.listType);}else{a=$(itemElement).children(o.listType);} 3919if(a[0]!==undefined){this._rearrange(event,null,a);}}else{this._rearrange(event,item);}}else if(!o.protectRoot){this._rearrange(event,item);}}else{break;} 3920this._clearEmpty(itemElement);this._trigger("change",event,this._uiHash());break;}} 3921(function(){var _previousItem=this.placeholder.prev();if(_previousItem.length){previousItem=_previousItem;}else{previousItem=null;}}.call(this));if(previousItem!=null){while(previousItem[0].nodeName.toLowerCase()!=="li"||previousItem[0].className.indexOf(o.disabledClass)!==-1||previousItem[0]===this.currentItem[0]||previousItem[0]===this.helper[0]){if(previousItem[0].previousSibling){previousItem=$(previousItem[0].previousSibling);}else{previousItem=null;break;}}} 3922(function(){var _nextItem=this.placeholder.next();if(_nextItem.length){nextItem=_nextItem;}else{nextItem=null;}}.call(this));if(nextItem!=null){while(nextItem[0].nodeName.toLowerCase()!=="li"||nextItem[0].className.indexOf(o.disabledClass)!==-1||nextItem[0]===this.currentItem[0]||nextItem[0]===this.helper[0]){if(nextItem[0].nextSibling){nextItem=$(nextItem[0].nextSibling);}else{nextItem=null;break;}}} 3923this.beyondMaxLevels=0;if(parentItem!=null&&nextItem==null&&!(o.protectRoot&&parentItem[0].parentNode==this.element[0])&&(o.rtl&&(this.positionAbs.left+ 3924this.helper.outerWidth()>parentItem.offset().left+ 3925parentItem.outerWidth())||!o.rtl&&(this.positionAbs.left<parentItem.offset().left))){parentItem.after(this.placeholder[0]);helperIsNotSibling=!parentItem.children(o.listItem).children("li:visible:not(.ui-sortable-helper)").length;if(o.isTree&&helperIsNotSibling){parentItem.removeClass(this.options.branchClass+" "+this.options.expandedClass).addClass(this.options.leafClass);} 3926if(typeof parentItem!=='undefined') 3927this._clearEmpty(parentItem[0]);this._trigger("change",event,this._uiHash());}else if(previousItem!=null&&!previousItem.hasClass(o.disableNestingClass)&&(previousItem.children(o.listType).length&&previousItem.children(o.listType).is(":visible")||!previousItem.children(o.listType).length)&&!(o.protectRoot&&this.currentItem[0].parentNode===this.element[0])&&(o.rtl&&(this.positionAbs.left+ 3928this.helper.outerWidth()<previousItem.offset().left+ 3929previousItem.outerWidth()- 3930o.tabSize)||!o.rtl&&(this.positionAbs.left>previousItem.offset().left+o.tabSize))){this._isAllowed(previousItem,level,level+childLevels+1);if(!previousItem.children(o.listType).length){previousItem[0].appendChild(newList);if(o.isTree){previousItem.removeClass(o.leafClass).addClass(o.branchClass+" "+o.expandedClass);}} 3931if(previousTopOffset&&(previousTopOffset<=previousItem.offset().top)){previousItem.children(o.listType).prepend(this.placeholder);}else{previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);} 3932if(typeof parentItem!=='undefined') 3933this._clearEmpty(parentItem[0]);this._trigger("change",event,this._uiHash());}else{this._isAllowed(parentItem,level,level+childLevels);} 3934this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);} 3935this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event){if(this.beyondMaxLevels){this.placeholder.removeClass(this.options.errorClass);if(this.domPosition.prev){$(this.domPosition.prev).after(this.placeholder);}else{$(this.domPosition.parent).prepend(this.placeholder);} 3936this._trigger("revert",event,this._uiHash());} 3937$("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass);this.mouseentered=false;if(this.hovering){window.clearTimeout(this.hovering);} 3938this.hovering=null;this._relocate_event=event;this._pid_current=$(this.domPosition.parent).parent().attr("id");this._sort_current=this.domPosition.prev?$(this.domPosition.prev).next().index():0;$.ui.sortable.prototype._mouseStop.apply(this,arguments);},_intersectsWithSides:function(item){var half=this.options.isTree?.8:.5,isOverBottomHalf=isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height*half),item.height),isOverTopHalf=isOverAxis(this.positionAbs.top+this.offset.click.top,item.top-(item.height*half),item.height),isOverRightHalf=isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&isOverTopHalf));}},_contactContainers:function(){if(this.options.protectRoot&&this.currentItem[0].parentNode===this.element[0]){return;} 3939$.ui.sortable.prototype._contactContainers.apply(this,arguments);},_clear:function(){var i,item;$.ui.sortable.prototype._clear.apply(this,arguments);if(!(this._pid_current===this._uiHash().item.parent().parent().attr("id")&&this._sort_current===this._uiHash().item.index())){this._trigger("relocate",this._relocate_event,this._uiHash());} 3940for(i=this.items.length-1;i>=0;i--){item=this.items[i].item[0];this._clearEmpty(item);}},serialize:function(options){var o=$.extend({},this.options,options),items=this._getItemsAsjQuery(o&&o.connected),str=[];$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[-=_](.+)/)),pid=($(o.item||this).parent(o.listType).parent(o.items).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[-=_](.+)/));if(res){str.push(((o.key||res[1])+"["+ 3941(o.key&&o.expression?res[1]:res[2])+"]")+"="+ 3942(pid?(o.key&&o.expression?pid[1]:pid[2]):o.rootID));}});if(!str.length&&o.key){str.push(o.key+"=");} 3943return str.join("&");},toHierarchy:function(options){var o=$.extend({},this.options,options),ret=[];$(this.element).children(o.items).each(function(){var level=_recursiveItems(this);ret.push(level);});return ret;function _recursiveItems(item){var id=($(item).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[-=_](.+)/)),currentItem;var data=$(item).data();if(data.nestedSortableItem){delete data.nestedSortableItem;} 3944if(id){currentItem={"id":id[2]};currentItem=$.extend({},currentItem,data);if($(item).children(o.listType).children(o.items).length>0){currentItem.children=[];$(item).children(o.listType).children(o.items).each(function(){var level=_recursiveItems(this);currentItem.children.push(level);});} 3945return currentItem;}}},toArray:function(options){var o=$.extend({}
3945,this.options,options),sDepth=o.startDepthCount||0,ret=[],left=1;if(!o.excludeRoot){ret.push({"item_id":o.rootID,"parent_id":null,"depth":sDepth,"left":left,"right":($(o.items,this.element).length+1)*2});left++;} 3946$(this.element).children(o.items).each(function(){left=_recursiveArray(this,sDepth,left);});ret=ret.sort(function(a,b){return(a.left-b.left);});return ret;function _recursiveArray(item,depth,_left){var right=_left+1,id,pid,parentItem;if($(item).children(o.listType).children(o.items).length>0){depth++;$(item).children(o.listType).children(o.items).each(function(){right=_recursiveArray($(this),depth,right);});depth--;} 3947id=($(item).attr(o.attribute||"id")).match(o.expression||(/(.+)[-=_](.+)/));if(depth===sDepth){pid=o.rootID;}else{parentItem=($(item).parent(o.listType).parent(o.items).attr(o.attribute||"id")).match(o.expression||(/(.+)[-=_](.+)/));pid=parentItem[2];} 3948if(id){var data=$(item).children('div').data();var itemObj=$.extend(data,{"id":id[2],"parent_id":pid,"depth":depth,"left":_left,"right":right});ret.push(itemObj);} 3949_left=right+1;return _left;}},_clearEmpty:function(item){function replaceClass(elem,search,replace,swap){if(swap){search=[replace,replace=search][0];} 3950$(elem).removeClass(search).addClass(replace);} 3951var o=this.options,childrenList=$(item).children(o.listType),hasChildren=childrenList.has('li').length;var doNotClear=o.doNotClear||hasChildren||o.protectRoot&&$(item)[0]===this.element[0];if(o.isTree){replaceClass(item,o.branchClass,o.leafClass,doNotClear);} 3952if(!doNotClear){childrenList.parent().removeClass(o.expandedClass);childrenList.remove();}},_getLevel:function(item){var level=1,list;if(this.options.listType){list=item.closest(this.options.listType);while(list&&list.length>0&&!list.is(".ui-sortable")){level++;list=list.parent().closest(this.options.listType);}} 3953return level;},_getChildLevels:function(parent,depth){var self=this,o=this.options,result=0;depth=depth||0;$(parent).children(o.listType).children(o.items).each(function(index,child){result=Math.max(self._getChildLevels(child,depth+1),result);});return depth?result+1:result;},_isAllowed:function(parentItem,level,levels){var o=this.options,maxLevels=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),oldParent=this.currentItem.parent().parent(),disabledByParentchange=o.disableParentChange&&(typeof parentItem!=='undefined'&&!oldParent.is(parentItem)||typeof parentItem==='undefined'&&oldParent.is("li"));if(disabledByParentchange||!o.isAllowed(this.placeholder,parentItem,this.currentItem)){this.placeholder.addClass(o.errorClass);if(maxLevels<levels&&maxLevels!==0){this.beyondMaxLevels=levels-maxLevels;}else{this.beyondMaxLevels=1;}}else{if(maxLevels<levels&&maxLevels!==0){this.placeholder.addClass(o.errorClass);this.beyondMaxLevels=levels-maxLevels;}else{this.placeholder.removeClass(o.errorClass);this.beyondMaxLevels=0;}}}}));$.mjs.nestedSortable.prototype.options=$.extend({},$.ui.sortable.prototype.options,$.mjs.nestedSortable.prototype.options);}));; 3954 3955/* /web/static/lib/popper/popper.js */ 3956(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.Popper={}));}(this,(function(exports){'use strict';function getWindow(node){if(node==null){return window;} 3957if(node.toString()!=='[object Window]'){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window;} 3958return node;} 3959function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element;} 3960function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement;} 3961function isShadowRoot(node){if(typeof ShadowRoot==='undefined'){return false;} 3962var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot;} 3963var max=Math.max;var min=Math.min;var round=Math.round;function getBoundingClientRect(element,includeScale){if(includeScale===void 0){includeScale=false;} 3964var rect=element.getBoundingClientRect();var scaleX=1;var scaleY=1;if(isHTMLElement(element)&&includeScale){var offsetHeight=element.offsetHeight;var offsetWidth=element.offsetWidth;if(offsetWidth>0){scaleX=round(rect.width)/offsetWidth||1;} 3965if(offsetHeight>0){scaleY=round(rect.height)/offsetHeight||1;}}
vendor: 4,520 bytes, lines 3966-3994
3966return{width:rect.width/scaleX,height:rect.height/scaleY,top:rect.top/scaleY,right:rect.right/scaleX,bottom:rect.bottom/scaleY,left:rect.left/scaleX,x:rect.left/scaleX,y:rect.top/scaleY};} 3967function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop};} 3968function getHTMLElementScroll(element){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop};} 3969function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node);}else{return getHTMLElementScroll(node);}} 3970function getNodeName(element){return element?(element.nodeName||'').toLowerCase():null;} 3971function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement;} 3972function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft;} 3973function getComputedStyle(element){return getWindow(element).getComputedStyle(element);} 3974function isScrollParent(element){var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX);} 3975function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round(rect.width)/element.offsetWidth||1;var scaleY=round(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1;} 3976function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false;} 3977var isOffsetParentAnElement=isHTMLElement(offsetParent);var offsetParentIsScaled=isHTMLElement(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement(offsetParent);var rect=getBoundingClientRect(elementOrVirtualElement,offsetParentIsScaled);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=='body'||isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent);} 3978if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop;}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement);}} 3979return{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height};} 3980function getLayoutRect(element){var clientRect=getBoundingClientRect(element);var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width;} 3981if(Math.abs(clientRect.height-height)<=1){height=clientRect.height;} 3982return{x:element.offsetLeft,y:element.offsetTop,width:width,height:height};} 3983function getParentNode(element){if(getNodeName(element)==='html'){return element;} 3984return(element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element));} 3985function getScrollParent(node){if(['html','body','#document'].indexOf(getNodeName(node))>=0){return node.ownerDocument.body;} 3986if(isHTMLElement(node)&&isScrollParent(node)){return node;} 3987return getScrollParent(getParentNode(node));} 3988function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[];} 3989var scrollParent=getScrollParent(element);var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body);var win=getWindow(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode(target)));} 3990function isTableElement(element){return['table','td','th'].indexOf(getNodeName(element))>=0;} 3991function getTrueOffsetParent(element){if(!isHTMLElement(element)||getComputedStyle(element).position==='fixed'){return null;} 3992return element.offsetParent;} 3993function getContainingBlock(element){var isFirefox=navigator.userAgent.toLowerCase().indexOf('firefox')!==-1;var isIE=navigator.userAgent.indexOf('Trident')!==-1;if(isIE&&isHTMLElement(element)){var elementCss=getComputedStyle(element);if(elementCss.position==='fixed'){return null;}} 3994var currentNode=getParentNode(element);while(isHTMLElement(currentNode)&&['html','body'].indexOf(getNodeName(currentNode))<0){var css=getComputedStyle(currentNode);
vendor: 4,188 bytes, lines 3994-4010
3994if(css.transform!=='none'||css.perspective!=='none'||css.contain==='paint'||['transform','perspective'].indexOf(css.willChange)!==-1||isFirefox&&css.willChange==='filter'||isFirefox&&css.filter&&css.filter!=='none'){return currentNode;}else{currentNode=currentNode.parentNode;}} 3995return null;} 3996function getOffsetParent(element){var window=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==='static'){offsetParent=getTrueOffsetParent(offsetParent);} 3997if(offsetParent&&(getNodeName(offsetParent)==='html'||getNodeName(offsetParent)==='body'&&getComputedStyle(offsetParent).position==='static')){return window;} 3998return offsetParent||getContainingBlock(element)||window;} 3999var top='top';var bottom='bottom';var right='right';var left='left';var auto='auto';var basePlacements=[top,bottom,right,left];var start='start';var end='end';var clippingParents='clippingParents';var viewport='viewport';var popper='popper';var reference='reference';var variationPlacements=basePlacements.reduce(function(acc,placement){return acc.concat([placement+"-"+start,placement+"-"+end]);},[]);var placements=[].concat(basePlacements,[auto]).reduce(function(acc,placement){return acc.concat([placement,placement+"-"+start,placement+"-"+end]);},[]);var beforeRead='beforeRead';var read='read';var afterRead='afterRead';var beforeMain='beforeMain';var main='main';var afterMain='afterMain';var beforeWrite='beforeWrite';var write='write';var afterWrite='afterWrite';var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function order(modifiers){var map=new Map();var visited=new Set();var result=[];modifiers.forEach(function(modifier){map.set(modifier.name,modifier);});function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);} 4000modifiers.forEach(function(modifier){if(!visited.has(modifier.name)){sort(modifier);}});return result;} 4001function orderModifiers(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce(function(acc,phase){return acc.concat(orderedModifiers.filter(function(modifier){return modifier.phase===phase;}));},[]);} 4002function debounce(fn){var pending;return function(){if(!pending){pending=new Promise(function(resolve){Promise.resolve().then(function(){pending=undefined;resolve(fn());});});} 4003return pending;};} 4004function format(str){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];} 4005return[].concat(args).reduce(function(p,c){return p.replace(/%s/,c);},str);} 4006var INVALID_MODIFIER_ERROR='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';var MISSING_DEPENDENCY_ERROR='Popper: modifier "%s" requires "%s", but "%s" modifier is not available';var VALID_PROPERTIES=['name','enabled','phase','fn','effect','requires','options'];function validateModifiers(modifiers){modifiers.forEach(function(modifier){[].concat(Object.keys(modifier),VALID_PROPERTIES).filter(function(value,index,self){return self.indexOf(value)===index;}).forEach(function(key){switch(key){case'name':if(typeof modifier.name!=='string'){console.error(format(INVALID_MODIFIER_ERROR,String(modifier.name),'"name"','"string"',"\""+String(modifier.name)+"\""));} 4007break;case'enabled':if(typeof modifier.enabled!=='boolean'){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"enabled"','"boolean"',"\""+String(modifier.enabled)+"\""));} 4008break;case'phase':if(modifierPhases.indexOf(modifier.phase)<0){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"phase"',"either "+modifierPhases.join(', '),"\""+String(modifier.phase)+"\""));} 4009break;case'fn':if(typeof modifier.fn!=='function'){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"fn"','"function"',"\""+String(modifier.fn)+"\""));} 4010break;case'effect':if(modifier.effect!=null&&typeof modifier.effect!=='function'){console.error(format(INVALID_MODIFIER_ERROR,modifier.n
vendor: 4,345 bytes, lines 4010-4030
4010ame,'"effect"','"function"',"\""+String(modifier.fn)+"\""));} 4011break;case'requires':if(modifier.requires!=null&&!Array.isArray(modifier.requires)){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requires"','"array"',"\""+String(modifier.requires)+"\""));} 4012break;case'requiresIfExists':if(!Array.isArray(modifier.requiresIfExists)){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requiresIfExists"','"array"',"\""+String(modifier.requiresIfExists)+"\""));} 4013break;case'options':case'data':break;default:console.error("PopperJS: an invalid property has been provided to the \""+modifier.name+"\" modifier, valid properties are "+VALID_PROPERTIES.map(function(s){return"\""+s+"\"";}).join(', ')+"; but \""+key+"\" was provided.");} 4014modifier.requires&&modifier.requires.forEach(function(requirement){if(modifiers.find(function(mod){return mod.name===requirement;})==null){console.error(format(MISSING_DEPENDENCY_ERROR,String(modifier.name),requirement,requirement));}});});});} 4015function uniqueBy(arr,fn){var identifiers=new Set();return arr.filter(function(item){var identifier=fn(item);if(!identifiers.has(identifier)){identifiers.add(identifier);return true;}});} 4016function getBasePlacement(placement){return placement.split('-')[0];} 4017function mergeByName(modifiers){var merged=modifiers.reduce(function(merged,current){var existing=merged[current.name];merged[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current;return merged;},{});return Object.keys(merged).map(function(key){return merged[key];});} 4018function getViewportRect(element){var win=getWindow(element);var html=getDocumentElement(element);var visualViewport=win.visualViewport;var width=html.clientWidth;var height=html.clientHeight;var x=0;var y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;if(!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){x=visualViewport.offsetLeft;y=visualViewport.offsetTop;}} 4019return{width:width,height:height,x:x+getWindowScrollBarX(element),y:y};} 4020function getDocumentRect(element){var _element$ownerDocumen;var html=getDocumentElement(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX(element);var y=-winScroll.scrollTop;if(getComputedStyle(body||html).direction==='rtl'){x+=max(html.clientWidth,body?body.clientWidth:0)-width;} 4021return{width:width,height:height,x:x,y:y};} 4022function contains(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child)){return true;} 4023else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true;} 4024next=next.parentNode||next.host;}while(next);} 4025return false;} 4026function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height});} 4027function getInnerBoundingClientRect(element){var rect=getBoundingClientRect(element);rect.top=rect.top+element.clientTop;rect.left=rect.left+element.clientLeft;rect.bottom=rect.top+element.clientHeight;rect.right=rect.left+element.clientWidth;rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect;} 4028function getClientRectFromMixedType(element,clippingParent){return clippingParent===viewport?rectToClientRect(getViewportRect(element)):isElement(clippingParent)?getInnerBoundingClientRect(clippingParent):rectToClientRect(getDocumentRect(getDocumentElement(element)));} 4029function getClippingParents(element){var clippingParents=listScrollParents(getParentNode(element));var canEscapeClipping=['absolute','fixed'].indexOf(getComputedStyle(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;if(!isElement(clipperElement)){return[];} 4030return clippingParents.filter(function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=='body';});}
vendor: 9,142 bytes, lines 4031-4056
4031function getClippingRect(element,boundary,rootBoundary){var mainClippingParents=boundary==='clippingParents'?getClippingParents(element):[].concat(boundary);var clippingParents=[].concat(mainClippingParents,[rootBoundary]);var firstClippingParent=clippingParents[0];var clippingRect=clippingParents.reduce(function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect;},getClientRectFromMixedType(element,firstClippingParent));clippingRect.width=clippingRect.right-clippingRect.left;clippingRect.height=clippingRect.bottom-clippingRect.top;clippingRect.x=clippingRect.left;clippingRect.y=clippingRect.top;return clippingRect;} 4032function getVariation(placement){return placement.split('-')[1];} 4033function getMainAxisFromPlacement(placement){return['top','bottom'].indexOf(placement)>=0?'x':'y';} 4034function computeOffsets(_ref){var reference=_ref.reference,element=_ref.element,placement=_ref.placement;var basePlacement=placement?getBasePlacement(placement):null;var variation=placement?getVariation(placement):null;var commonX=reference.x+reference.width/2-element.width/2;var commonY=reference.y+reference.height/2-element.height/2;var offsets;switch(basePlacement){case top:offsets={x:commonX,y:reference.y-element.height};break;case bottom:offsets={x:commonX,y:reference.y+reference.height};break;case right:offsets={x:reference.x+reference.width,y:commonY};break;case left:offsets={x:reference.x-element.width,y:commonY};break;default:offsets={x:reference.x,y:reference.y};} 4035var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(mainAxis!=null){var len=mainAxis==='y'?'height':'width';switch(variation){case start:offsets[mainAxis]=offsets[mainAxis]-(reference[len]/2-element[len]/2);break;case end:offsets[mainAxis]=offsets[mainAxis]+(reference[len]/2-element[len]/2);break;}} 4036return offsets;} 4037function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0};} 4038function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject);} 4039function expandToHashMap(value,keys){return keys.reduce(function(hashMap,key){hashMap[key]=value;return hashMap;},{});} 4040function detectOverflow(state,options){if(options===void 0){options={};} 4041var _options=options,_options$placement=_options.placement,placement=_options$placement===void 0?state.placement:_options$placement,_options$boundary=_options.boundary,boundary=_options$boundary===void 0?clippingParents:_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=_options$elementConte===void 0?popper:_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,_options$padding=_options.padding,padding=_options$padding===void 0?0:_options$padding;var paddingObject=mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));var altContext=elementContext===popper?reference:popper;var popperRect=state.rects.popper;var element=state.elements[altBoundary?altContext:elementContext];var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary);var referenceClientRect=getBoundingClientRect(state.elements.reference);var popperOffsets=computeOffsets({reference:referenceClientRect,element:popperRect,strategy:'absolute',placement:placement});var popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets));var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;var overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right};var offsetData=state.modifiersData.offset;if(elementContext===popper&&offsetData){var offset=offsetData[placement];Object.keys(overflowOffsets).forEach(function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1;var axis=[top,bottom].indexOf(key)>=0?'y':'x';overflowOffsets[key]+=offset[axis]*multiply;});} 4042return overflowOffsets;} 4043var INVALID_ELEMENT_ERROR='Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';var INFINITE_LOOP_ERROR='Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';var DEFAULT_OPTIONS={placement:'bottom',modifiers:[],strategy:'absolute'};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];} 4044return!args.some(function(element){return!(element&&typeof element.getBoundingClientRect==='function');});} 4045function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={};} 4046var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers=_generatorOptions$def===void 0?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;return function createPopper(reference,popper,options){if(options===void 0){options=defaultOptions;} 4047var state={placement:'bottom',orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference,popper:popper},attributes:{},styles:{}};var effectCleanupFns=[];var isDestroyed=false;var instance={state:state,setOptions:function setOptions(setOptionsAction){var options=typeof setOptionsAction==='function'?setOptionsAction(state.options):setOptionsAction;cleanupModifierEffects();state.options=Object.assign({},defaultOptions,state.options,options);state.scrollParents={reference:isElement(reference)?listScrollParents(reference):reference.contextElement?listScrollParents(reference.contextElement):[],popper:listScrollParents(popper)};var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers,state.options.modifiers)));state.orderedModifiers=orderedModifiers.filter(function(m){return m.enabled;});{var modifiers=uniqueBy([].concat(orderedModifiers,state.options.modifiers),function(_ref){var name=_ref.name;return name;});validateModifiers(modifiers);if(getBasePlacement(state.options.placement)===auto){var flipModifier=state.orderedModifiers.find(function(_ref2){var name=_ref2.name;return name==='flip';});if(!flipModifier){console.error(['Popper: "auto" placements require the "flip" modifier be','present and enabled to work.'].join(' '));}} 4048var _getComputedStyle=getComputedStyle(popper),marginTop=_getComputedStyle.marginTop,marginRight=_getComputedStyle.marginRight,marginBottom=_getComputedStyle.marginBottom,marginLeft=_getComputedStyle.marginLeft;if([marginTop,marginRight,marginBottom,marginLeft].some(function(margin){return parseFloat(margin);})){console.warn(['Popper: CSS "margin" styles cannot be used to apply padding','between the popper and its reference element or boundary.','To replicate margin, use the `offset` modifier, as well as','the `padding` option in the `preventOverflow` and `flip`','modifiers.'].join(' '));}} 4049runModifierEffects();return instance.update();},forceUpdate:function forceUpdate(){if(isDestroyed){return;} 4050var _state$elements=state.elements,reference=_state$elements.reference,popper=_state$elements.popper;if(!areValidElements(reference,popper)){{console.error(INVALID_ELEMENT_ERROR);} 4051return;} 4052state.rects={reference:getCompositeRect(reference,getOffsetParent(popper),state.options.strategy==='fixed'),popper:getLayoutRect(popper)};state.reset=false;state.placement=state.options.placement;state.orderedModifiers.forEach(function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data);});var __debug_loops__=0;for(var index=0;index<state.orderedModifiers.length;index++){{__debug_loops__+=1;if(__debug_loops__>100){console.error(INFINITE_LOOP_ERROR);break;}} 4053if(state.reset===true){state.reset=false;index=-1;continue;} 4054var _state$orderedModifie=state.orderedModifiers[index],fn=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,name=_state$orderedModifie.name;if(typeof fn==='function'){state=fn({state:state,options:_options,name:name,instance:instance})||state;}}},update:debounce(function(){return new Promise(function(resolve){instance.forceUpdate();resolve(state);});}),destroy:function destroy(){cleanupModifierEffects();isDestroyed=true;}};if(!areValidElements(reference,popper)){{console.error(INVALID_ELEMENT_ERROR);} 4055return instance;} 4056instance.setOptions(options).then(function(state){if(!isDestroyed&&options.onFirstUpdate){options.onFirstUpdate(state);}});
vendor: 4,172 bytes, lines 4056-4070
4056function runModifierEffects(){state.orderedModifiers.forEach(function(_ref3){var name=_ref3.name,_ref3$options=_ref3.options,options=_ref3$options===void 0?{}:_ref3$options,effect=_ref3.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});} 4057function cleanupModifierEffects(){effectCleanupFns.forEach(function(fn){return fn();});effectCleanupFns=[];} 4058return instance;};} 4059var passive={passive:true};function effect$2(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options;var _options$scroll=options.scroll,scroll=_options$scroll===void 0?true:_options$scroll,_options$resize=options.resize,resize=_options$resize===void 0?true:_options$resize;var window=getWindow(state.elements.popper);var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.addEventListener('scroll',instance.update,passive);});} 4060if(resize){window.addEventListener('resize',instance.update,passive);} 4061return function(){if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.removeEventListener('scroll',instance.update,passive);});} 4062if(resize){window.removeEventListener('resize',instance.update,passive);}};} 4063var eventListeners={name:'eventListeners',enabled:true,phase:'write',fn:function fn(){},effect:effect$2,data:{}};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,strategy:'absolute',placement:state.placement});} 4064var popperOffsets$1={name:'popperOffsets',enabled:true,phase:'read',fn:popperOffsets,data:{}};var unsetSides={top:'auto',right:'auto',bottom:'auto',left:'auto'};function roundOffsetsByDPR(_ref){var x=_ref.x,y=_ref.y;var win=window;var dpr=win.devicePixelRatio||1;return{x:round(x*dpr)/dpr||0,y:round(y*dpr)/dpr||0};} 4065function mapToStyles(_ref2){var _Object$assign2;var popper=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,variation=_ref2.variation,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets,isFixed=_ref2.isFixed;var _offsets$x=offsets.x,x=_offsets$x===void 0?0:_offsets$x,_offsets$y=offsets.y,y=_offsets$y===void 0?0:_offsets$y;var _ref3=typeof roundOffsets==='function'?roundOffsets({x:x,y:y}):{x:x,y:y};x=_ref3.x;y=_ref3.y;var hasX=offsets.hasOwnProperty('x');var hasY=offsets.hasOwnProperty('y');var sideX=left;var sideY=top;var win=window;if(adaptive){var offsetParent=getOffsetParent(popper);var heightProp='clientHeight';var widthProp='clientWidth';if(offsetParent===getWindow(popper)){offsetParent=getDocumentElement(popper);if(getComputedStyle(offsetParent).position!=='static'&&position==='absolute'){heightProp='scrollHeight';widthProp='scrollWidth';}} 4066offsetParent=offsetParent;if(placement===top||(placement===left||placement===right)&&variation===end){sideY=bottom;var offsetY=isFixed&&win.visualViewport?win.visualViewport.height:offsetParent[heightProp];y-=offsetY-popperRect.height;y*=gpuAcceleration?1:-1;} 4067if(placement===left||(placement===top||placement===bottom)&&variation===end){sideX=right;var offsetX=isFixed&&win.visualViewport?win.visualViewport.width:offsetParent[widthProp];x-=offsetX-popperRect.width;x*=gpuAcceleration?1:-1;}} 4068var commonStyles=Object.assign({position:position},adaptive&&unsetSides);var _ref4=roundOffsets===true?roundOffsetsByDPR({x:x,y:y}):{x:x,y:y};x=_ref4.x;y=_ref4.y;if(gpuAcceleration){var _Object$assign;return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?'0':'',_Object$assign[sideX]=hasX?'0':'',_Object$assign.transform=(win.devicePixelRatio||1)<=1?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign));} 4069return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":'',_Object$assign2[sideX]=hasX?x+"px":'',_Object$assign2.transform='',_Object$assign2));} 4070function computeStyles(_ref5){var state=_ref5.state,options=_ref5.options;
vendor: 1,550 bytes, lines 4070-4071
4070var _options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=_options$adaptive===void 0?true:_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=_options$roundOffsets===void 0?true:_options$roundOffsets;{var transitionProperty=getComputedStyle(state.elements.popper).transitionProperty||'';if(adaptive&&['transform','top','right','bottom','left'].some(function(property){return transitionProperty.indexOf(property)>=0;})){console.warn(['Popper: Detected CSS transitions on at least one of the following','CSS properties: "transform", "top", "right", "bottom", "left".','\n\n','Disable the "computeStyles" modifier\'s `adaptive` option to allow','for smooth transitions, or remove these properties from the CSS','transition declaration on the popper element if only transitioning','opacity or background-color for example.','\n\n','We recommend using the popper element as a wrapper around an inner','element that can have any CSS property transitioned for animations.'].join(' '));}} 4071var commonStyles={placement:getBasePlacement(state.placement),variation:getVariation(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration,isFixed:state.options.strategy==='fixed'};if(state.modifiersData.popperOffsets!=null){state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.o
vendor: 1,047 bytes, lines 4071-4076
4071ptions.strategy,adaptive:adaptive,roundOffsets:roundOffsets})));} 4072if(state.modifiersData.arrow!=null){state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:'absolute',adaptive:false,roundOffsets:roundOffsets})));} 4073state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-placement':state.placement});} 4074var computeStyles$1={name:'computeStyles',enabled:true,phase:'beforeWrite',fn:computeStyles,data:{}};function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];if(!isHTMLElement(element)||!getNodeName(element)){return;} 4075Object.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else{element.setAttribute(name,value===true?'':value);}});});} 4076function effect$1(_ref2){var state=_ref2.state;
vendor: 16,074 bytes, lines 4076-4116
4076var initialStyles={popper:{position:state.options.strategy,left:'0',top:'0',margin:'0'},arrow:{position:'absolute'},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper);state.styles=initialStyles;if(state.elements.arrow){Object.assign(state.elements.arrow.style,initialStyles.arrow);} 4077return function(){Object.keys(state.elements).forEach(function(name){var element=state.elements[name];var attributes=state.attributes[name]||{};var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);var style=styleProperties.reduce(function(style,property){style[property]='';return style;},{});if(!isHTMLElement(element)||!getNodeName(element)){return;} 4078Object.assign(element.style,style);Object.keys(attributes).forEach(function(attribute){element.removeAttribute(attribute);});});};} 4079var applyStyles$1={name:'applyStyles',enabled:true,phase:'write',fn:applyStyles,effect:effect$1,requires:['computeStyles']};function distanceAndSkiddingToXY(placement,rects,offset){var basePlacement=getBasePlacement(placement);var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;var _ref=typeof offset==='function'?offset(Object.assign({},rects,{placement:placement})):offset,skidding=_ref[0],distance=_ref[1];skidding=skidding||0;distance=(distance||0)*invertDistance;return[left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance};} 4080function offset(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name;var _options$offset=options.offset,offset=_options$offset===void 0?[0,0]:_options$offset;var data=placements.reduce(function(acc,placement){acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset);return acc;},{});var _data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;if(state.modifiersData.popperOffsets!=null){state.modifiersData.popperOffsets.x+=x;state.modifiersData.popperOffsets.y+=y;} 4081state.modifiersData[name]=data;} 4082var offset$1={name:'offset',enabled:true,phase:'main',requires:['popperOffsets'],fn:offset};var hash$1={left:'right',right:'left',bottom:'top',top:'bottom'};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,function(matched){return hash$1[matched];});} 4083var hash={start:'end',end:'start'};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,function(matched){return hash[matched];});} 4084function computeAutoPlacement(state,options){if(options===void 0){options={};} 4085var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement){return getVariation(placement)===variation;}):basePlacements;var allowedPlacements=placements$1.filter(function(placement){return allowedAutoPlacements.indexOf(placement)>=0;});if(allowedPlacements.length===0){allowedPlacements=placements$1;{console.error(['Popper: The `allowedAutoPlacements` option did not allow any','placements. Ensure the `placement` option matches the variation','of the allowed placements.','For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(' '));}} 4086var overflows=allowedPlacements.reduce(function(acc,placement){acc[placement]=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement)];return acc;},{});return Object.keys(overflows).sort(function(a,b){return overflows[a]-overflows[b];});} 4087function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return[];} 4088var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)];} 4089function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return;} 4090var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?true:_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements;var preferredPlacement=state.options.placement;var basePlacement=getBasePlacement(preferredPlacement);var isBasePlacement=basePlacement===preferredPlacement;var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));var placements=[preferredPlacement].concat(fallbackPlacements).reduce(function(acc,placement){return acc.concat(getBasePlacement(placement)===auto?computeAutoPlacement(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement);},[]);var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var checksMap=new Map();var makeFallbackChecks=true;var firstFittingPlacement=placements[0];for(var i=0;i<placements.length;i++){var placement=placements[i];var _basePlacement=getBasePlacement(placement);var isStartVariation=getVariation(placement)===start;var isVertical=[top,bottom].indexOf(_basePlacement)>=0;var len=isVertical?'width':'height';var overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding});var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide);} 4091var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0);} 4092if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0);} 4093if(checks.every(function(check){return check;})){firstFittingPlacement=placement;makeFallbackChecks=false;break;} 4094checksMap.set(placement,checks);} 4095if(makeFallbackChecks){var numberOfChecks=flipVariations?3:1;var _loop=function _loop(_i){var fittingPlacement=placements.find(function(placement){var checks=checksMap.get(placement);if(checks){return checks.slice(0,_i).every(function(check){return check;});}});if(fittingPlacement){firstFittingPlacement=fittingPlacement;return"break";}};for(var _i=numberOfChecks;_i>0;_i--){var _ret=_loop(_i);if(_ret==="break")break;}} 4096if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true;}} 4097var flip$1={name:'flip',enabled:true,phase:'main',fn:flip,requiresIfExists:['offset'],data:{_skip:false}};function getAltAxis(axis){return axis==='x'?'y':'x';} 4098function within(min$1,value,max$1){return max(min$1,min(value,max$1));} 4099function withinMaxClamp(min,value,max){var v=within(min,value,max);return v>max?max:v;} 4100function preventOverflow(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=_options$tether===void 0?true:_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;var overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary});var basePlacement=getBasePlacement(state.placement);var variation=getVariation(state.placement);var isBasePlacement=!variation;var mainAxis=getMainAxisFromPlacement(basePlacement);var altAxis=getAltAxis(mainAxis);var popperOffsets=state.modifiersData.popperOffsets;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var tetherOffsetValue=typeof tetherOffset==='function'?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset;var normalizedTetherOffsetValue=typeof tetherOffsetValue==='number'?{mainAxis:tetherOffsetValue,altAxis:tetherOffsetValue}:Object.assign({mainAxis:0,altAxis:0},tetherOffsetValue);var offsetModifierState=state.modifiersData.offset?state.modifiersData.offset[state.placement]:null;var data={x:0,y:0};if(!popperOffsets){return;} 4101if(checkMainAxis){var _offsetModifierState$;var mainSide=mainAxis==='y'?top:left;var altSide=mainAxis==='y'?bottom:right;var len=mainAxis==='y'?'height':'width';var offset=popperOffsets[mainAxis];var min$1=offset+overflow[mainSide];var max$1=offset-overflow[altSide];var additive=tether?-popperRect[len]/2:0;var minLen=variation===start?referenceRect[len]:popperRect[len];var maxLen=variation===start?-popperRect[len]:-referenceRect[len];var arrowElement=state.elements.arrow;var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0};var arrowPaddingObject=state.modifiersData['arrow#persistent']?state.modifiersData['arrow#persistent'].padding:getFreshSideObject();var arrowPaddingMin=arrowPaddingObject[mainSide];var arrowPaddingMax=arrowPaddingObject[altSide];var arrowLen=within(0,referenceRect[len],arrowRect[len]);var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis:minLen-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis;var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis:maxLen+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis;var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);var clientOffset=arrowOffsetParent?mainAxis==='y'?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;var offsetModifierValue=(_offsetModifierState$=offsetModifierState==null?void 0:offsetModifierState[mainAxis])!=null?_offsetModifierState$:0;var tetherMin=offset+minOffset-offsetModifierValue-clientOffset;var tetherMax=offset+maxOffset-offsetModifierValue;var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset,tether?max(max$1,tetherMax):max$1);popperOffsets[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset;} 4102if(checkAltAxis){var _offsetModifierState$2;var _mainSide=mainAxis==='x'?top:left;var _altSide=mainAxis==='x'?bottom:right;var _offset=popperOffsets[altAxis];var _len=altAxis==='y'?'height':'width';var _min=_offset+overflow[_mainSide];var _max=_offset-overflow[_altSide];var isOriginSide=[top,left].indexOf(basePlacement)!==-1;var _offsetModifierValue=(_offsetModifierState$2=offsetModifierState==null?void 0:offsetModifierState[altAxis])!=null?_offsetModifierState$2:0;var _tetherMin=isOriginSide?_min:_offset-referenceRect[_len]-popperRect[_len]-_offsetModifierValue+normalizedTetherOffsetValue.altAxis;var _tetherMax=isOriginSide?_offset+referenceRect[_len]+popperRect[_len]-_offsetModifierValue-normalizedTetherOffsetValue.altAxis:_max;var _preventedOffset=tether&&isOriginSide?withinMaxClamp(_tetherMin,_offset,_tetherMax):within(tether?_tetherMin:_min,_offset,tether?_tetherMax:_max);popperOffsets[altAxis]=_preventedOffset;data[altAxis]=_preventedOffset-_offset;} 4103state.modifiersData[name]=data;} 4104var preventOverflow$1={name:'preventOverflow',enabled:true,phase:'main',fn:preventOverflow,requiresIfExists:['offset']};var toPaddingObject=function toPaddingObject(padding,state){padding=typeof padding==='function'?padding(Object.assign({},state.rects,{placement:state.placement})):padding;return mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));};function arrow(_ref){var _state$modifiersData$;var state=_ref.state,name=_ref.name,options=_ref.options;var arrowElement=state.elements.arrow;var popperOffsets=state.modifiersData.popperOffsets;var basePlacement=getBasePlacement(state.placement);var axis=getMainAxisFromPlacement(basePlacement);var isVertical=[left,right].indexOf(basePlacement)>=0;var len=isVertical?'height':'width';if(!arrowElement||!popperOffsets){return;} 4105var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==='y'?top:left;var maxProp=axis==='y'?bottom:right;var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets[axis]-state.rects.popper[len];var startDiff=popperOffsets[axis]-state.rects.reference[axis];var arrowOffsetParent=getOffsetParent(arrowElement);var clientSize=arrowOffsetParent?axis==='y'?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;var centerToReference=endDiff/2-startDiff/2;var min=paddingObject[minProp];var max=clientSize-arrowRect[len]-paddingObject[maxProp];var center=clientSize/2-arrowRect[len]/2+centerToReference;var offset=within(min,center,max);var axisProp=axis;state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset,_state$modifiersData$.centerOffset=offset-center,_state$modifiersData$);} 4106function effect(_ref2){var state=_ref2.state,options=_ref2.options;var _options$element=options.element,arrowElement=_options$element===void 0?'[data-popper-arrow]':_options$element;if(arrowElement==null){return;} 4107if(typeof arrowElement==='string'){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return;}} 4108{if(!isHTMLElement(arrowElement)){console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).','To use an SVG arrow, wrap it in an HTMLElement that will be used as','the arrow.'].join(' '));}} 4109if(!contains(state.elements.popper,arrowElement)){{console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper','element.'].join(' '));} 4110return;} 4111state.elements.arrow=arrowElement;} 4112var arrow$1={name:'arrow',enabled:true,phase:'main',fn:arrow,effect:effect,requires:['popperOffsets'],requiresIfExists:['preventOverflow']};function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0};} 4113return{top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x};} 4114function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some(function(side){return overflow[side]>=0;});} 4115function hide(_ref){var state=_ref.state,name=_ref.name;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var preventedOffsets=state.modifiersData.preventOverflow;var referenceOverflow=detectOverflow(state,{elementContext:'reference'});var popperAltOverflow=detectOverflow(state,{altBoundary:true});var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped};state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-reference-hidden':isReferenceHidden,'data-popper-escaped':hasPopperEscaped});} 4116var hide$1={name:'hide',enabled:true,phase:'main',requiresIfExists:['preventOverflow'],fn:hide};var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1];
4116var createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});exports.applyStyles=applyStyles$1;exports.arrow=arrow$1;exports.computeStyles=computeStyles$1;exports.createPopper=createPopper;exports.createPopperLite=createPopper$1;exports.defaultModifiers=defaultModifiers;exports.detectOverflow=detectOverflow;exports.eventListeners=eventListeners;exports.flip=flip$1;exports.hide=hide$1;exports.offset=offset$1;exports.popperGenerator=popperGenerator;exports.popperOffsets=popperOffsets$1;exports.preventOverflow=preventOverflow$1;Object.defineProperty(exports,'__esModule',{value:true});})));; 4117 4118/* /web/static/lib/bootstrap/js/dist/dom/data.js */ 4119(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Data=factory());})(this,(function(){'use strict';const elementMap=new Map();const data={set(element,key,instance){if(!elementMap.has(element)){elementMap.set(element,new Map());} 4120const instanceMap=elementMap.get(element);if(!instanceMap.has(key)&&instanceMap.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);return;} 4121instanceMap.set(key,instance);},get(element,key){if(elementMap.has(element)){return elementMap.get(element).get(key)||null;} 4122return null;},remove(element,key){if(!elementMap.has(element)){return;} 4123const instanceMap=elementMap.get(element);instanceMap.delete(key);if(instanceMap.size===0){elementMap.delete(element);}}};return data;}));; 4124 4125/* /web/static/lib/bootstrap/js/dist/dom/event-handler.js */ 4126(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.EventHandler=factory());})(this,(function(){'use strict';const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4127return null;};const namespaceRegex=/[^.]*(?=\..*)\.|.*/;const stripNameRegex=/\..*/;const stripUidRegex=/::\d+$/;const eventRegistry={};let uidEvent=1;const customEvents={mouseenter:'mouseover',mouseleave:'mouseout'};const customEventsRegex=/^(mouseenter|mouseleave)/i;const nativeEvents=new Set(['click','dblclick','mouseup','mousedown','contextmenu','mousewheel','DOMMouseScroll','mouseover','mouseout','mousemove','selectstart','selectend','keydown','keypress','keyup','orientationchange','touchstart','touchmove','touchend','touchcancel','pointerdown','pointermove','pointerup','pointerleave','pointercancel','gesturestart','gesturechange','gestureend','focus','blur','change','reset','select','submit','focusin','focusout','load','unload','beforeunload','resize','move','DOMContentLoaded','readystatechange','error','abort','scroll']);function getUidEvent(element,uid){return uid&&`${uid}::${uidEvent++}`||element.uidEvent||uidEvent++;} 4128function getEvent(element){const uid=getUidEvent(element);element.uidEvent=uid;eventRegistry[uid]=eventRegistry[uid]||{};return eventRegistry[uid];} 4129function bootstrapHandler(element,fn){return function handler(event){event.delegateTarget=element;if(handler.oneOff){EventHandler.off(element,event.type,fn);} 4130return fn.apply(element,[event]);};} 4131function bootstrapDelegationHandler(element,selector,fn){return function handler(event){const domElements=element.querySelectorAll(selector);for(let{target}=event;target&&target!==this;target=target.parentNode){for(let i=domElements.length;i--;){if(domElements[i]===target){event.delegateTarget=target;if(handler.oneOff){EventHandler.off(element,event.type,selector,fn);} 4132return fn.apply(target,[event]);}}} 4133return null;};} 4134function findHandler(events,handler,delegationSelector=null){const uidEventList=Object.keys(events);for(let i=0,len=uidEventList.length;i<len;i++){const event=events[uidEventList[i]];if(event.originalHandler===handler&&event.delegationSelector===delegationSelector){return event;}} 4135return null;} 4136function normalizeParams(originalTypeEvent,handler,delegationFn){const delegation=typeof handler==='string';const originalHandler=delegation?delegationFn:handler;let typeEvent=getTypeEvent(originalTypeEvent);const isNative=nativeEvents.has(typeEvent);if(!isNative){typeEvent=originalTypeEvent;} 4137return[delegation,originalHandler,typeEvent];} 4138function addHandler(element,originalTypeEvent,handler,delegationFn,oneOff){if(typeof originalTypeEvent!=='string'||!element){return;} 4139if(!handler){handler=delegationFn;delegationFn=null;} 4140if(customEventsRegex.test(originalTypeEvent)){const wrapFn=fn=>{return function(event){if(!event.relatedTarget||event.relatedTarget!==event.delegateTarget&&!event.delegateTarget.contains(event.relatedTarget)){return fn.c
4140all(this,event);}};};if(delegationFn){delegationFn=wrapFn(delegationFn);}else{handler=wrapFn(handler);}} 4141const[delegation,originalHandler,typeEvent]=normalizeParams(originalTypeEvent,handler,delegationFn);const events=getEvent(element);const handlers=events[typeEvent]||(events[typeEvent]={});const previousFn=findHandler(handlers,originalHandler,delegation?handler:null);if(previousFn){previousFn.oneOff=previousFn.oneOff&&oneOff;return;} 4142const uid=getUidEvent(originalHandler,originalTypeEvent.replace(namespaceRegex,''));const fn=delegation?bootstrapDelegationHandler(element,handler,delegationFn):bootstrapHandler(element,handler);fn.delegationSelector=delegation?handler:null;fn.originalHandler=originalHandler;fn.oneOff=oneOff;fn.uidEvent=uid;handlers[uid]=fn;element.addEventListener(typeEvent,fn,delegation);} 4143function removeHandler(element,events,typeEvent,handler,delegationSelector){const fn=findHandler(events[typeEvent],handler,delegationSelector);if(!fn){return;} 4144element.removeEventListener(typeEvent,fn,Boolean(delegationSelector));delete events[typeEvent][fn.uidEvent];} 4145function removeNamespacedHandlers(element,events,typeEvent,namespace){const storeElementEvent=events[typeEvent]||{};Object.keys(storeElementEvent).forEach(handlerKey=>{if(handlerKey.includes(namespace)){const event=storeElementEvent[handlerKey];removeHandler(element,events,typeEvent,event.originalHandler,event.delegationSelector);}});} 4146function getTypeEvent(event){event=event.replace(stripNameRegex,'');return customEvents[event]||event;} 4147const EventHandler={on(element,event,handler,delegationFn){addHandler(element,event,handler,delegationFn,false);},one(element,event,handler,delegationFn){addHandler(element,event,handler,delegationFn,true);},off(element,originalTypeEvent,handler,delegationFn){if(typeof originalTypeEvent!=='string'||!element){return;} 4148const[delegation,originalHandler,typeEvent]=normalizeParams(originalTypeEvent,handler,delegationFn);const inNamespace=typeEvent!==originalTypeEvent;const events=getEvent(element);const isNamespace=originalTypeEvent.startsWith('.');if(typeof originalHandler!=='undefined'){if(!events||!events[typeEvent]){return;} 4149removeHandler(element,events,typeEvent,originalHandler,delegation?handler:null);return;} 4150if(isNamespace){Object.keys(events).forEach(elementEvent=>{removeNamespacedHandlers(element,events,elementEvent,originalTypeEvent.slice(1));});} 4151const storeElementEvent=events[typeEvent]||{};Object.keys(storeElementEvent).forEach(keyHandlers=>{const handlerKey=keyHandlers.replace(stripUidRegex,'');if(!inNamespace||originalTypeEvent.includes(handlerKey)){const event=storeElementEvent[keyHandlers];removeHandler(element,events,typeEvent,event.originalHandler,event.delegationSelector);}});},trigger(element,event,args){if(typeof event!=='string'||!element){return null;} 4152const $=getjQuery();const typeEvent=getTypeEvent(event);const inNamespace=event!==typeEvent;const isNative=nativeEvents.has(typeEvent);let jQueryEvent;let bubbles=true;let nativeDispatch=true;let defaultPrevented=false;let evt=null;if(inNamespace&&$){jQueryEvent=$.Event(event,args);$(element).trigger(jQueryEvent);bubbles=!jQueryEvent.isPropagationStopped();nativeDispatch=!jQueryEvent.isImmediatePropagationStopped();defaultPrevented=jQueryEvent.isDefaultPrevented();} 4153if(isNative){evt=document.createEvent('HTMLEvents');evt.initEvent(typeEvent,bubbles,true);}else{evt=new CustomEvent(event,{bubbles,cancelable:true});} 4154if(typeof args!=='undefined'){Object.keys(args).forEach(key=>{Object.defineProperty(evt,key,{get(){return args[key];}});});} 4155if(defaultPrevented){evt.preventDefault();} 4156if(nativeDispatch){element.dispatchEvent(evt);} 4157if(evt.defaultPrevented&&typeof jQueryEvent!=='undefined'){jQueryEvent.preventDefault();} 4158return evt;}};return EventHandler;}));; 4159 4160/* /web/static/lib/bootstrap/js/dist/dom/manipulator.js */ 4161(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Manipulator=factory());})(this,(function(){'use strict';function normalizeData(val){if(val==='true'){return true;} 4162if(val==='false'){return false;} 4163if(val===Number(val).toString()){return Number(val);} 4164if(val===''||val==='null'){return null;} 4165return val;} 4166function normalizeDataKey(key){return key.replace(/[A-Z]/g,chr=>`-${chr.toLowerCase()}`);} 4167const Manipulator={setDataAttribute(element,key,value){element.setAttribute(`data-bs-${normalizeDataKey(key)}`,value);},removeDataAttribute(element,key){element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);},getDataAttributes(element){if(!element){return{};} 4168const attributes={};Object.keys(element.dataset).filter(key=>
4168key.startsWith('bs')).forEach(key=>{let pureKey=key.replace(/^bs/,'');pureKey=pureKey.charAt(0).toLowerCase()+pureKey.slice(1,pureKey.length);attributes[pureKey]=normalizeData(element.dataset[key]);});return attributes;},getDataAttribute(element,key){return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));},offset(element){const rect=element.getBoundingClientRect();return{top:rect.top+window.pageYOffset,left:rect.left+window.pageXOffset};},position(element){return{top:element.offsetTop,left:element.offsetLeft};}};return Manipulator;}));; 4169 4170/* /web/static/lib/bootstrap/js/dist/dom/selector-engine.js */ 4171(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.SelectorEngine=factory());})(this,(function(){'use strict';const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4172if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4173return typeof obj.nodeType!=='undefined';};const isVisible=element=>{if(!isElement(element)||element.getClientRects().length===0){return false;} 4174return getComputedStyle(element).getPropertyValue('visibility')==='visible';};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4175if(element.classList.contains('disabled')){return true;} 4176if(typeof element.disabled!=='undefined'){return element.disabled;} 4177return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const NODE_TEXT=3;const SelectorEngine={find(selector,element=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(element,selector));},findOne(selector,element=document.documentElement){return Element.prototype.querySelector.call(element,selector);},children(element,selector){return[].concat(...element.children).filter(child=>child.matches(selector));},parents(element,selector){const parents=[];let ancestor=element.parentNode;while(ancestor&&ancestor.nodeType===Node.ELEMENT_NODE&&ancestor.nodeType!==NODE_TEXT){if(ancestor.matches(selector)){parents.push(ancestor);} 4178ancestor=ancestor.parentNode;} 4179return parents;},prev(element,selector){let previous=element.previousElementSibling;while(previous){if(previous.matches(selector)){return[previous];} 4180previous=previous.previousElementSibling;} 4181return[];},next(element,selector){let next=element.nextElementSibling;while(next){if(next.matches(selector)){return[next];} 4182next=next.nextElementSibling;} 4183return[];},focusableChildren(element){const focusables=['a','button','input','textarea','select','details','[tabindex]','[contenteditable="true"]'].map(selector=>`${selector}:not([tabindex^="-"])`).join(', ');return this.find(focusables,element).filter(el=>!isDisabled(el)&&isVisible(el));}};return SelectorEngine;}));; 4184 4185/* /web/static/lib/bootstrap/js/dist/base-component.js */ 4186(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/data.js'),require('./dom/event-handler.js')):typeof define==='function'&&define.amd?define(['./dom/data','./dom/event-handler'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Base=factory(global.Data,global.EventHandler));})(this,(function(Data,EventHandler){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const Data__default=_interopDefaultLegacy(Data);const EventHandler__default=_interopDefaultLegacy(EventHandler);const MILLISECONDS_MULTIPLIER=1000;const TRANSITION_END='transitionend';const getTransitionDurationFromElement=element=>{if(!element){return 0;} 4187let{transitionDuration,transitionDelay}=window.getComputedStyle(element);const floatTransitionDuration=Number.parseFloat(transitionDuration);const floatTransitionDelay=Number.parseFloat(transitionDelay);if(!floatTransitionDuration&&!floatTransitionDelay){return 0;} 4188transitionDuration=transitionDuration.split(',')[0];transitionDelay=transitionDelay.split(',')[0];return(Number.parseFloat(transitionDuration)+Number.parseFloat(transitionDelay))*MILLISECONDS_MULTIPLIER;};const triggerTransitionEnd=element=>{element.dispatchEvent(new Event(TRANSITION_END));};const isElement=obj=>
4188{if(!obj||typeof obj!=='object'){return false;} 4189if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4190return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4191if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4192return null;};const execute=callback=>{if(typeof callback==='function'){callback();}};const executeAfterTransition=(callback,transitionElement,waitForTransition=true)=>{if(!waitForTransition){execute(callback);return;} 4193const durationPadding=5;const emulatedDuration=getTransitionDurationFromElement(transitionElement)+durationPadding;let called=false;const handler=({target})=>{if(target!==transitionElement){return;} 4194called=true;transitionElement.removeEventListener(TRANSITION_END,handler);execute(callback);};transitionElement.addEventListener(TRANSITION_END,handler);setTimeout(()=>{if(!called){triggerTransitionEnd(transitionElement);}},emulatedDuration);};const VERSION='5.1.3';class BaseComponent{constructor(element){element=getElement(element);if(!element){return;} 4195this._element=element;Data__default.default.set(this._element,this.constructor.DATA_KEY,this);} 4196dispose(){Data__default.default.remove(this._element,this.constructor.DATA_KEY);EventHandler__default.default.off(this._element,this.constructor.EVENT_KEY);Object.getOwnPropertyNames(this).forEach(propertyName=>{this[propertyName]=null;});} 4197_queueCallback(callback,element,isAnimated=true){executeAfterTransition(callback,element,isAnimated);} 4198static getInstance(element){return Data__default.default.get(getElement(element),this.DATA_KEY);} 4199static getOrCreateInstance(element,config={}){return this.getInstance(element)||new this(element,typeof config==='object'?config:null);} 4200static get VERSION(){return VERSION;} 4201static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!');} 4202static get DATA_KEY(){return`bs.${this.NAME}`;} 4203static get EVENT_KEY(){return`.${this.DATA_KEY}`;}} 4204return BaseComponent;}));; 4205 4206/* /web/static/lib/bootstrap/js/dist/alert.js */ 4207(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Alert=factory(global.EventHandler,global.Base));})(this,(function(EventHandler,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4208if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4209selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4210return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4211if(element.classList.contains('disabled')){return true;} 4212if(typeof element.disabled!=='undefined'){return element.disabled;} 4213return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4214return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4215DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const enableDismissTrigger=(component,method='hide')=>{const clickEvent=`click.dismiss${component.EVENT_KEY}`;const name=component.NAME;EventHandler__default.default.on(document,clickEvent,`[data-bs-dismiss="${name}"]`,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4216if(isDisabled(this)){return;} 4217const target=getElementFromSelector(this)||this.closest(`.${name}`);const instance=component.getOrCreateInstance(target);instance[method]();});};const NAME='alert';const DATA_KEY='bs.alert';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_CLOSE=`close${EVENT_KEY}`;const EVENT_CLOSED=`closed${EVENT_KEY}`;const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';class Alert extends BaseComponent__default.default{static get NAME(){return NAME;} 4218close(){const closeEvent=EventHandler__default.default.trigger(this._element,EVENT_CLOSE);if(closeEvent.defaultPrevented){return;} 4219this._element.classList.remove(CLASS_NAME_SHOW);const isAnimated=this._element.classList.contains(CLASS_NAME_FADE);this._queueCallback(()=>this._destroyElement(),this._element,isAnimated);} 4220_destroyElement(){this._element.remove();EventHandler__default.default.trigger(this._element,EVENT_CLOSED);this.dispose();} 4221static jQueryInterface(config){return this.each(function(){const data=Alert.getOrCreateInstance(this);if(typeof config!=='string'){return;} 4222if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method n
4222amed "${config}"`);} 4223data[config](this);});}} 4224enableDismissTrigger(Alert,'close');defineJQueryPlugin(Alert);return Alert;}));; 4225 4226/* /web/static/lib/bootstrap/js/dist/button.js */ 4227(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Button=factory(global.EventHandler,global.Base));})(this,(function(EventHandler,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4228return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4229DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const NAME='button';const DATA_KEY='bs.button';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const CLASS_NAME_ACTIVE='active';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="button"]';const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;class Button extends BaseComponent__default.default{static get NAME(){return NAME;} 4230toggle(){this._element.setAttribute('aria-pressed',this._element.classList.toggle(CLASS_NAME_ACTIVE));} 4231static jQueryInterface(config){return this.each(function(){const data=Button.getOrCreateInstance(this);if(config==='toggle'){data[config]();}});}} 4232EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,event=>{event.preventDefault();const button=event.target.closest(SELECTOR_DATA_TOGGLE);const data=Button.getOrCreateInstance(button);data.toggle();});defineJQueryPlugin(Button);return Button;}));; 4233 4234/* /web/static/lib/bootstrap/js/dist/carousel.js */ 4235(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./dom/manipulator','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Carousel=factory(global.EventHandler,global.Manipulator,global.SelectorEngine,global.Base));})(this,(function(EventHandler,Manipulator,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const TRANSITION_END='transitionend';const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4236return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4237if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4238selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4239return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const triggerTransitionEnd=element=>{element.dispatchEvent(new Event(TRANSITION_END));};const isElement=obj=>
4239{if(!obj||typeof obj!=='object'){return false;} 4240if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4241return typeof obj.nodeType!=='undefined';};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const isVisible=element=>{if(!isElement(element)||element.getClientRects().length===0){return false;} 4242return getComputedStyle(element).getPropertyValue('visibility')==='visible';};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4243return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4244DOMContentLoadedCallbacks.push(callback);}else{callback();}};const isRTL=()=>document.documentElement.dir==='rtl';const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const getNextActiveElement=(list,activeElement,shouldGetNext,isCycleAllowed)=>{let index=list.indexOf(activeElement);if(index===-1){return list[!shouldGetNext&&isCycleAllowed?list.length-1:0];} 4245const listLength=list.length;index+=shouldGetNext?1:-1;if(isCycleAllowed){index=(index+listLength)%listLength;} 4246return list[Math.max(0,Math.min(index,listLength-1))];};const NAME='carousel';const DATA_KEY='bs.carousel';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const ARROW_LEFT_KEY='ArrowLeft';const ARROW_RIGHT_KEY='ArrowRight';const TOUCHEVENT_COMPAT_WAIT=500;const SWIPE_THRESHOLD=40;const Default={interval:5000,keyboard:true,slide:false,pause:'hover',wrap:true,touch:true};const DefaultType={interval:'(number|boolean)',keyboard:'boolean',slide:'(boolean|string)',pause:'(string|boolean)',wrap:'boolean',touch:'boolean'};const ORDER_NEXT='next';const ORDER_PREV='prev';const DIRECTION_LEFT='left';const DIRECTION_RIGHT='right';const KEY_TO_DIRECTION={[ARROW_LEFT_KEY]:DIRECTION_RIGHT,[ARROW_RIGHT_KEY]:DIRECTION_LEFT};const EVENT_SLIDE=`slide${EVENT_KEY}`;const EVENT_SLID=`slid${EVENT_KEY}`;const EVENT_KEYDOWN=`keydown${EVENT_KEY}`;const EVENT_MOUSEENTER=`mouseenter${EVENT_KEY}`;const EVENT_MOUSELEAVE=`mouseleave${EVENT_KEY}`;const EVENT_TOUCHSTART=`touchstart${EVENT_KEY}`;const EVENT_TOUCHMOVE=`touchmove${EVENT_KEY}`;const EVENT_TOUCHEND=`touchend${EVENT_KEY}`;const EVENT_POINTERDOWN=`pointerdown${EVENT_KEY}`;const EVENT_POINTERUP=`pointerup${EVENT_KEY}`;const EVENT_DRAG_START=`dragstart${EVENT_KEY}`;const EVENT_LOAD_DATA_API=`load${EVENT_KEY}${DATA_API_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_CAROUSEL='carousel';const CLASS_NAME_ACTIVE='active';const CLASS_NAME_SLIDE='slide';const CLASS_NAME_END='carousel-item-end';const CLASS_NAME_START='carousel-item-start';const CLASS_NAME_NEXT='carousel-item-next';const CLASS_NAME_PREV='carousel-item-prev';const CLASS_NAME_POINTER_EVENT='pointer-event';const SELECTOR_ACTIVE='.active';const SELECTOR_ACTIVE_ITEM='.active.carousel-item';const SELECTOR_ITEM='.carousel-item';const SELECTOR_ITEM_IMG='.carousel-item img';const SELECTOR_NEXT_PREV='.carousel-item-next, .carousel-item-prev';const SELECTOR_INDICATORS='.carousel-indicators';const SELECTOR_INDICATOR='[data-bs-target]';const SELECTOR_DATA_SLIDE='[data-bs-slide], [data-bs-slide-to]';const SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]';const POINTER_TYPE_TOUCH='touch';const POINTER_TYPE_PEN='pen';class Carousel extends BaseComponent__default.default{constructor(element,config){super(element);this._items=null;this._interval=null;this._activeElement=null;this._isPaused=false;this._isSliding=false;this.touchTimeout=null;this.touchStartX=0;this.touchDeltaX=0;this._config=this._getConfig(config);this._indicatorsElement=SelectorEngine__default.default.findOne(SELECTOR_INDICATORS,this._element);this._touchSupported='ontouchstart'in document.documentElement||navigator.maxTouchPoints>0;this._pointerEvent=Boolean(window.PointerEvent);this._addEventListeners();} 4247static get Default(){return Default;} 4248static get NAME(){return NAME;} 4249next(){this._slide(ORDER_NEXT);} 4250nextWhenVisible(){if(!document.hidden&&isVisible(this._element)){this.next();}} 4251prev(){this._slide(ORDER_PREV);}
4252pause(event){if(!event){this._isPaused=true;} 4253if(SelectorEngine__default.default.findOne(SELECTOR_NEXT_PREV,this._element)){triggerTransitionEnd(this._element);this.cycle(true);} 4254clearInterval(this._interval);this._interval=null;} 4255cycle(event){if(!event){this._isPaused=false;} 4256if(this._interval){clearInterval(this._interval);this._interval=null;} 4257if(this._config&&this._config.interval&&!this._isPaused){this._updateInterval();this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval);}} 4258to(index){this._activeElement=SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM,this._element);const activeIndex=this._getItemIndex(this._activeElement);if(index>this._items.length-1||index<0){return;} 4259if(this._isSliding){EventHandler__default.default.one(this._element,EVENT_SLID,()=>this.to(index));return;} 4260if(activeIndex===index){this.pause();this.cycle();return;} 4261const order=index>activeIndex?ORDER_NEXT:ORDER_PREV;this._slide(order,this._items[index]);} 4262_getConfig(config){config={...Default,...Manipulator__default.default.getDataAttributes(this._element),...(typeof config==='object'?config:{})};typeCheckConfig(NAME,config,DefaultType);return config;} 4263_handleSwipe(){const absDeltax=Math.abs(this.touchDeltaX);if(absDeltax<=SWIPE_THRESHOLD){return;} 4264const direction=absDeltax/this.touchDeltaX;this.touchDeltaX=0;if(!direction){return;} 4265this._slide(direction>0?DIRECTION_RIGHT:DIRECTION_LEFT);} 4266_addEventListeners(){if(this._config.keyboard){EventHandler__default.default.on(this._element,EVENT_KEYDOWN,event=>this._keydown(event));} 4267if(this._config.pause==='hover'){EventHandler__default.default.on(this._element,EVENT_MOUSEENTER,event=>this.pause(event));EventHandler__default.default.on(this._element,EVENT_MOUSELEAVE,event=>this.cycle(event));} 4268if(this._config.touch&&this._touchSupported){this._addTouchEventListeners();}} 4269_addTouchEventListeners(){const hasPointerPenTouch=event=>{return this._pointerEvent&&(event.pointerType===POINTER_TYPE_PEN||event.pointerType===POINTER_TYPE_TOUCH);};const start=event=>{if(hasPointerPenTouch(event)){this.touchStartX=event.clientX;}else if(!this._pointerEvent){this.touchStartX=event.touches[0].clientX;}};const move=event=>{this.touchDeltaX=event.touches&&event.touches.length>1?0:event.touches[0].clientX-this.touchStartX;};const end=event=>{if(hasPointerPenTouch(event)){this.touchDeltaX=event.clientX-this.touchStartX;} 4270this._handleSwipe();if(this._config.pause==='hover'){this.pause();if(this.touchTimeout){clearTimeout(this.touchTimeout);} 4271this.touchTimeout=setTimeout(event=>this.cycle(event),TOUCHEVENT_COMPAT_WAIT+this._config.interval);}};SelectorEngine__default.default.find(SELECTOR_ITEM_IMG,this._element).forEach(itemImg=>{EventHandler__default.default.on(itemImg,EVENT_DRAG_START,event=>event.preventDefault());});if(this._pointerEvent){EventHandler__default.default.on(this._element,EVENT_POINTERDOWN,event=>start(event));EventHandler__default.default.on(this._element,EVENT_POINTERUP,event=>end(event));this._element.classList.add(CLASS_NAME_POINTER_EVENT);}else{EventHandler__default.default.on(this._element,EVENT_TOUCHSTART,event=>start(event));EventHandler__default.default.on(this._element,EVENT_TOUCHMOVE,event=>move(event));EventHandler__default.default.on(this._element,EVENT_TOUCHEND,event=>end(event));}} 4272_keydown(event){if(/input|textarea/i.test(event.target.tagName)){return;} 4273const direction=KEY_TO_DIRECTION[event.key];if(direction){event.preventDefault();this._slide(direction);}} 4274_getItemIndex(element){this._items=element&&element.parentNode?SelectorEngine__default.default.find(SELECTOR_ITEM,element.parentNode):[];return this._items.indexOf(element);} 4275_getItemByOrder(order,activeElement){const isNext=order===ORDER_NEXT;return getNextActiveElement(this._items,activeElement,isNext,this._config.wrap);} 4276_triggerSlideEvent(relatedTarget,eventDirectionName){const targetIndex=this._getItemIndex(relatedTarget);const fromIndex=this._getItemIndex(SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM,this._element));return EventHandler__default.default.trigger(this._element,EVENT_SLIDE,{relatedTarget,direction:eventDirectionName,from:fromIndex,to:targetIndex});} 4277_setActiveIndicatorElement(element){if(this._indicatorsElement){const activeIndicator=SelectorEngine__default.default.findOne(SELECTOR_ACTIVE,this._indicatorsElement);activeIndicator.classList.remove(CLASS_NAME_ACTIVE);activeIndicator.removeAttribute('aria-current');const indicators=SelectorEngine__default.default.find(SELECTOR_INDICATOR,this._indicatorsElement);for(let i=0;i<indicators.length;i++){if(Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'),10)===this._getItemIndex(element)){indicators[i].classList.add(CLASS_NAME_ACTIVE);indicators[i].setAttribute('aria-current','true');break;}}}} 4278_updateInterval(){const element=this._activeElement||SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM,this._element);if(!element){return;} 4279const elementInterval=Number.parseInt(element.getAttribute('data-bs-interval'),10);if(elementInterval){this._config.defaultInterval=this._config.defaultInterval||this._config.interval;this._config.interval=elementInterval;}else{this._config.interval=this._config.defaultInterval||this._config.interval;}}
4280_slide(directionOrOrder,element){const order=this._directionToOrder(directionOrOrder);const activeElement=SelectorEngine__default.default.findOne(SELECTOR_ACTIVE_ITEM,this._element);const activeElementIndex=this._getItemIndex(activeElement);const nextElement=element||this._getItemByOrder(order,activeElement);const nextElementIndex=this._getItemIndex(nextElement);const isCycling=Boolean(this._interval);const isNext=order===ORDER_NEXT;const directionalClassName=isNext?CLASS_NAME_START:CLASS_NAME_END;const orderClassName=isNext?CLASS_NAME_NEXT:CLASS_NAME_PREV;const eventDirectionName=this._orderToDirection(order);if(nextElement&&nextElement.classList.contains(CLASS_NAME_ACTIVE)){this._isSliding=false;return;} 4281if(this._isSliding){return;} 4282const slideEvent=this._triggerSlideEvent(nextElement,eventDirectionName);if(slideEvent.defaultPrevented){return;} 4283if(!activeElement||!nextElement){return;} 4284this._isSliding=true;if(isCycling){this.pause();} 4285this._setActiveIndicatorElement(nextElement);this._activeElement=nextElement;const triggerSlidEvent=()=>{EventHandler__default.default.trigger(this._element,EVENT_SLID,{relatedTarget:nextElement,direction:eventDirectionName,from:activeElementIndex,to:nextElementIndex});};if(this._element.classList.contains(CLASS_NAME_SLIDE)){nextElement.classList.add(orderClassName);reflow(nextElement);activeElement.classList.add(directionalClassName);nextElement.classList.add(directionalClassName);const completeCallBack=()=>{nextElement.classList.remove(directionalClassName,orderClassName);nextElement.classList.add(CLASS_NAME_ACTIVE);activeElement.classList.remove(CLASS_NAME_ACTIVE,orderClassName,directionalClassName);this._isSliding=false;setTimeout(triggerSlidEvent,0);};this._queueCallback(completeCallBack,activeElement,true);}else{activeElement.classList.remove(CLASS_NAME_ACTIVE);nextElement.classList.add(CLASS_NAME_ACTIVE);this._isSliding=false;triggerSlidEvent();} 4286if(isCycling){this.cycle();}} 4287_directionToOrder(direction){if(![DIRECTION_RIGHT,DIRECTION_LEFT].includes(direction)){return direction;} 4288if(isRTL()){return direction===DIRECTION_LEFT?ORDER_PREV:ORDER_NEXT;} 4289return direction===DIRECTION_LEFT?ORDER_NEXT:ORDER_PREV;} 4290_orderToDirection(order){if(![ORDER_NEXT,ORDER_PREV].includes(order)){return order;} 4291if(isRTL()){return order===ORDER_PREV?DIRECTION_LEFT:DIRECTION_RIGHT;} 4292return order===ORDER_PREV?DIRECTION_RIGHT:DIRECTION_LEFT;} 4293static carouselInterface(element,config){const data=Carousel.getOrCreateInstance(element,config);let{_config}=data;if(typeof config==='object'){_config={..._config,...config};} 4294const action=typeof config==='string'?config:_config.slide;if(typeof config==='number'){data.to(config);}else if(typeof action==='string'){if(typeof data[action]==='undefined'){throw new TypeError(`No method named "${action}"`);} 4295data[action]();}else if(_config.interval&&_config.ride){data.pause();data.cycle();}} 4296static jQueryInterface(config){return this.each(function(){Carousel.carouselInterface(this,config);});} 4297static dataApiClickHandler(event){const target=getElementFromSelector(this);if(!target||!target.classList.contains(CLASS_NAME_CAROUSEL)){return;} 4298const config={...Manipulator__default.default.getDataAttributes(target),...Manipulator__default.default.getDataAttributes(this)};const slideIndex=this.getAttribute('data-bs-slide-to');if(slideIndex){config.interval=false;} 4299Carousel.carouselInterface(target,config);if(slideIndex){Carousel.getInstance(target).to(slideIndex);} 4300event.preventDefault();}} 4301EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_SLIDE,Carousel.dataApiClickHandler);EventHandler__default.default.on(window,EVENT_LOAD_DATA_API,()=>{const carousels=SelectorEngine__default.default.find(SELECTOR_DATA_RIDE);for(let i=0,len=carousels.length;i<len;i++){Carousel.carouselInterface(carousels[i],Carousel.getInstance(carou
4301sels[i]));}});defineJQueryPlugin(Carousel);return Carousel;}));; 4302 4303/* /web/static/lib/bootstrap/js/dist/collapse.js */ 4304(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/data.js'),require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/data','./dom/event-handler','./dom/manipulator','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Collapse=factory(global.Data,global.EventHandler,global.Manipulator,global.SelectorEngine,global.Base));})(this,(function(Data,EventHandler,Manipulator,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const Data__default=_interopDefaultLegacy(Data);const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4305return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4306if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4307selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4308return selector;};const getSelectorFromElement=element=>{const selector=getSelector(element);if(selector){return document.querySelector(selector)?selector:null;} 4309return null;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4310if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4311return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4312if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4313return null;};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4314return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4315DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const NAME='collapse';const DATA_KEY='bs.collapse';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const Default={toggle:true,parent:null};const DefaultType={toggle:'boolean',parent:'(null|element)'};const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_SHOW='show';const CLASS_NAME_COLLAPSE='collapse';const CLASS_NAME_COLLAPSING='collapsing';const CLASS_NAME_COLLAPSED='collapsed';const CLASS_NAME_DEEPER_CHILDREN=`:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;const CLASS_NAME_HORIZONTAL='collapse-horizontal';const WIDTH='width';const HEIGHT='height';const SELECTOR_ACTIVES='.collapse.show, .collapse.collapsing';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="collapse"]';class Collapse extends BaseComponent__default.default{constructor(element,config){super(element);this._isTransitioning=false;this._config=this._getConfig(config);this._triggerArray=[];const toggleList=SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE);for(let i=0,len=toggleList.length;i<len;i++){const elem=toggleList[i];const selector=getSelectorFromElement(elem);const filterElement=SelectorEngine__default.default.find(selector).filter(foundElem=>foundElem===this._element);if(selector!==null&&filterElement.length){this._selector=selector;this._triggerArray.push(elem);}} 4316this._initializeChildren();if(!this._config.parent){this._addAriaAndCollapsedClass(this._triggerArray,this._isShown());} 4317if(this._config.toggle){this.toggle();}} 4318static get Default(){return Default;} 4319static get NAME(){return NAME;} 4320toggle(){if(this._isShown()){this.hide();}else{this.show();}} 4321show(){if(this._isTransitioning||this._isShown()){return;} 4322let actives=[];let activesData;if(this._config.parent){const children=SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);actives=SelectorEngine__default.default.find(SELECTOR_ACTIVES,this._config.parent).filter(elem=>!children.includes(elem));} 4323const container=SelectorEngine__default.default.findOne(this._selector);if(actives.length){const tempActiveData=actives.find(elem=>container!==elem);activesData=tempActiveData?Collapse.getInstance(tempActiveData):null;if(activesData&&activesData._isTransitioning){return;}} 4324const startEvent=EventHandler__default.default.trigger(this._element,EVENT_SHOW);if(startEvent.defaultPrevented){return;}
4325actives.forEach(elemActive=>{if(container!==elemActive){Collapse.getOrCreateInstance(elemActive,{toggle:false}).hide();} 4326if(!activesData){Data__default.default.set(elemActive,DATA_KEY,null);}});const dimension=this._getDimension();this._element.classList.remove(CLASS_NAME_COLLAPSE);this._element.classList.add(CLASS_NAME_COLLAPSING);this._element.style[dimension]=0;this._addAriaAndCollapsedClass(this._triggerArray,true);this._isTransitioning=true;const complete=()=>{this._isTransitioning=false;this._element.classList.remove(CLASS_NAME_COLLAPSING);this._element.classList.add(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW);this._element.style[dimension]='';EventHandler__default.default.trigger(this._element,EVENT_SHOWN);};const capitalizedDimension=dimension[0].toUpperCase()+dimension.slice(1);const scrollSize=`scroll${capitalizedDimension}`;this._queueCallback(complete,this._element,true);this._element.style[dimension]=`${this._element[scrollSize]}px`;} 4327hide(){if(this._isTransitioning||!this._isShown()){return;} 4328const startEvent=EventHandler__default.default.trigger(this._element,EVENT_HIDE);if(startEvent.defaultPrevented){return;} 4329const dimension=this._getDimension();this._element.style[dimension]=`${this._element.getBoundingClientRect()[dimension]}px`;reflow(this._element);this._element.classList.add(CLASS_NAME_COLLAPSING);this._element.classList.remove(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW);const triggerArrayLength=this._triggerArray.length;for(let i=0;i<triggerArrayLength;i++){const trigger=this._triggerArray[i];const elem=getElementFromSelector(trigger);if(elem&&!this._isShown(elem)){this._addAriaAndCollapsedClass([trigger],false);}} 4330this._isTransitioning=true;const complete=()=>{this._isTransitioning=false;this._element.classList.remove(CLASS_NAME_COLLAPSING);this._element.classList.add(CLASS_NAME_COLLAPSE);EventHandler__default.default.trigger(this._element,EVENT_HIDDEN);};this._element.style[dimension]='';this._queueCallback(complete,this._element,true);} 4331_isShown(element=this._element){return element.classList.contains(CLASS_NAME_SHOW);} 4332_getConfig(config){config={...Default,...Manipulator__default.default.getDataAttributes(this._element),...config};config.toggle=Boolean(config.toggle);config.parent=getElement(config.parent);typeCheckConfig(NAME,config,DefaultType);return config;} 4333_getDimension(){return this._element.classList.contains(CLASS_NAME_HORIZONTAL)?WIDTH:HEIGHT;} 4334_initializeChildren(){if(!this._config.parent){return;} 4335const children=SelectorEngine__default.default.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE,this._config.parent).filter(elem=>!children.includes(elem)).forEach(element=>{const selected=getElementFromSelector(element);if(selected){this._addAriaAndCollapsedClass([element],this._isShown(selected));}});} 4336_addAriaAndCollapsedClass(triggerArray,isOpen){if(!triggerArray.length){return;} 4337triggerArray.forEach(elem=>{if(isOpen){elem.classList.remove(CLASS_NAME_COLLAPSED);}else{elem.classList.add(CLASS_NAME_COLLAPSED);} 4338elem.setAttribute('aria-expanded',isOpen);});} 4339static jQueryInterface(config){return this.each(function(){const _config={};if(typeof config==='string'&&/show|hide/.test(config)){_config.toggle=false;} 4340const data=Collapse.getOrCreateInstance(this,_config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);} 4341data[config]();}});}} 4342EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){if(event.target.tagName==='A'||event.delegateTarget&&event.delegateTarget.tagName==='A'){event.preventDefault();} 4343const selector=getSelectorFromElement(this);const selectorElements=SelectorEngine__default.default.find(selector);selectorElements.forEach(element=>{Collapse.getOrCreateInstance(element,{toggle:false}).toggle();});});defineJQueryPlugin(Collapse);return Collapse;}));; 4344 4345/* /web/static/lib/bootstrap/js/dist/dropdown.js */ 4346(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('@popperjs/core'),require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['@popperjs/core','./dom/event-handler','./dom/manipulator','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Dropdown=factory(global.Popper,global.EventHandler,global.Manipulator,global.SelectorEngine,global.Base));})(this,(function(Popper,EventHandler,Manipulator,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};
4346function _interopNamespace(e){if(e&&e.__esModule)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}} 4347n.default=e;return Object.freeze(n);} 4348const Popper__namespace=_interopNamespace(Popper);const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4349return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4350if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4351selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4352return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4353if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4354return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4355if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4356return null;};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const isVisible=element=>{if(!isElement(element)||element.getClientRects().length===0){return false;} 4357return getComputedStyle(element).getPropertyValue('visibility')==='visible';};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4358if(element.classList.contains('disabled')){return true;} 4359if(typeof element.disabled!=='undefined'){return element.disabled;} 4360return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const noop=()=>{};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4361return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4362DOMContentLoadedCallbacks.push(callback);}else{callback();}};const isRTL=()=>document.documentElement.dir==='rtl';const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const getNextActiveElement=(list,activeElement,shouldGetNext,isCycleAllowed)=>{let index=list.indexOf(activeElement);if(index===-1){return list[!shouldGetNext&&isCycleAllowed?list.length-1:0];} 4363const listLength=list.length;index+=shouldGetNext?1:-1;if(isCycleAllowed){index=(index+listLength)%listLength;} 4364return list[Math.max(0,Math.min(index,listLength-1))];};const NAME='dropdown';const DATA_KEY='bs.dropdown';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const ESCAPE_KEY='Escape';const SPACE_KEY='Space';const TAB_KEY='Tab';const ARROW_UP_KEY='ArrowUp';const ARROW_DOWN_KEY='ArrowDown';const RIGHT_MOUSE_BUTTON=2;const REGEXP_KEYDOWN=new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY}`);const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const EVENT_KEYDOWN_DATA_API=`keydown${EVENT_KEY}${DATA_API_KEY}`;const EVENT_KEYUP_DATA_API=`keyup${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_SHOW='show';const CLASS_NAME_DROPUP='dropup';const CLASS_NAME_DROPEND='dropend';const CLASS_NAME_DROPSTART='dropstart';const CLASS_NAME_NAVBAR='navbar';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="dropdown"]';const SELECTOR_MENU='.dropdown-menu:not(.o-dropdown--menu)';const SELECTOR_MENU_NOT_SUB='.dropdown-menu:not(.o-dropdown--menu):not(.o_wysiwyg_submenu)';const SELECTOR_NAVBAR_NAV='.navbar-nav';const SELECTOR_VISIBLE_ITEMS='.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';const PLACEMENT_TOP=isRTL()?'top-end':'top-start';const PLACEMENT_TOPEND=isRTL()?'top-start':'top-end';const PLACEMENT_BOTTOM=isRTL()?'bottom-end':'bottom-start';const PLACEMENT_BOTTOMEND=isRTL()?'bottom-start':'bottom-end';const PLACEMENT_RIGHT=isRTL()?'left-start':'right-start';const PLACEMENT_LEFT=isRTL()?'right-start':'left-start';const Default={offset:[0,2],boundary:'clippingParents',reference:'toggle',display:'dynamic',popperConfig:null,autoClose:true};const DefaultType={offset:'(array|string|function)',boundary:'(string|element)',reference:'(string|element|object)',display:'string',popperConfig:'(null|object|function)',autoClose:'(boolean|string)'};class Dropdown extends BaseComponent__default.default{constructor(element,config){super(element);this._popper=null;this._config=this._getConfig(config);this._menu=this._getMenuElement();this._inNavbar=this._detectNavbar();} 4365static get Default(){return Default;} 4366static get DefaultType(){return DefaultType;} 4367static get NAME(){return NAME;} 4368toggle(){return this._isShown()?this.hide():this.show();} 4369show(){if(isDisabled(this._element)||this._isShown(this._menu)){return;} 4370const relatedTarget={relatedTarget:this._element};const showEvent=EventHandler__default.default.trigger(this._element,EVENT_SHOW,relatedTarget);if(showEvent.defaultPrevented){return;} 4371const parent=Dropdown.getParentFromElement(this._element);if(this._inNavbar){Manipulator__default.default.setDataAttribute(this._menu,'popper','none');}else{this._createPopper(parent);} 4372if('ontouchstart'in document.documentElement&&!parent.closest(SELECTOR_NAVBAR_NAV)){[].concat(...document.body.children).forEac
4372h(elem=>EventHandler__default.default.on(elem,'mouseover',noop));} 4373this._element.focus();this._element.setAttribute('aria-expanded',true);this._menu.classList.add(CLASS_NAME_SHOW);this._element.classList.add(CLASS_NAME_SHOW);EventHandler__default.default.trigger(this._element,EVENT_SHOWN,relatedTarget);} 4374hide(){if(isDisabled(this._element)||!this._isShown(this._menu)){return;} 4375const relatedTarget={relatedTarget:this._element};this._completeHide(relatedTarget);} 4376dispose(){if(this._popper){this._popper.destroy();} 4377super.dispose();} 4378update(){this._inNavbar=this._detectNavbar();if(this._popper){this._popper.update();}} 4379_completeHide(relatedTarget){const hideEvent=EventHandler__default.default.trigger(this._element,EVENT_HIDE,relatedTarget);if(hideEvent.defaultPrevented){return;} 4380if('ontouchstart'in document.documentElement){[].concat(...document.body.children).forEach(elem=>EventHandler__default.default.off(elem,'mouseover',noop));} 4381if(this._popper){this._popper.destroy();} 4382this._menu.classList.remove(CLASS_NAME_SHOW);this._element.classList.remove(CLASS_NAME_SHOW);this._element.setAttribute('aria-expanded','false');Manipulator__default.default.removeDataAttribute(this._menu,'popper');EventHandler__default.default.trigger(this._element,EVENT_HIDDEN,relatedTarget);} 4383_getConfig(config){config={...this.constructor.Default,...Manipulator__default.default.getDataAttributes(this._element),...config};typeCheckConfig(NAME,config,this.constructor.DefaultType);if(typeof config.reference==='object'&&!isElement(config.reference)&&typeof config.reference.getBoundingClientRect!=='function'){throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);} 4384return config;} 4385_createPopper(parent){if(typeof Popper__namespace==='undefined'){throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');} 4386let referenceElement=this._element;if(this._config.reference==='parent'){referenceElement=parent;}else if(isElement(this._config.reference)){referenceElement=getElement(this._config.reference);}else if(typeof this._config.reference==='object'){referenceElement=this._config.reference;} 4387const popperConfig=this._getPopperConfig();const isDisplayStatic=popperConfig.modifiers.find(modifier=>modifier.name==='applyStyles'&&modifier.enabled===false);this._popper=Popper__namespace.createPopper(referenceElement,this._menu,popperConfig);if(isDisplayStatic){Manipulator__default.default.setDataAttribute(this._menu,'popper','static');}} 4388_isShown(element=this._element){return element.classList.contains(CLASS_NAME_SHOW);} 4389_getMenuElement(){return SelectorEngine__default.default.next(this._element,SELECTOR_MENU)[0];} 4390_getPlacement(){const parentDropdown=this._element.parentNode;if(parentDropdown.classList.contains(CLASS_NAME_DROPEND)){return PLACEMENT_RIGHT;} 4391if(parentDropdown.classList.contains(CLASS_NAME_DROPSTART)){return PLACEMENT_LEFT;} 4392const isEnd=getComputedStyle(this._menu).getPropertyValue('--bs-position').trim()==='end';if(parentDropdown.classList.contains(CLASS_NAME_DROPUP)){return isEnd?PLACEMENT_TOPEND:PLACEMENT_TOP;} 4393return isEnd?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM;} 4394_detectNavbar(){return this._element.closest(`.${CLASS_NAME_NAVBAR}`)!==null;} 4395_getOffset(){const{offset}=this._config;if(typeof offset==='string'){return offset.split(',').map(val=>Number.parseInt(val,10));} 4396if(typeof offset==='function'){return popperData=>offset(popperData,this._element);} 4397return offset;} 4398_getPopperConfig(){const defaultBsPopperConfig={placement:this._getPlacement(),modifiers:[{name:'preventOverflow',options:{boundary:this._config.boundary}},{name:'offset',options:{offset:this._getOffset()}}]};if(this._config.display==='static'){defaultBsPopperConfig.modifiers=[{name:'applyStyles',enabled:false}];} 4399return{...defaultBsPopperConfig,...(typeof this._config.popperConfig==='function'?this._config.popperConfig(defaultBsPopperConfig):this._config.popperConfig)};} 4400_selectMenuItem({key,target}){const items=SelectorEngine__default.default.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(isVisible);if(!items.length){return;} 4401getNextActiveElement(items,target,key===ARROW_DOWN_KEY,!items.includes(target)).focus();} 4402static jQueryInterface(config){return this.each(function(){const data=Dropdown.getOrCreateInstance(this,config);if(typeof config!=='string'){return;} 4403if(typeof data[config]==='undefined'){throw new TypeError(`No method n
4403amed "${config}"`);} 4404data[config]();});} 4405static clearMenus(event){if(event&&(event.button===RIGHT_MOUSE_BUTTON||event.type==='keyup'&&event.key!==TAB_KEY)){return;} 4406const toggles=SelectorEngine__default.default.find(SELECTOR_DATA_TOGGLE);for(let i=0,len=toggles.length;i<len;i++){const context=Dropdown.getInstance(toggles[i]);if(!context||context._config.autoClose===false){continue;} 4407if(!context._isShown()){continue;} 4408const relatedTarget={relatedTarget:context._element};if(event){const composedPath=event.composedPath();const isMenuTarget=composedPath.includes(context._menu);if(composedPath.includes(context._element)||context._config.autoClose==='inside'&&!isMenuTarget||context._config.autoClose==='outside'&&isMenuTarget){continue;} 4409if(context._menu.contains(event.target)&&(event.type==='keyup'&&event.key===TAB_KEY||/input|select|option|textarea|form/i.test(event.target.tagName))){continue;} 4410if(event.type==='click'){relatedTarget.clickEvent=event;}} 4411context._completeHide(relatedTarget);}} 4412static getParentFromElement(element){return getElementFromSelector(element)||element.parentNode;} 4413static dataApiKeydownHandler(event){if(/input|textarea/i.test(event.target.tagName)?event.key===SPACE_KEY||event.key!==ESCAPE_KEY&&(event.key!==ARROW_DOWN_KEY&&event.key!==ARROW_UP_KEY||event.target.closest(SELECTOR_MENU)):!REGEXP_KEYDOWN.test(event.key)){return;} 4414const isActive=this.classList.contains(CLASS_NAME_SHOW);if(!isActive&&event.key===ESCAPE_KEY){return;} 4415event.preventDefault();event.stopPropagation();if(isDisabled(this)){return;} 4416const getToggleButton=this.matches(SELECTOR_DATA_TOGGLE)?this:SelectorEngine__default.default.prev(this,SELECTOR_DATA_TOGGLE)[0];const instance=Dropdown.getOrCreateInstance(getToggleButton);if(event.key===ESCAPE_KEY){instance.hide();return;} 4417if(event.key===ARROW_UP_KEY||event.key===ARROW_DOWN_KEY){if(!isActive){instance.show();} 4418instance._selectMenuItem(event);return;} 4419if(!isActive||event.key===SPACE_KEY){Dropdown.clearMenus();}}} 4420EventHandler__default.default.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE,Dropdown.dataApiKeydownHandler);EventHandler__default.default.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU_NOT_SUB,Dropdown.dataApiKeydownHandler);EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,Dropdown.clearMenus);EventHandler__default.default.on(document,EVENT_KEYUP_DATA_API,Dropdown.clearMenus);EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){event.preventDefault();Dropdown.getOrCreateInstance(this).toggle();});defineJQueryPlugin(Dropdown);return Dropdown;}));; 4421 4422/* /web/static/lib/bootstrap/js/dist/modal.js */ 4423(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./dom/manipulator','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Modal=factory(global.EventHandler,global.Manipulator,global.SelectorEngine,global.Base));})(this,(function(EventHandler,Manipulator,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const MILLISECONDS_MULTIPLIER=1000;const TRANSITION_END='transitionend';const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4424return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4425if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4426selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4427return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const getTransitionDurationFromElement=element=>{if(!element){return 0;} 4428let{transitionDuration,transitionDelay}=window.getComputedStyle(element);const floatTransitionDuration=Number.parseFloat(transitionDuration);const floatTransitionDelay=Number.parseFloat(transitionDelay);if(!floatTransitionDuration&&!floatTransitionDelay){return 0;} 4429transitionDuration=transitionDuration.split(',')[0];transitionDelay=transitionDelay.split(',')[0];return(Number.parseFloat(transitionDuration)+Number.parseFloat(transitionDelay))*MILLISECONDS_MULTIPLIER;};const triggerTransitionEnd=element=>{element.dispatchEvent(new Event(TRANSITION_END));};const isElement=obj=>
4429{if(!obj||typeof obj!=='object'){return false;} 4430if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4431return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4432if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4433return null;};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const isVisible=element=>{if(!isElement(element)||element.getClientRects().length===0){return false;} 4434return getComputedStyle(element).getPropertyValue('visibility')==='visible';};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4435if(element.classList.contains('disabled')){return true;} 4436if(typeof element.disabled!=='undefined'){return element.disabled;} 4437return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4438return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4439DOMContentLoadedCallbacks.push(callback);}else{callback();}};const isRTL=()=>document.documentElement.dir==='rtl';const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const execute=callback=>{if(typeof callback==='function'){callback();}};const executeAfterTransition=(callback,transitionElement,waitForTransition=true)=>{if(!waitForTransition){execute(callback);return;} 4440const durationPadding=5;const emulatedDuration=getTransitionDurationFromElement(transitionElement)+durationPadding;let called=false;const handler=({target})=>
4440{if(target!==transitionElement){return;} 4441called=true;transitionElement.removeEventListener(TRANSITION_END,handler);execute(callback);};transitionElement.addEventListener(TRANSITION_END,handler);setTimeout(()=>{if(!called){triggerTransitionEnd(transitionElement);}},emulatedDuration);};const SELECTOR_FIXED_CONTENT='.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';const SELECTOR_STICKY_CONTENT='.sticky-top';class ScrollBarHelper{constructor(){this._element=document.body;} 4442getWidth(){const documentWidth=document.documentElement.clientWidth;return Math.abs(window.innerWidth-documentWidth);} 4443hide(){const width=this.getWidth();this._disableOverFlow();this._setElementAttributes(this._element,'paddingRight',calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_FIXED_CONTENT,'paddingRight',calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_STICKY_CONTENT,'marginRight',calculatedValue=>calculatedValue-width);} 4444_disableOverFlow(){this._saveInitialAttribute(this._element,'overflow');this._element.style.overflow='hidden';} 4445_setElementAttributes(selector,styleProp,callback){const scrollbarWidth=this.getWidth();const manipulationCallBack=element=>{if(element!==this._element&&window.innerWidth>element.clientWidth+scrollbarWidth){return;} 4446this._saveInitialAttribute(element,styleProp);const calculatedValue=window.getComputedStyle(element)[styleProp];element.style[styleProp]=`${callback(Number.parseFloat(calculatedValue))}px`;};this._applyManipulationCallback(selector,manipulationCallBack);} 4447reset(){this._resetElementAttributes(this._element,'overflow');this._resetElementAttributes(this._element,'paddingRight');this._resetElementAttributes(SELECTOR_FIXED_CONTENT,'paddingRight');this._resetElementAttributes(SELECTOR_STICKY_CONTENT,'marginRight');} 4448_saveInitialAttribute(element,styleProp){const actualValue=element.style[styleProp];if(actualValue){Manipulator__default.default.setDataAttribute(element,styleProp,actualValue);}} 4449_resetElementAttributes(selector,styleProp){const manipulationCallBack=element=>{const value=Manipulator__default.default.getDataAttribute(element,styleProp);if(typeof value==='undefined'){element.style.removeProperty(styleProp);}else{Manipulator__default.default.removeDataAttribute(element,styleProp);element.style[styleProp]=value;}};this._applyManipulationCallback(selector,manipulationCallBack);} 4450_applyManipulationCallback(selector,callBack){if(isElement(selector)){callBack(selector);}else{SelectorEngine__default.default.find(selector,this._element).forEach(callBack);}} 4451isOverflowing(){return this.getWidth()>0;}} 4452const Default$2={className:'modal-backdrop',isVisible:true,isAnimated:false,rootElement:'body',clickCallback:null};const DefaultType$2={className:'string',isVisible:'boolean',isAnimated:'boolean',rootElement:'(element|string)',clickCallback:'(function|null)'};const NAME$2='backdrop';const CLASS_NAME_FADE$1='fade';const CLASS_NAME_SHOW$1='show';const EVENT_MOUSEDOWN=`mousedown.bs.${NAME$2}`;class Backdrop{constructor(config){this._config=this._getConfig(config);this._isAppended=false;this._element=null;} 4453show(callback){if(!this._config.isVisible){execute(callback);return;} 4454this._append();if(this._config.isAnimated){reflow(this._getElement());} 4455this._getElement().classList.add(CLASS_NAME_SHOW$1);this._emulateAnimation(()=>{execute(callback);});} 4456hide(callback){if(!this._config.isVisible){execute(callback);return;} 4457this._getElement().classList.remove(CLASS_NAME_SHOW$1);this._emulateAnimation(()=>{this.dispose();execute(callback);});} 4458_getElement(){if(!this._element){const backdrop=document.createElement('div');backdrop.className=this._config.className;if(this._config.isAnimated){backdrop.classList.add(CLASS_NAME_FADE$1);} 4459this._element=backdrop;} 4460return this._element;} 4461_getConfig(config){config={...Default$2,...(typeof config==='object'?config:{})};config.rootElement=getElement(config.rootElement);typeCheckConfig(NAME$2,config,DefaultType$2);return config;} 4462_append(){if(this._isAppended){return;} 4463this._config.rootElement.append(this._getElement());EventHandler__default.default.on(this._getElement(),EVENT_MOUSEDOWN,()=>{execute(this._config.clickCallback);});this._isAppended=true;} 4464dispose(){if(!this._isAppended){return;} 4465EventHandler__default.default.off(this._element,EVENT_MOUSEDOWN);this._element.remove();this._isAppended=false;} 4466_emulateAnimation(callback){executeAfterTransition(callback,this._getElement(),this._config.isAnimated);}} 4467const Default$1={trapElement:null,autofocus:true};const DefaultType$1={trapElement:'element',autofocus:'boolean'};const NAME$1='focustrap';const DATA_KEY$1='bs.focustrap';const EVENT_KEY$1=`.${DATA_KEY$1}`;const EVENT_FOCUSIN=`focusin${EVENT_KEY$1}`;const EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$1}`;const TAB_KEY='Tab';
4467const TAB_NAV_FORWARD='forward';const TAB_NAV_BACKWARD='backward';class FocusTrap{constructor(config){this._config=this._getConfig(config);this._isActive=false;this._lastTabNavDirection=null;} 4468activate(){const{trapElement,autofocus}=this._config;if(this._isActive){return;} 4469if(autofocus){trapElement.focus();} 4470EventHandler__default.default.off(document,EVENT_KEY$1);EventHandler__default.default.on(document,EVENT_FOCUSIN,event=>this._handleFocusin(event));EventHandler__default.default.on(document,EVENT_KEYDOWN_TAB,event=>this._handleKeydown(event));this._isActive=true;} 4471deactivate(){if(!this._isActive){return;} 4472this._isActive=false;EventHandler__default.default.off(document,EVENT_KEY$1);} 4473_handleFocusin(event){const{target}=event;const{trapElement}=this._config;if(target===document||target===trapElement||trapElement.contains(target)){return;} 4474const elements=SelectorEngine__default.default.focusableChildren(trapElement);if(elements.length===0){trapElement.focus();}else if(this._lastTabNavDirection===TAB_NAV_BACKWARD){elements[elements.length-1].focus();}else{elements[0].focus();}} 4475_handleKeydown(event){if(event.key!==TAB_KEY){return;} 4476this._lastTabNavDirection=event.shiftKey?TAB_NAV_BACKWARD:TAB_NAV_FORWARD;} 4477_getConfig(config){config={...Default$1,...(typeof config==='object'?config:{})};typeCheckConfig(NAME$1,config,DefaultType$1);return config;}} 4478const enableDismissTrigger=(component,method='hide')=>{const clickEvent=`click.dismiss${component.EVENT_KEY}`;const name=component.NAME;EventHandler__default.default.on(document,clickEvent,`[data-bs-dismiss="${name}"]`,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4479if(isDisabled(this)){return;} 4480const target=getElementFromSelector(this)||this.closest(`.${name}`);const instance=component.getOrCreateInstance(target);instance[method]();});};const NAME='modal';const DATA_KEY='bs.modal';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const ESCAPE_KEY='Escape';const Default={backdrop:true,keyboard:true,focus:true};const DefaultType={backdrop:'(boolean|string)',keyboard:'boolean',focus:'boolean'};const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_RESIZE=`resize${EVENT_KEY}`;const EVENT_CLICK_DISMISS=`click.dismiss${EVENT_KEY}`;const EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY}`;const EVENT_MOUSEUP_DISMISS=`mouseup.dismiss${EVENT_KEY}`;const EVENT_MOUSEDOWN_DISMISS=`mousedown.dismiss${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_OPEN='modal-open';const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';const CLASS_NAME_STATIC='modal-static';const OPEN_SELECTOR='.modal.show';const SELECTOR_DIALOG='.modal-dialog';const SELECTOR_MODAL_BODY='.modal-body';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="modal"]';class Modal extends BaseComponent__default.default{constructor(element,config){super(element);this._config=this._getConfig(config);this._dialog=SelectorEngine__default.default.findOne(SELECTOR_DIALOG,this._element);this._backdrop=this._initializeBackDrop();this._focustrap=this._initializeFocusTrap();this._isShown=false;this._ignoreBackdropClick=false;this._isTransitioning=false;this._scrollBar=new ScrollBarHelper();} 4481static get Default(){return Default;} 4482static get NAME(){return NAME;} 4483toggle(relatedTarget){return this._isShown?this.hide():this.show(relatedTarget);} 4484show(relatedTarget){if(this._isShown||this._isTransitioning){return;} 4485const showEvent=EventHandler__default.default.trigger(this._element,EVENT_SHOW,{relatedTarget});if(showEvent.defaultPrevented){return;} 4486this._isShown=true;if(this._isAnimated()){this._isTransitioning=true;} 4487this._scrollBar.hide();document.body.classList.add(CLASS_NAME_OPEN);this._adjustDialog();this._setEscapeEvent();this._setResizeEvent();EventHandler__default.default.on(this._dialog,EVENT_MOUSEDOWN_DISMISS,()=>{EventHandler__default.default.one(this._element,EVENT_MOUSEUP_DISMISS,event=>{if(event.target===this._element){this._ignoreBackdropClick=true;}});});this._showBackdrop(()=>this._showElement(relatedTarget));}
4488hide(){if(!this._isShown||this._isTransitioning){return;} 4489const hideEvent=EventHandler__default.default.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;} 4490this._isShown=false;const isAnimated=this._isAnimated();if(isAnimated){this._isTransitioning=true;} 4491this._setEscapeEvent();this._setResizeEvent();this._focustrap.deactivate();this._element.classList.remove(CLASS_NAME_SHOW);EventHandler__default.default.off(this._element,EVENT_CLICK_DISMISS);EventHandler__default.default.off(this._dialog,EVENT_MOUSEDOWN_DISMISS);this._queueCallback(()=>this._hideModal(),this._element,isAnimated);} 4492dispose(){[window,this._dialog].forEach(htmlElement=>EventHandler__default.default.off(htmlElement,EVENT_KEY));this._backdrop.dispose();this._focustrap.deactivate();super.dispose();} 4493handleUpdate(){this._adjustDialog();} 4494_initializeBackDrop(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()});} 4495_initializeFocusTrap(){return new FocusTrap({trapElement:this._element});} 4496_getConfig(config){config={...Default,...Manipulator__default.default.getDataAttributes(this._element),...(typeof config==='object'?config:{})};typeCheckConfig(NAME,config,DefaultType);return config;} 4497_showElement(relatedTarget){const isAnimated=this._isAnimated();const modalBody=SelectorEngine__default.default.findOne(SELECTOR_MODAL_BODY,this._dialog);if(!this._element.parentNode||this._element.parentNode.nodeType!==Node.ELEMENT_NODE){document.body.append(this._element);} 4498this._element.style.display='block';this._element.removeAttribute('aria-hidden');this._element.setAttribute('aria-modal',true);this._element.setAttribute('role','dialog');this._element.scrollTop=0;if(modalBody){modalBody.scrollTop=0;} 4499if(isAnimated){reflow(this._element);} 4500this._element.classList.add(CLASS_NAME_SHOW);const transitionComplete=()=>{if(this._config.focus){this._focustrap.activate();} 4501this._isTransitioning=false;EventHandler__default.default.trigger(this._element,EVENT_SHOWN,{relatedTarget});};this._queueCallback(transitionComplete,this._dialog,isAnimated);} 4502_setEscapeEvent(){if(this._isShown){EventHandler__default.default.on(this._element,EVENT_KEYDOWN_DISMISS,event=>{if(this._config.keyboard&&event.key===ESCAPE_KEY){event.preventDefault();this.hide();}else if(!this._config.keyboard&&event.key===ESCAPE_KEY){this._triggerBackdropTransition();}});}else{EventHandler__default.default.off(this._element,EVENT_KEYDOWN_DISMISS);}} 4503_setResizeEvent(){if(this._isShown){EventHandler__default.default.on(window,EVENT_RESIZE,()=>this._adjustDialog());}else{EventHandler__default.default.off(window,EVENT_RESIZE);}} 4504_hideModal(){this._element.style.display='none';this._element.setAttribute('aria-hidden',true);this._element.removeAttribute('aria-modal');this._element.removeAttribute('role');this._isTransitioning=false;this._backdrop.hide(()=>{document.body.classList.remove(CLASS_NAME_OPEN);this._resetAdjustments();this._scrollBar.reset();EventHandler__default.default.trigger(this._element,EVENT_HIDDEN);});} 4505_showBackdrop(callback){EventHandler__default.default.on(this._element,EVENT_CLICK_DISMISS,event=>{if(this._ignoreBackdropClick){this._ignoreBackdropClick=false;return;} 4506if(event.target!==event.currentTarget){return;} 4507if(this._config.backdrop===true){this.hide();}else if(this._config.backdrop==='static'){this._triggerBackdropTransition();}});this._backdrop.show(callback);} 4508_isAnimated(){return this._element.classList.contains(CLASS_NAME_FADE);} 4509_triggerBackdropTransition(){const hideEvent=EventHandler__default.default.trigger(this._element,EVENT_HIDE_PREVENTED);if(hideEvent.defaultPrevented){return;} 4510const{classList,scrollHeight,style}=this._element;const isModalOverflowing=scrollHeight>document.documentElement.clientHeight;if(!isModalOverflowing&&style.overflowY==='hidden'||classList.contains(CLASS_NAME_STATIC)){return;} 4511if(!isModalOverflowing){style.overflowY='hidden';} 4512classList.add(CLASS_NAME_STATIC);this._queueCallback(()=>{classList.remove(CLASS_NAME_STATIC);if(!isModalOverflowing){this._queueCallback(()=>{style.overflowY='';},this._dialog);}},this._dialog);this._element.focus();} 4513_adjustDialog(){const isModalOverflowing=this._element.scrollHeight>document.documentElement.clientHeight;const scrollbarWidth=this._scrollBar.getWidth();const isBodyOverflowing=scrollbarWidth>0;if(!isBodyOverflowing&&isModalOverflowing&&!isRTL()||isBodyOverflowing&&!isModalOverflowing&&isRTL()){this._element.style.paddingLeft=`${scrollbarWidth}px`;} 4514if(isBodyOverflowing&&!isModalOverflowing&&!isRTL()||!isBodyOverflowing&&isModalOverflowing&&isRTL()){this._element.style.paddingRight=`${scrollbarWidth}px`;}} 4515_resetAdjustments(){this._element.style.paddingLeft='';this._element.style.paddingRight='';} 4516static jQueryInterface(config,relatedTarget){return this.each(function(){const data=Modal.getOrCreateInstance(this,config);if(typeof config!=='string'){return;} 4517if(typeof data[config]==='undefined'){throw new TypeError(`No method n
4517amed "${config}"`);} 4518data[config](relatedTarget);});}} 4519EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){const target=getElementFromSelector(this);if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4520EventHandler__default.default.one(target,EVENT_SHOW,showEvent=>{if(showEvent.defaultPrevented){return;} 4521EventHandler__default.default.one(target,EVENT_HIDDEN,()=>{if(isVisible(this)){this.focus();}});});const allReadyOpen=SelectorEngine__default.default.findOne(OPEN_SELECTOR);if(allReadyOpen){Modal.getInstance(allReadyOpen).hide();} 4522const data=Modal.getOrCreateInstance(target);data.toggle(this);});enableDismissTrigger(Modal);defineJQueryPlugin(Modal);return Modal;}));; 4523 4524/* /web/static/lib/bootstrap/js/dist/offcanvas.js */ 4525(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/selector-engine.js'),require('./dom/manipulator.js'),require('./dom/event-handler.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/selector-engine','./dom/manipulator','./dom/event-handler','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Offcanvas=factory(global.SelectorEngine,global.Manipulator,global.EventHandler,global.Base));})(this,(function(SelectorEngine,Manipulator,EventHandler,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const Manipulator__default=_interopDefaultLegacy(Manipulator);const EventHandler__default=_interopDefaultLegacy(EventHandler);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const MILLISECONDS_MULTIPLIER=1000;const TRANSITION_END='transitionend';const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4526return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4527if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4528selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4529return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const getTransitionDurationFromElement=element=>{if(!element){return 0;} 4530let{transitionDuration,transitionDelay}=window.getComputedStyle(element);const floatTransitionDuration=Number.parseFloat(transitionDuration);const floatTransitionDelay=Number.parseFloat(transitionDelay);if(!floatTransitionDuration&&!floatTransitionDelay){return 0;} 4531transitionDuration=transitionDuration.split(',')[0];transitionDelay=transitionDelay.split(',')[0];return(Number.parseFloat(transitionDuration)+Number.parseFloat(transitionDelay))*MILLISECONDS_MULTIPLIER;};const triggerTransitionEnd=element=>{element.dispatchEvent(new Event(TRANSITION_END));};const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4532if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4533return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4534if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4535return null;};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const isVisible=element=>{if(!isElement(element)||element.getClientRects().length===0){return false;} 4536return getComputedStyle(element).getPropertyValue('visibility')==='visible';};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4537if(element.classList.contains('disabled')){return true;} 4538if(typeof element.disabled!=='undefined'){return element.disabled;} 4539return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4540return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4541DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const execute=callback=>{if(typeof callback==='function'){callback();}};const executeAfterTransition=(callback,transitionElement,waitForTransition=true)=>{if(!waitForTransition){execute(callback);return;} 4542const durationPadding=5;const emulatedDuration=getTransitionDurationFromElement(transitionElement)+durationPadding;let called=false;const handler=({target})=>
4542{if(target!==transitionElement){return;} 4543called=true;transitionElement.removeEventListener(TRANSITION_END,handler);execute(callback);};transitionElement.addEventListener(TRANSITION_END,handler);setTimeout(()=>{if(!called){triggerTransitionEnd(transitionElement);}},emulatedDuration);};const SELECTOR_FIXED_CONTENT='.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';const SELECTOR_STICKY_CONTENT='.sticky-top';class ScrollBarHelper{constructor(){this._element=document.body;} 4544getWidth(){const documentWidth=document.documentElement.clientWidth;return Math.abs(window.innerWidth-documentWidth);} 4545hide(){const width=this.getWidth();this._disableOverFlow();this._setElementAttributes(this._element,'paddingRight',calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_FIXED_CONTENT,'paddingRight',calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_STICKY_CONTENT,'marginRight',calculatedValue=>calculatedValue-width);} 4546_disableOverFlow(){this._saveInitialAttribute(this._element,'overflow');this._element.style.overflow='hidden';} 4547_setElementAttributes(selector,styleProp,callback){const scrollbarWidth=this.getWidth();const manipulationCallBack=element=>{if(element!==this._element&&window.innerWidth>element.clientWidth+scrollbarWidth){return;} 4548this._saveInitialAttribute(element,styleProp);const calculatedValue=window.getComputedStyle(element)[styleProp];element.style[styleProp]=`${callback(Number.parseFloat(calculatedValue))}px`;};this._applyManipulationCallback(selector,manipulationCallBack);} 4549reset(){this._resetElementAttributes(this._element,'overflow');this._resetElementAttributes(this._element,'paddingRight');this._resetElementAttributes(SELECTOR_FIXED_CONTENT,'paddingRight');this._resetElementAttributes(SELECTOR_STICKY_CONTENT,'marginRight');} 4550_saveInitialAttribute(element,styleProp){const actualValue=element.style[styleProp];if(actualValue){Manipulator__default.default.setDataAttribute(element,styleProp,actualValue);}} 4551_resetElementAttributes(selector,styleProp){const manipulationCallBack=element=>{const value=Manipulator__default.default.getDataAttribute(element,styleProp);if(typeof value==='undefined'){element.style.removeProperty(styleProp);}else{Manipulator__default.default.removeDataAttribute(element,styleProp);element.style[styleProp]=value;}};this._applyManipulationCallback(selector,manipulationCallBack);} 4552_applyManipulationCallback(selector,callBack){if(isElement(selector)){callBack(selector);}else{SelectorEngine__default.default.find(selector,this._element).forEach(callBack);}} 4553isOverflowing(){return this.getWidth()>0;}} 4554const Default$2={className:'modal-backdrop',isVisible:true,isAnimated:false,rootElement:'body',clickCallback:null};const DefaultType$2={className:'string',isVisible:'boolean',isAnimated:'boolean',rootElement:'(element|string)',clickCallback:'(function|null)'};const NAME$2='backdrop';const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW$1='show';const EVENT_MOUSEDOWN=`mousedown.bs.${NAME$2}`;class Backdrop{constructor(config){this._config=this._getConfig(config);this._isAppended=false;this._element=null;} 4555show(callback){if(!this._config.isVisible){execute(callback);return;} 4556this._append();if(this._config.isAnimated){reflow(this._getElement());} 4557this._getElement().classList.add(CLASS_NAME_SHOW$1);this._emulateAnimation(()=>{execute(callback);});} 4558hide(callback){if(!this._config.isVisible){execute(callback);return;} 4559this._getElement().classList.remove(CLASS_NAME_SHOW$1);this._emulateAnimation(()=>{this.dispose();execute(callback);});} 4560_getElement(){if(!this._element){const backdrop=document.createElement('div');backdrop.className=this._config.className;if(this._config.isAnimated){backdrop.classList.add(CLASS_NAME_FADE);} 4561this._element=backdrop;} 4562return this._element;} 4563_getConfig(config){config={...Default$2,...(typeof config==='object'?config:{})};config.rootElement=getElement(config.rootElement);typeCheckConfig(NAME$2,config,DefaultType$2);return config;} 4564_append(){if(this._isAppended){return;} 4565this._config.rootElement.append(this._getElement());EventHandler__default.default.on(this._getElement(),EVENT_MOUSEDOWN,()=>{execute(this._config.clickCallback);});this._isAppended=true;} 4566dispose(){if(!this._isAppended){return;} 4567EventHandler__default.default.off(this._element,EVENT_MOUSEDOWN);this._element.remove();this._isAppended=false;} 4568_emulateAnimation(callback){executeAfterTransition(callback,this._getElement(),this._config.isAnimated);}} 4569const Default$1={trapElement:null,autofocus:true};const DefaultType$1={trapElement:'element',autofocus:'boolean'};const NAME$1='focustrap';const DATA_KEY$1='bs.focustrap';const EVENT_KEY$1=`.${DATA_KEY$1}`;const EVENT_FOCUSIN=`focusin${EVENT_KEY$1}`;const EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$1}`;const TAB_KEY='Tab';
4569const TAB_NAV_FORWARD='forward';const TAB_NAV_BACKWARD='backward';class FocusTrap{constructor(config){this._config=this._getConfig(config);this._isActive=false;this._lastTabNavDirection=null;} 4570activate(){const{trapElement,autofocus}=this._config;if(this._isActive){return;} 4571if(autofocus){trapElement.focus();} 4572EventHandler__default.default.off(document,EVENT_KEY$1);EventHandler__default.default.on(document,EVENT_FOCUSIN,event=>this._handleFocusin(event));EventHandler__default.default.on(document,EVENT_KEYDOWN_TAB,event=>this._handleKeydown(event));this._isActive=true;} 4573deactivate(){if(!this._isActive){return;} 4574this._isActive=false;EventHandler__default.default.off(document,EVENT_KEY$1);} 4575_handleFocusin(event){const{target}=event;const{trapElement}=this._config;if(target===document||target===trapElement||trapElement.contains(target)){return;} 4576const elements=SelectorEngine__default.default.focusableChildren(trapElement);if(elements.length===0){trapElement.focus();}else if(this._lastTabNavDirection===TAB_NAV_BACKWARD){elements[elements.length-1].focus();}else{elements[0].focus();}} 4577_handleKeydown(event){if(event.key!==TAB_KEY){return;} 4578this._lastTabNavDirection=event.shiftKey?TAB_NAV_BACKWARD:TAB_NAV_FORWARD;} 4579_getConfig(config){config={...Default$1,...(typeof config==='object'?config:{})};typeCheckConfig(NAME$1,config,DefaultType$1);return config;}} 4580const enableDismissTrigger=(component,method='hide')=>{const clickEvent=`click.dismiss${component.EVENT_KEY}`;const name=component.NAME;EventHandler__default.default.on(document,clickEvent,`[data-bs-dismiss="${name}"]`,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4581if(isDisabled(this)){return;} 4582const target=getElementFromSelector(this)||this.closest(`.${name}`);const instance=component.getOrCreateInstance(target);instance[method]();});};const NAME='offcanvas';const DATA_KEY='bs.offcanvas';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const EVENT_LOAD_DATA_API=`load${EVENT_KEY}${DATA_API_KEY}`;const ESCAPE_KEY='Escape';const Default={backdrop:true,keyboard:true,scroll:false};const DefaultType={backdrop:'boolean',keyboard:'boolean',scroll:'boolean'};const CLASS_NAME_SHOW='show';const CLASS_NAME_BACKDROP='offcanvas-backdrop';const OPEN_SELECTOR='.offcanvas.show';const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY}`;const SELECTOR_DATA_TOGGLE='[data-bs-toggle="offcanvas"]';class Offcanvas extends BaseComponent__default.default{constructor(element,config){super(element);this._config=this._getConfig(config);this._isShown=false;this._backdrop=this._initializeBackDrop();this._focustrap=this._initializeFocusTrap();this._addEventListeners();} 4583static get NAME(){return NAME;} 4584static get Default(){return Default;} 4585toggle(relatedTarget){return this._isShown?this.hide():this.show(relatedTarget);} 4586show(relatedTarget){if(this._isShown){return;} 4587const showEvent=EventHandler__default.default.trigger(this._element,EVENT_SHOW,{relatedTarget});if(showEvent.defaultPrevented){return;} 4588this._isShown=true;this._element.style.visibility='visible';this._backdrop.show();if(!this._config.scroll){new ScrollBarHelper().hide();} 4589this._element.removeAttribute('aria-hidden');this._element.setAttribute('aria-modal',true);this._element.setAttribute('role','dialog');this._element.classList.add(CLASS_NAME_SHOW);const completeCallBack=()=>{if(!this._config.scroll){this._focustrap.activate();} 4590EventHandler__default.default.trigger(this._element,EVENT_SHOWN,{relatedTarget});};this._queueCallback(completeCallBack,this._element,true);} 4591hide(){if(!this._isShown){return;} 4592const hideEvent=EventHandler__default.default.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;} 4593this._focustrap.deactivate();this._element.blur();this._isShown=false;this._element.classList.remove(CLASS_NAME_SHOW);this._backdrop.hide();const completeCallback=()=>{this._element.setAttribute('aria-hidden',true);this._element.removeAttribute('aria-modal');this._element.removeAttribute('role');this._element.style.visibility='hidden';if(!this._config.scroll){new ScrollBarHelper().reset();} 4594EventHandler__default.default.trigger(this._element,EVENT_HIDDEN);};this._queueCallback(completeCallback,this._element,true);} 4595dispose(){this._backdrop.dispose();this._focustrap.deactivate();super.dispose();} 4596_getConfig(config){config={...Default,...Manipulator__default.default.getDataAttributes(this._element),...(typeof config==='object'?config:{})};typeCheckConfig(NAME,config,DefaultType);return config;}
4597_initializeBackDrop(){return new Backdrop({className:CLASS_NAME_BACKDROP,isVisible:this._config.backdrop,isAnimated:true,rootElement:this._element.parentNode,clickCallback:()=>this.hide()});} 4598_initializeFocusTrap(){return new FocusTrap({trapElement:this._element});} 4599_addEventListeners(){EventHandler__default.default.on(this._element,EVENT_KEYDOWN_DISMISS,event=>{if(this._config.keyboard&&event.key===ESCAPE_KEY){this.hide();}});} 4600static jQueryInterface(config){return this.each(function(){const data=Offcanvas.getOrCreateInstance(this,config);if(typeof config!=='string'){return;} 4601if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);} 4602data[config](this);});}} 4603EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){const target=getElementFromSelector(this);if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4604if(isDisabled(this)){return;} 4605EventHandler__default.default.one(target,EVENT_HIDDEN,()=>{if(isVisible(this)){this.focus();}});const allReadyOpen=SelectorEngine__default.default.findOne(OPEN_SELECTOR);if(allReadyOpen&&allReadyOpen!==target){Offcanvas.getInstance(allReadyOpen).hide();} 4606const data=Offcanvas.getOrCreateInstance(target);data.toggle(this);});EventHandler__default.default.on(window,EVENT_LOAD_DATA_API,()=>SelectorEngine__default.default.find(OPEN_SELECTOR).forEach(el=>Offcanvas.getOrCreateInstance(el).show()));enableDismissTrigger(Offcanvas);defineJQueryPlugin(Offcanvas);return Offcanvas;}));; 4607 4608/* /web/static/lib/bootstrap/js/dist/tooltip.js */ 4609(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('@popperjs/core'),require('./dom/data.js'),require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['@popperjs/core','./dom/data','./dom/event-handler','./dom/manipulator','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Tooltip=factory(global.Popper,global.Data,global.EventHandler,global.Manipulator,global.SelectorEngine,global.Base));})(this,(function(Popper,Data,EventHandler,Manipulator,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};function _interopNamespace(e){if(e&&e.__esModule)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}} 4610n.default=e;return Object.freeze(n);} 4611const Popper__namespace=_interopNamespace(Popper);const Data__default=_interopDefaultLegacy(Data);const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const MAX_UID=1000000;const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4612return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getUID=prefix=>{do{prefix+=Math.floor(Math.random()*MAX_UID);}while(document.getElementById(prefix));return prefix;};const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4613if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4614return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4615if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4616return null;};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const findShadowRoot=element=>{if(!document.documentElement.attachShadow){return null;} 4617if(typeof element.getRootNode==='function'){const root=element.getRootNode();return root instanceof ShadowRoot?root:null;} 4618if(element instanceof ShadowRoot){return element;} 4619if(!element.parentNode){return null;} 4620return findShadowRoot(element.parentNode);};const noop=()=>{};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4621return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4622DOMContentLoadedCallbacks.push(callback);}else{callback();}};const isRTL=()=>document.documentElement.dir==='rtl';const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const uriAttributes=new Set(['background','cite','href','itemtype','longdesc','poster','src','xlink:href']);const ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i;const SAFE_URL_PATTERN=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;const 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;const allowedAttribute=(attribute,allowedAttributeList)=>
4622{const attributeName=attribute.nodeName.toLowerCase();if(allowedAttributeList.includes(attributeName)){if(uriAttributes.has(attributeName)){return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)||DATA_URL_PATTERN.test(attribute.nodeValue));} 4623return true;} 4624const regExp=allowedAttributeList.filter(attributeRegex=>attributeRegex instanceof RegExp);for(let i=0,len=regExp.length;i<len;i++){if(regExp[i].test(attributeName)){return true;}} 4625return false;};const DefaultAllowlist={'*':['class','dir','id','lang','role',ARIA_ATTRIBUTE_PATTERN],a:['target','href','title','rel'],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:['src','srcset','alt','title','width','height'],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};function sanitizeHtml(unsafeHtml,allowList,sanitizeFn){if(!unsafeHtml.length){return unsafeHtml;} 4626if(sanitizeFn&&typeof sanitizeFn==='function'){return sanitizeFn(unsafeHtml);} 4627const domParser=new window.DOMParser();const createdDocument=domParser.parseFromString(unsafeHtml,'text/html');const elements=[].concat(...createdDocument.body.querySelectorAll('*'));for(let i=0,len=elements.length;i<len;i++){const element=elements[i];const elementName=element.nodeName.toLowerCase();if(!Object.keys(allowList).includes(elementName)){element.remove();continue;} 4628const attributeList=[].concat(...element.attributes);const allowedAttributes=[].concat(allowList['*']||[],allowList[elementName]||[]);attributeList.forEach(attribute=>{if(!allowedAttribute(attribute,allowedAttributes)){element.removeAttribute(attribute.nodeName);}});} 4629return createdDocument.body.innerHTML;} 4630const NAME='tooltip';const DATA_KEY='bs.tooltip';const EVENT_KEY=`.${DATA_KEY}`;const CLASS_PREFIX='bs-tooltip';const DISALLOWED_ATTRIBUTES=new Set(['sanitize','allowList','sanitizeFn']);const DefaultType={animation:'boolean',template:'string',title:'(string|element|function)',trigger:'string',delay:'(number|object)',html:'boolean',selector:'(string|boolean)',placement:'(string|function)',offset:'(array|string|function)',container:'(string|element|boolean)',fallbackPlacements:'array',boundary:'(string|element)',customClass:'(string|function)',sanitize:'boolean',sanitizeFn:'(null|function)',allowList:'object',popperConfig:'(null|object|function)'};const AttachmentMap={AUTO:'auto',TOP:'top',RIGHT:isRTL()?'left':'right',BOTTOM:'bottom',LEFT:isRTL()?'right':'left'};const Default={animation:true,template:'<div class="tooltip" role="tooltip">'+'<div class="tooltip-arrow"></div>'+'<div class="tooltip-inner"></div>'+'</div>',trigger:'hover focus',title:'',delay:0,html:false,selector:false,placement:'top',offset:[0,0],container:false,fallbackPlacements:['top','right','bottom','left'],boundary:'clippingParents',customClass:'',sanitize:true,sanitizeFn:null,allowList:DefaultAllowlist,popperConfig:null};const Event={HIDE:`hide${EVENT_KEY}`,HIDDEN:`hidden${EVENT_KEY}`,SHOW:`show${EVENT_KEY}`,SHOWN:`shown${EVENT_KEY}`,INSERTED:`inserted${EVENT_KEY}`,CLICK:`click${EVENT_KEY}`,FOCUSIN:`focusin${EVENT_KEY}`,FOCUSOUT:`focusout${EVENT_KEY}`,MOUSEENTER:`mouseenter${EVENT_KEY}`,MOUSELEAVE:`mouseleave${EVENT_KEY}`};const CLASS_NAME_FADE='fade';const CLASS_NAME_MODAL='modal';const CLASS_NAME_SHOW='show';const HOVER_STATE_SHOW='show';const HOVER_STATE_OUT='out';const SELECTOR_TOOLTIP_INNER='.tooltip-inner';const SELECTOR_MODAL=`.${CLASS_NAME_MODAL}`;const EVENT_MODAL_HIDE='hide.bs.modal';const TRIGGER_HOVER='hover';const TRIGGER_FOCUS='focus';const TRIGGER_CLICK='click';const TRIGGER_MANUAL='manual';class Tooltip extends BaseComponent__default.default{constructor(element,config){if(typeof Popper__namespace==='undefined'){throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');} 4631super(element);this._isEnabled=true;this._timeout=0;this._hoverState='';this._activeTrigger={};this._popper=null;this._config=this._getConfig(config);this.tip=null;this._setListeners();} 4632static get Default(){return Default;} 4633static get NAME(){return NAME;} 4634static get Event(){return Event;} 4635static get DefaultType(){return DefaultType;} 4636enable(){this._isEnabled=true;} 4637disable(){this._isEnabled=false;} 4638toggleEnabled(){this._isEnabled=!this._isEnabled;} 4639toggle(event){if(!this._isEnabled){return;} 4640if(event){const context=this._initializeOnDelegatedTarget(event);context._activeTrigger.click=!context._activeTrigger.click;if(context._isWithActiveTrigger()){context._enter(null,context);}else{context._leave(null,context);}}else{if(this.getTipElement().classList.contains(CLASS_NAME_SHOW)){this._leave(null,this);return;} 4641this._enter(null,this);}} 4642dispose(){clearTimeout(this._timeout);EventHandler__default.default.off(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler);if(this.tip){this.tip.remove();} 4643this._disposePopper();super.dispose();} 4644show(){if(this._element.style.display==='none'){throw new Error('Please use show on visible elements');} 4645if(!(this.isWithContent()&&this._isEnabled)){return;} 4646const showEvent=EventHandler__default.default.trigger(this._element,this.constructor.Event.SHOW);const shadowRoot=findShadowRoot(this._element);const isInTheDom=shadowRoot===null?this._element.ownerDocument.documentElement.contains(this._element):shadowRoot.contains(this._element);if(showEvent.defaultPrevented||!isInTheDom){return;} 4647if(this.constructor.NAME==='tooltip'&&this.tip&&this.getTitle()!==this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML){this._disposePopper();this.tip.remove();this.tip=null;} 4648const tip=this.getTipElement();const tipId=getUID(this.constructor.NAME);tip.setAttribute('id',tipId);this._element.setAttribute('aria-describedby',tipId);if(this._config.animation){tip.classList.add(CLASS_NAME_FADE);} 4649const placement=typeof this._config.placement==='function'?this._config.placement.call(this,tip,this._element):this._config.placement;const attachment=this._getAttachment(placement);this._addAttachmentClass(attachment);const{container}=this._config;Data__default.default.set(tip,this.constructor.DATA_KEY,this);if(!this._element.ownerDocument.documentElement.contains(this.tip)){container.append(tip);EventHandler__default.default.trigger(this._element,this.constructor.Event.INSERTED);}
4650if(this._popper){this._popper.update();}else{this._popper=Popper__namespace.createPopper(this._element,tip,this._getPopperConfig(attachment));} 4651tip.classList.add(CLASS_NAME_SHOW);const customClass=this._resolvePossibleFunction(this._config.customClass);if(customClass){tip.classList.add(...customClass.split(' '));} 4652if('ontouchstart'in document.documentElement){[].concat(...document.body.children).forEach(element=>{EventHandler__default.default.on(element,'mouseover',noop);});} 4653const complete=()=>{const prevHoverState=this._hoverState;this._hoverState=null;EventHandler__default.default.trigger(this._element,this.constructor.Event.SHOWN);if(prevHoverState===HOVER_STATE_OUT){this._leave(null,this);}};const isAnimated=this.tip.classList.contains(CLASS_NAME_FADE);this._queueCallback(complete,this.tip,isAnimated);} 4654hide(){if(!this._popper){return;} 4655const tip=this.getTipElement();const complete=()=>{if(!this._element||!this._config){return;} 4656if(this._isWithActiveTrigger()){return;} 4657if(this._hoverState!==HOVER_STATE_SHOW){tip.remove();} 4658this._cleanTipClass();this._element.removeAttribute('aria-describedby');EventHandler__default.default.trigger(this._element,this.constructor.Event.HIDDEN);this._disposePopper();};const hideEvent=EventHandler__default.default.trigger(this._element,this.constructor.Event.HIDE);if(hideEvent.defaultPrevented){return;} 4659tip.classList.remove(CLASS_NAME_SHOW);if('ontouchstart'in document.documentElement){[].concat(...document.body.children).forEach(element=>EventHandler__default.default.off(element,'mouseover',noop));} 4660this._activeTrigger[TRIGGER_CLICK]=false;this._activeTrigger[TRIGGER_FOCUS]=false;this._activeTrigger[TRIGGER_HOVER]=false;const isAnimated=this.tip.classList.contains(CLASS_NAME_FADE);this._queueCallback(complete,this.tip,isAnimated);this._hoverState='';} 4661update(){if(this._popper!==null){this._popper.update();}} 4662isWithContent(){return Boolean(this.getTitle());} 4663getTipElement(){if(this.tip){return this.tip;} 4664const element=document.createElement('div');element.innerHTML=this._config.template;const tip=element.children[0];this.setContent(tip);tip.classList.remove(CLASS_NAME_FADE,CLASS_NAME_SHOW);this.tip=tip;return this.tip;} 4665setContent(tip){this._sanitizeAndSetContent(tip,this.getTitle(),SELECTOR_TOOLTIP_INNER);} 4666_sanitizeAndSetContent(template,content,selector){const templateElement=SelectorEngine__default.default.findOne(selector,template);
4666if(!content&&templateElement){templateElement.remove();return;} 4667this.setElementContent(templateElement,content);} 4668setElementContent(element,content){if(element===null){return;} 4669if(isElement(content)){content=getElement(content);if(this._config.html){if(content.parentNode!==element){element.innerHTML='';element.append(content);}}else{element.textContent=content.textContent;} 4670return;} 4671if(this._config.html){if(this._config.sanitize){content=sanitizeHtml(content,this._config.allowList,this._config.sanitizeFn);} 4672element.innerHTML=content;}else{element.textContent=content;}} 4673getTitle(){const title=this._element.getAttribute('data-bs-original-title')||this._config.title;return this._resolvePossibleFunction(title);} 4674updateAttachment(attachment){if(attachment==='right'){return'end';} 4675if(attachment==='left'){return'start';} 4676return attachment;} 4677_initializeOnDelegatedTarget(event,context){return context||this.constructor.getOrCreateInstance(event.delegateTarget,this._getDelegateConfig());} 4678_getOffset(){const{offset}=this._config;if(typeof offset==='string'){return offset.split(',').map(val=>Number.parseInt(val,10));} 4679if(typeof offset==='function'){return popperData=>offset(popperData,this._element);} 4680return offset;} 4681_resolvePossibleFunction(content){return typeof content==='function'?content.call(this._element):content;} 4682_getPopperConfig(attachment){const defaultBsPopperConfig={placement:attachment,modifiers:[{name:'flip',options:{fallbackPlacements:this._config.fallbackPlacements}},{name:'offset',options:{offset:this._getOffset()}},{name:'preventOverflow',options:{boundary:this._config.boundary}},{name:'arrow',options:{element:`.${this.constructor.NAME}-arrow`}},{name:'onChange',enabled:true,phase:'afterWrite',fn:data=>this._handlePopperPlacementChange(data)}],onFirstUpdate:data=>{if(data.options.placement!==data.placement){this._handlePopperPlacementChange(data);}}};return{...defaultBsPopperConfig,...(typeof this._config.popperConfig==='function'?this._config.popperConfig(defaultBsPopperConfig):this._config.popperConfig)};} 4683_addAttachmentClass(attachment){this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);} 4684_getAttachment(placement){return AttachmentMap[placement.toUpperCase()];} 4685_setListeners(){const triggers=this._config.trigger.split(' ');triggers.forEach(trigger=>{if(trigger==='click'){EventHandler__default.default.on(this._element,this.constructor.Event.CLICK,this._config.selector,event=>this.toggle(event));}else if(trigger!==TRIGGER_MANUAL){const eventIn=trigger===TRIGGER_HOVER?this.constructor.Event.MOUSEENTER:this.constructor.Event.FOCUSIN;const eventOut=trigger===TRIGGER_HOVER?this.constructor.Event.MOUSELEAVE:this.constructor.Event.FOCUSOUT;EventHandler__default.default.on(this._element,eventIn,this._config.selector,event=>this._enter(event));EventHandler__default.default.on(this._element,eventOut,this._config.selector,event=>this._leave(event));}});this._hideModalHandler=()=>{if(this._element){this.hide();}};EventHandler__default.default.on(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler);if(this._config.selector){this._config={...this._config,trigger:'manual',selector:''};}else{this._fixTitle();}} 4686_fixTitle(){const title=this._element.getAttribute('title');const originalTitleType=typeof this._element.getAttribute('data-bs-original-title');if(title||originalTitleType!=='string'){this._element.setAttribute('data-bs-original-title',title||'');if(title&&!this._element.getAttribute('aria-label')&&!this._element.textContent){this._element.setAttribute('aria-label',title);} 4687this._element.setAttribute('title','');}} 4688_enter(event,context){context=this._initializeOnDelegatedTarget(event,context);if(event){context._activeTrigger[event.type==='focusin'?TRIGGER_FOCUS:TRIGGER_HOVER]=true;} 4689if(context.getTipElement().classList.contains(CLASS_NAME_SHOW)||context._hoverState===HOVER_STATE_SHOW){context._hoverState=HOVER_STATE_SHOW;return;} 4690clearTimeout(context._timeout);context._hoverState=HOVER_STATE_SHOW;if(!context._config.delay||!context._config.delay.show){context.show();return;} 4691context._timeout=setTimeout(()=>{if(context._hoverState===HOVER_STATE_SHOW){context.show();}},context._config.delay.show);} 4692_leave(event,context){context=this._initializeOnDelegatedTarget(event,context);if(event){context._activeTrigger[event.type==='focusout'?TRIGGER_FOCUS:TRIGGER_HOVER]=context._element.contains(event.relatedTarget);} 4693if(context._isWithActiveTrigger()){return;} 4694clearTimeout(context._timeout);context._hoverState=HOVER_STATE_OUT;if(!context._config.delay||!context._config.delay.hide){context.hide();return;} 4695context._timeout=setTimeout(()=>{if(context._hoverState===HOVER_STATE_OUT){context.hide();}},context._config.delay.hide);} 4696_isWithActiveTrigger(){for(const trigger in this._activeTrigger){if(this._activeTrigger[trigger]){return true;}} 4697return false;} 4698_getConfig(config){const dataAttributes=Manipulator__default.default.getDataAttributes(this._element);
4698Object.keys(dataAttributes).forEach(dataAttr=>{if(DISALLOWED_ATTRIBUTES.has(dataAttr)){delete dataAttributes[dataAttr];}});config={...this.constructor.Default,...dataAttributes,...(typeof config==='object'&&config?config:{})};config.container=config.container===false?document.body:getElement(config.container);if(typeof config.delay==='number'){config.delay={show:config.delay,hide:config.delay};} 4699if(typeof config.title==='number'){config.title=config.title.toString();} 4700if(typeof config.content==='number'){config.content=config.content.toString();} 4701typeCheckConfig(NAME,config,this.constructor.DefaultType);if(config.sanitize){config.template=sanitizeHtml(config.template,config.allowList,config.sanitizeFn);} 4702return config;} 4703_getDelegateConfig(){const config={};for(const key in this._config){if(this.constructor.Default[key]!==this._config[key]){config[key]=this._config[key];}} 4704return config;} 4705_cleanTipClass(){const tip=this.getTipElement();const basicClassPrefixRegex=new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`,'g');const tabClass=tip.getAttribute('class').match(basicClassPrefixRegex);if(tabClass!==null&&tabClass.length>0){tabClass.map(token=>token.trim()).forEach(tClass=>tip.classList.remove(tClass));}} 4706_getBasicClassPrefix(){return CLASS_PREFIX;} 4707_handlePopperPlacementChange(popperData){const{state}=popperData;if(!state){return;} 4708this.tip=state.elements.popper;this._cleanTipClass();this._addAttachmentClass(this._getAttachment(state.placement));} 4709_disposePopper(){if(this._popper){this._popper.destroy();this._popper=null;}} 4710static jQueryInterface(config){return this.each(function(){const data=Tooltip.getOrCreateInstance(this,config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);} 4711data[config]();}});}} 4712defineJQueryPlugin(Tooltip);return Tooltip;}));; 4713 4714/* /web/static/lib/bootstrap/js/dist/popover.js */ 4715(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./tooltip.js')):typeof define==='function'&&define.amd?define(['./tooltip'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Popover=factory(global.Tooltip));})(this,(function(Tooltip){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const Tooltip__default=_interopDefaultLegacy(Tooltip);const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4716return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4717DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const NAME='popover';const DATA_KEY='bs.popover';const EVENT_KEY=`.${DATA_KEY}`;const CLASS_PREFIX='bs-popover';const Default={...Tooltip__default.default.Default,placement:'right',offset:[0,8],trigger:'click',content:'',template:'<div class="popover" role="tooltip">'+'<div class="popover-arrow"></div>'+'<h3 class="popover-header"></h3>'+'<div class="popover-body"></div>'+'</div>'};const DefaultType={...Tooltip__default.default.DefaultType,content:'(string|element|function)'};const Event={HIDE:`hide${EVENT_KEY}`,HIDDEN:`hidden${EVENT_KEY}`,SHOW:`show${EVENT_KEY}`,SHOWN:`shown${EVENT_KEY}`,INSERTED:`inserted${EVENT_KEY}`,CLICK:`click${EVENT_KEY}`,FOCUSIN:`focusin${EVENT_KEY}`,FOCUSOUT:`focusout${EVENT_KEY}`,MOUSEENTER:`mouseenter${EVENT_KEY}`,MOUSELEAVE:`mouseleave${EVENT_KEY}`};const SELECTOR_TITLE='.popover-header';const SELECTOR_CONTENT='.popover-body';class Popover extends Tooltip__default.default{static get Default(){return Default;} 4718static get NAME(){return NAME;} 4719static get Event(){return Event;} 4720static get DefaultType(){return DefaultType;} 4721isWithContent(){return this.getTitle()||this._getContent();} 4722setContent(tip){this._sanitizeAndSetContent(tip,this.getTitle(),SELECTOR_TITLE);this._sanitizeAndSetContent(tip,this._getContent(),SELECTOR_CONTENT);} 4723_getContent(){return this._resolvePossibleFunction(this._config.content);} 4724_getBasicClassPrefix(){return CLASS_PREFIX;} 4725static jQueryInterface(config){return this.each(function(){const data=Pop
4725over.getOrCreateInstance(this,config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);} 4726data[config]();}});}} 4727defineJQueryPlugin(Popover);return Popover;}));; 4728 4729/* /web/static/lib/bootstrap/js/dist/scrollspy.js */ 4730(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./dom/manipulator','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.ScrollSpy=factory(global.EventHandler,global.Manipulator,global.SelectorEngine,global.Base));})(this,(function(EventHandler,Manipulator,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const toType=obj=>{if(obj===null||obj===undefined){return`${obj}`;} 4731return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4732if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4733selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4734return selector;};const getSelectorFromElement=element=>{const selector=getSelector(element);if(selector){return document.querySelector(selector)?selector:null;} 4735return null;};const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4736if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4737return typeof obj.nodeType!=='undefined';};const getElement=obj=>{if(isElement(obj)){return obj.jquery?obj[0]:obj;} 4738if(typeof obj==='string'&&obj.length>0){return document.querySelector(obj);} 4739return null;};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4740return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4741DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const NAME='scrollspy';const DATA_KEY='bs.scrollspy';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const Default={offset:10,method:'auto',target:''};const DefaultType={offset:'number',method:'string',target:'(string|element)'};const EVENT_ACTIVATE=`activate${EVENT_KEY}`;const EVENT_SCROLL=`scroll${EVENT_KEY}`;const EVENT_LOAD_DATA_API=`load${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_DROPDOWN_ITEM='dropdown-item';const CLASS_NAME_ACTIVE='active';const SELECTOR_DATA_SPY='[data-bs-spy="scroll"]';const SELECTOR_NAV_LIST_GROUP='.nav, .list-group';const SELECTOR_NAV_LINKS='.nav-link';const SELECTOR_NAV_ITEMS='.nav-item';const SELECTOR_LIST_ITEMS='.list-group-item';const SELECTOR_LINK_ITEMS=`${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}
4741, .${CLASS_NAME_DROPDOWN_ITEM}`;const SELECTOR_DROPDOWN='.dropdown';const SELECTOR_DROPDOWN_TOGGLE='.dropdown-toggle';const METHOD_OFFSET='offset';const METHOD_POSITION='position';class ScrollSpy extends BaseComponent__default.default{constructor(element,config){super(element);this._scrollElement=this._element.tagName==='BODY'?window:this._element;this._config=this._getConfig(config);this._offsets=[];this._targets=[];this._activeTarget=null;this._scrollHeight=0;EventHandler__default.default.on(this._scrollElement,EVENT_SCROLL,()=>this._process());this.refresh();this._process();} 4742static get Default(){return Default;} 4743static get NAME(){return NAME;} 4744refresh(){const autoMethod=this._scrollElement===this._scrollElement.window?METHOD_OFFSET:METHOD_POSITION;const offsetMethod=this._config.method==='auto'?autoMethod:this._config.method;const offsetBase=offsetMethod===METHOD_POSITION?this._getScrollTop():0;this._offsets=[];this._targets=[];this._scrollHeight=this._getScrollHeight();const targets=SelectorEngine__default.default.find(SELECTOR_LINK_ITEMS,this._config.target);targets.map(element=>{const targetSelector=getSelectorFromElement(element);const target=targetSelector?SelectorEngine__default.default.findOne(targetSelector):null;if(target){const targetBCR=target.getBoundingClientRect();if(targetBCR.width||targetBCR.height){return[Manipulator__default.default[offsetMethod](target).top+offsetBase,targetSelector];}} 4745return null;}).filter(item=>item).sort((a,b)=>a[0]-b[0]).forEach(item=>{this._offsets.push(item[0]);this._targets.push(item[1]);});} 4746dispose(){EventHandler__default.default.off(this._scrollElement,EVENT_KEY);super.dispose();} 4747_getConfig(config){config={...Default,...Manipulator__default.default.getDataAttributes(this._element),...(typeof config==='object'&&config?config:{})};config.target=getElement(config.target)||document.documentElement;typeCheckConfig(NAME,config,DefaultType);return config;} 4748_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop;} 4749_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);} 4750_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height;} 4751_process(){const scrollTop=this._getScrollTop()+this._config.offset;const scrollHeight=this._getScrollHeight();const maxScroll=this._config.offset+scrollHeight-this._getOffsetHeight();if(this._scrollHeight!==scrollHeight){this.refresh();} 4752if(scrollTop>=maxScroll){const target=this._targets[this._targets.length-1];if(this._activeTarget!==target){this._activate(target);} 4753return;} 4754if(this._activeTarget&&scrollTop<this._offsets[0]&&this._offsets[0]>0){this._activeTarget=null;this._clear();return;} 4755for(let i=this._offsets.length;i--;){const isActiveTarget=this._activeTarget!==this._targets[i]&&scrollTop>=this._offsets[i]&&(typeof this._offsets[i+1]==='undefined'||scrollTop<this._offsets[i+1]);if(isActiveTarget){this._activate(this._targets[i]);}}} 4756_activate(target){this._activeTarget=target;this._clear();const queries=SELECTOR_LINK_ITEMS.split(',').map(selector=>`${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);const link=SelectorEngine__default.default.findOne(queries.join(','),this._config.target);link.classList.add(CLASS_NAME_ACTIVE);if(link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)){SelectorEngine__default.default.findOne(SELECTOR_DROPDOWN_TOGGLE,link.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE);}else{SelectorEngine__default.default.parents(link,SELECTOR_NAV_LIST_GROUP).forEach(listGroup=>{SelectorEngine__default.default.prev(listGroup,`${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`).forEach(item=>item.classList.add(CLASS_NAME_ACTIVE));SelectorEngine__default.default.prev(listGroup,SELECTOR_NAV_ITEMS).forEach(navItem=>{SelectorEngine__default.default.children(navItem,SELECTOR_NAV_LINKS).forEach(item=>item.classList.add(CLASS_NAME_ACTIVE));});});} 4757EventHandler__default.default.trigger(this._scrollElement,EVENT_ACTIVATE,{relatedTarget:target});} 4758_clear(){SelectorEngine__default.default.find(SELECTOR_LINK_ITEMS,this._config.target).filter(node=>
4758node.classList.contains(CLASS_NAME_ACTIVE)).forEach(node=>node.classList.remove(CLASS_NAME_ACTIVE));} 4759static jQueryInterface(config){return this.each(function(){const data=ScrollSpy.getOrCreateInstance(this,config);if(typeof config!=='string'){return;} 4760if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);} 4761data[config]();});}} 4762EventHandler__default.default.on(window,EVENT_LOAD_DATA_API,()=>{SelectorEngine__default.default.find(SELECTOR_DATA_SPY).forEach(spy=>new ScrollSpy(spy));});defineJQueryPlugin(ScrollSpy);return ScrollSpy;}));; 4763 4764/* /web/static/lib/bootstrap/js/dist/tab.js */ 4765(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./dom/selector-engine.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./dom/selector-engine','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Tab=factory(global.EventHandler,global.SelectorEngine,global.Base));})(this,(function(EventHandler,SelectorEngine,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const SelectorEngine__default=_interopDefaultLegacy(SelectorEngine);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4766if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4767selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4768return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4769if(element.classList.contains('disabled')){return true;} 4770if(typeof element.disabled!=='undefined'){return element.disabled;} 4771return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4772return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4773DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const NAME='tab';const DATA_KEY='bs.tab';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_DROPDOWN_MENU='dropdown-menu';const CLASS_NAME_ACTIVE='active';const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';const SELECTOR_DROPDOWN='.dropdown';const SELECTOR_NAV_LIST_GROUP='.nav, .list-group';const SELECTOR_ACTIVE='.active';const SELECTOR_ACTIVE_UL=':scope > li > .active';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';const SELECTOR_DROPDOWN_TOGGLE='.dropdown-toggle';
4773const SELECTOR_DROPDOWN_ACTIVE_CHILD=':scope > .dropdown-menu .active';class Tab extends BaseComponent__default.default{static get NAME(){return NAME;} 4774show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains(CLASS_NAME_ACTIVE)){return;} 4775let previous;const target=getElementFromSelector(this._element);const listElement=this._element.closest(SELECTOR_NAV_LIST_GROUP);if(listElement){const itemSelector=listElement.nodeName==='UL'||listElement.nodeName==='OL'?SELECTOR_ACTIVE_UL:SELECTOR_ACTIVE;previous=SelectorEngine__default.default.find(itemSelector,listElement);previous=previous[previous.length-1];} 4776const hideEvent=previous?EventHandler__default.default.trigger(previous,EVENT_HIDE,{relatedTarget:this._element}):null;const showEvent=EventHandler__default.default.trigger(this._element,EVENT_SHOW,{relatedTarget:previous});if(showEvent.defaultPrevented||hideEvent!==null&&hideEvent.defaultPrevented){return;} 4777this._activate(this._element,listElement);const complete=()=>{EventHandler__default.default.trigger(previous,EVENT_HIDDEN,{relatedTarget:this._element});EventHandler__default.default.trigger(this._element,EVENT_SHOWN,{relatedTarget:previous});};if(target){this._activate(target,target.parentNode,complete);}else{complete();}} 4778_activate(element,container,callback){const activeElements=container&&(container.nodeName==='UL'||container.nodeName==='OL')?SelectorEngine__default.default.find(SELECTOR_ACTIVE_UL,container):SelectorEngine__default.default.children(container,SELECTOR_ACTIVE);const active=activeElements[0];const isTransitioning=callback&&active&&active.classList.contains(CLASS_NAME_FADE);const complete=()=>this._transitionComplete(element,active,callback);if(active&&isTransitioning){active.classList.remove(CLASS_NAME_SHOW);this._queueCallback(complete,element,true);}else{complete();}} 4779_transitionComplete(element,active,callback){if(active){active.classList.remove(CLASS_NAME_ACTIVE);const dropdownChild=SelectorEngine__default.default.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD,active.parentNode);if(dropdownChild){dropdownChild.classList.remove(CLASS_NAME_ACTIVE);} 4780if(active.getAttribute('role')==='tab'){active.setAttribute('aria-selected',false);}} 4781element.classList.add(CLASS_NAME_ACTIVE);if(element.getAttribute('role')==='tab'){element.setAttribute('aria-selected',true);} 4782reflow(element);if(element.classList.contains(CLASS_NAME_FADE)){element.classList.add(CLASS_NAME_SHOW);} 4783let parent=element.parentNode;if(parent&&parent.nodeName==='LI'){parent=parent.parentNode;} 4784if(parent&&parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)){const dropdownElement=element.closest(SELECTOR_DROPDOWN);if(dropdownElement){SelectorEngine__default.default.find(SELECTOR_DROPDOWN_TOGGLE,dropdownElement).forEach(dropdown=>dropdown.classList.add(CLASS_NAME_ACTIVE));} 4785element.setAttribute('aria-expanded',true);} 4786if(callback){callback();}} 4787static jQueryInterface(config){return this.each(function(){const data=Tab.getOrCreateInstance(this);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);} 4788data[config]();}});}} 4789EventHandler__default.default.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4790if(isDisabled(this)){return;} 4791const data=Tab.getOrCreateInstance(this);data.show();});defineJQueryPlugin(Tab);return Tab;}));; 4792 4793/* /web/static/lib/bootstrap/js/dist/toast.js */ 4794(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./base-component.js')):typeof define==='function'&&define.amd?define(['./dom/event-handler','./dom/manipulator','./base-component'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Toast=factory(global.EventHandler,global.Manipulator,global.Base));})(this,(function(EventHandler,Manipulator,BaseComponent){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{default:e};const EventHandler__default=_interopDefaultLegacy(EventHandler);const Manipulator__default=_interopDefaultLegacy(Manipulator);const BaseComponent__default=_interopDefaultLegacy(BaseComponent);const toType=obj=>
vendor: 4,449 bytes, lines 4794-4813
4794{if(obj===null||obj===undefined){return`${obj}`;} 4795return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();};const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttr=element.getAttribute('href');if(!hrefAttr||!hrefAttr.includes('#')&&!hrefAttr.startsWith('.')){return null;} 4796if(hrefAttr.includes('#')&&!hrefAttr.startsWith('#')){hrefAttr=`#${hrefAttr.split('#')[1]}`;} 4797selector=hrefAttr&&hrefAttr!=='#'?hrefAttr.trim():null;} 4798return selector;};const getElementFromSelector=element=>{const selector=getSelector(element);return selector?document.querySelector(selector):null;};const isElement=obj=>{if(!obj||typeof obj!=='object'){return false;} 4799if(typeof obj.jquery!=='undefined'){obj=obj[0];} 4800return typeof obj.nodeType!=='undefined';};const typeCheckConfig=(componentName,config,configTypes)=>{Object.keys(configTypes).forEach(property=>{const expectedTypes=configTypes[property];const value=config[property];const valueType=value&&isElement(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}});};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;} 4801if(element.classList.contains('disabled')){return true;} 4802if(typeof element.disabled!=='undefined'){return element.disabled;} 4803return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{const{jQuery}=window;if(jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return jQuery;} 4804return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{DOMContentLoadedCallbacks.forEach(callback=>callback());});} 4805DOMContentLoadedCallbacks.push(callback);}else{callback();}};const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const enableDismissTrigger=(component,method='hide')=>{const clickEvent=`click.dismiss${component.EVENT_KEY}`;const name=component.NAME;EventHandler__default.default.on(document,clickEvent,`[data-bs-dismiss="${name}"]`,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();} 4806if(isDisabled(this)){return;} 4807const target=getElementFromSelector(this)||this.closest(`.${name}`);const instance=component.getOrCreateInstance(target);instance[method]();});};const NAME='toast';const DATA_KEY='bs.toast';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_MOUSEOVER=`mouseover${EVENT_KEY}`;const EVENT_MOUSEOUT=`mouseout${EVENT_KEY}`;const EVENT_FOCUSIN=`focusin${EVENT_KEY}`;const EVENT_FOCUSOUT=`focusout${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const CLASS_NAME_FADE='fade';const CLASS_NAME_HIDE='hide';const CLASS_NAME_SHOW='show';const CLASS_NAME_SHOWING='showing';const DefaultType={animation:'boolean',autohide:'boolean',delay:'number'};const Default={animation:true,autohide:true,delay:5000};class Toast extends BaseComponent__default.default{constructor(element,config){super(element);this._config=this._getConfig(config);this._timeout=null;this._hasMouseInteraction=false;this._hasKeyboardInteraction=false;this._setListeners();} 4808static get DefaultType(){return DefaultType;} 4809static get Default(){return Default;} 4810static get NAME(){return NAME;} 4811show(){const showEvent=EventHandler__default.default.trigger(this._element,EVENT_SHOW);if(showEvent.defaultPrevented){return;} 4812this._clearTimeout();if(this._config.animation){this._element.classList.add(CLASS_NAME_FADE);} 4813const complete=()=>{this._element.classList.remove(CLASS_NAME_SHOWING);EventHandler__default.default.trigger(this._element,EVENT_SHOWN);this._maybeScheduleHide();};this._element.classList.remove(CLASS_NAME_HIDE);reflow(this._element);this._element.classList.add(CLASS_NAME_SHOW);this._element.classList.add(CLASS_NAME_SHOWING);this._queueCallback(complete,this._element,this._config.animation);}
4814hide(){if(!this._element.classList.contains(CLASS_NAME_SHOW)){return;} 4815const hideEvent=EventHandler__default.default.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;} 4816const complete=()=>{this._element.classList.add(CLASS_NAME_HIDE);this._element.classList.remove(CLASS_NAME_SHOWING);this._element.classList.remove(CLASS_NAME_SHOW);EventHandler__default.default.trigger(this._element,EVENT_HIDDEN);};this._element.classList.add(CLASS_NAME_SHOWING);this._queueCallback(complete,this._element,this._config.animation);} 4817dispose(){this._clearTimeout();if(this._element.classList.contains(CLASS_NAME_SHOW)){this._element.classList.remove(CLASS_NAME_SHOW);} 4818super.dispose();} 4819_getConfig(config){config={...Default,...Manipulator__default.default.getDataAttributes(this._element),...(typeof config==='object'&&config?config:{})};typeCheckConfig(NAME,config,this.constructor.DefaultType);return config;} 4820_maybeScheduleHide(){if(!this._config.autohide){return;} 4821if(this._hasMouseInteraction||this._hasKeyboardInteraction){return;} 4822this._timeout=setTimeout(()=>{this.hide();},this._config.delay);} 4823_onInteraction(event,isInteracting){switch(event.type){case'mouseover':case'mouseout':this._hasMouseInteraction=isInteracting;break;case'focusin':case'focusout':this._hasKeyboardInteraction=isInteracting;break;} 4824if(isInteracting){this._clearTimeout();return;} 4825const nextElement=event.relatedTarget;if(this._element===nextElement||this._element.contains(nextElement)){return;} 4826this._maybeScheduleHide();} 4827_setListeners(){EventHandler__default.default.on(this._element,EVENT_MOUSEOVER,event=>this._onInteraction(event,true));EventHandler__default.default.on(this._element,EVENT_MOUSEOUT,event=>this._onInteraction(event,false));EventHandler__default.default.on(this._element,EVENT_FOCUSIN,event=>this._onInteraction(event,true));EventHandler__default.default.on(this._element,EVENT_FOCUSOUT,event=>this._onInteraction(event,false));} 4828_clearTimeout(){clearTimeout(this._timeout);this._timeout=null;} 4829static jQueryInterface(config){return this.each(function(){const data=Toast.getOrCreateInstance(this,config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);} 4830data[config](this);}});}} 4831enableDismissTrigger(Toast);defineJQueryPlugin(Toast);return Toast;}));; 4832 4833/* /web/static/lib/tempusdominus/tempusdominus.js */ 4834if(typeof jQuery==='undefined'){throw new Error('Tempus Dominus Bootstrap4\'s requires jQuery. jQuery must be included before Tempus Dominus Bootstrap4\'s JavaScript.');} 4835+function($){var version=$.fn.jquery.split(' ')[0].split('.');if((version[0]<2&&version[1]<9)||(version[0]===1&&version[1]===9&&version[2]<1)||(version[0]>=4)){throw new Error('Tempus Dominus Bootstrap4\'s requires at least jQuery v3.0.0 but less than v4.0.0');}}(jQuery);if(typeof moment==='undefined'){throw new Error('Tempus Dominus Bootstrap4\'s requires moment.js. Moment.js must be included before Tempus Dominus Bootstrap4\'s JavaScript.');} 4836var version=moment.version.split('.') 4837if((version[0]<=2&&version[1]<17)||(version[0]>=3)){throw new Error('Tempus Dominus Bootstrap4\'s requires at least moment.js v2.17.0 but less than v3.0.0');} 4838+function(){var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;} 4839function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;} 4840function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}} 4841var DateTimePicker=function($,moment){var NAME='datetimepicker',DATA_KEY=''+NAME,EVENT_KEY='.'+DATA_KEY,DATA_API_KEY='.data-api',Selector={DATA_TOGGLE:'body:not(.o_lazy_js_waiting) [data-toggle="'+DATA_KEY+'"]'},ClassName={INPUT:NAME+'-input'},Event={CHANGE:'change'+EVENT_KEY,BLUR:'blur'+EVENT_KEY,KEYUP:'keyup'+EVENT_KEY,KEYDOWN:'keydown'+EVENT_KEY,FOCUS:'focus'+EVENT_KEY,CLICK_DATA_API:'click'+EVENT_KEY+DATA_API_KEY,UPDATE:'update'+EVENT_KEY,ERROR:'error'+EVENT_KEY,HIDE:'hide'+EVENT_KEY,SHOW:'show'+EVENT_KEY},DatePickerModes=[{CLASS_NAME:'days',NAV_FUNCTION:'M',NAV_STEP:1},{CLASS_NAME:'months',NAV_FUNCTION:'y',NAV_STEP:1},{CLASS_NAME:'years',NAV_FUNCTION:'y',NAV_STEP:10},{CLASS_NAME:'decades',NAV_FUNCTION:'y',NAV_STEP:100}],KeyMap={'up':38,38:'up','down':40,40:'down','left':37,37:'left','right':39,39:'r
4841ight','tab':9,9:'tab','escape':27,27:'escape','enter':13,13:'enter','pageUp':33,33:'pageUp','pageDown':34,34:'pageDown','shift':16,16:'shift','control':17,17:'control','space':32,32:'space','t':84,84:'t','delete':46,46:'delete'},ViewModes=['times','days','months','years','decades'],keyState={},keyPressHandled={};var Default={timeZone:'',format:false,dayViewHeaderFormat:'MMMM YYYY',extraFormats:false,stepping:1,minDate:false,maxDate:false,useCurrent:true,collapse:true,locale:moment.locale(),defaultDate:false,disabledDates:false,enabledDates:false,icons:{time:'fa fa-clock-o',date:'fa fa-calendar',up:'fa fa-arrow-up',down:'fa fa-arrow-down',previous:'fa fa-chevron-left',next:'fa fa-chevron-right',today:'fa fa-calendar-check-o',clear:'fa fa-trash',close:'fa fa-times'},tooltips:{today:'Go to today',clear:'Clear selection',close:'Close the picker',selectMonth:'Select Month',prevMonth:'Previous Month',nextMonth:'Next Month',selectYear:'Select Year',prevYear:'Previous Year',nextYear:'Next Year',selectDecade:'Select Decade',prevDecade:'Previous Decade',nextDecade:'Next Decade',prevCentury:'Previous Century',nextCentury:'Next Century',pickHour:'Pick Hour',incrementHour:'Increment Hour',decrementHour:'Decrement Hour',pickMinute:'Pick Minute',incrementMinute:'Increment Minute',decrementMinute:'Decrement Minute',pickSecond:'Pick Second',incrementSecond:'Increment Second',decrementSecond:'Decrement Second',togglePeriod:'Toggle Period',selectTime:'Select Time',selectDate:'Select Date'},useStrict:false,sideBySide:false,daysOfWeekDisabled:false,calendarWeeks:false,viewMode:'days',toolbarPlacement:'default',buttons:{showToday:false,showClear:false,showClose:false},widgetPositioning:{horizontal:'auto',vertical:'auto'},widgetParent:null,ignoreReadonly:false,keepOpen:false,focusOnShow:true,inline:false,keepInvalid:false,keyBinds:{up:function up(){if(!this.widget){return false;} 4842var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().subtract(7,'d'));}else{this.date(d.clone().add(this.stepping(),'m'));} 4843return true;},down:function down(){if(!this.widget){this.show();return false;} 4844var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().add(7,'d'));}else{this.date(d.clone().subtract(this.stepping(),'m'));} 4845return true;},'control up':function controlUp(){if(!this.widget){return false;} 4846var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().subtract(1,'y'));}else{this.date(d.clone().add(1,'h'));} 4847return true;},'control down':function controlDown(){if(!this.widget){return false;} 4848var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().add(1,'y'));}else{this.date(d.clone().subtract(1,'h'));} 4849return true;},left:function left(){if(!this.widget){return false;} 4850var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().subtract(1,'d'));} 4851return true;},right:function right(){if(!this.widget){return false;} 4852var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().add(1,'d'));} 4853return true;},pageUp:function pageUp(){if(!this.widget){return false;} 4854var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().subtract(1,'M'));} 4855return true;},pageDown:function pageDown(){if(!this.widget){return false;} 4856var d=this._dates[0]||this.getMoment();if(this.widget.find('.datepicker').is(':visible')){this.date(d.clone().add(1,'M'));} 4857return true;},enter:function enter(){if(!this.widget){return false;} 4858this.hide();return true;},escape:function escape(){if(!this.widget){return false;} 4859this.hide();return true;},'control space':function controlSpace(){if(!this.widget){return false;} 4860if(this.widget.find('.timepicker').is(':visible')){this.widget.find('.btn[data-action="togglePeriod"]').click();} 4861return true;},t:function t(){if(!this.widget){return false;} 4862this.date(this.getMoment());return true;},'delete':function _delete(){if(!this.widget){return false;} 4863this.clear();return true;}},debug:false,allowInputToggle:false,disabledTimeIntervals:false,disabledHours:false,enabledHours:false,viewD
vendor: 59,604 bytes, lines 4863-5132
4863ate:false,allowMultidate:false,multidateSeparator:','};var DateTimePicker=function(){function DateTimePicker(element,options){_classCallCheck(this,DateTimePicker);this._options=this._getOptions(options);this._element=element;this._dates=[];this._datesFormatted=[];this._viewDate=null;this.unset=true;this.component=false;this.widget=false;this.use24Hours=null;this.actualFormat=null;this.parseFormats=null;this.currentViewMode=null;this.MinViewModeNumber=0;this._int();} 4864DateTimePicker.prototype._int=function _int(){var targetInput=this._element.data('target-input');if(this._element.is('input')){this.input=this._element;}else if(targetInput!==undefined){if(targetInput==='nearest'){this.input=this._element.find('input');}else{this.input=$(targetInput);}} 4865this._dates=[];this._dates[0]=this.getMoment();this._viewDate=this.getMoment().clone();$.extend(true,this._options,this._dataToOptions());this.options(this._options);this._initFormatting();if(this.input!==undefined&&this.input.is('input')&&this.input.val().trim().length!==0){this._setValue(this._parseInputDate(this.input.val().trim()),0);}else if(this._options.defaultDate&&this.input!==undefined&&this.input.attr('placeholder')===undefined){this._setValue(this._options.defaultDate,0);} 4866if(this._options.inline){this.show();}};DateTimePicker.prototype._update=function _update(){if(!this.widget){return;} 4867this._fillDate();this._fillTime();};DateTimePicker.prototype._setValue=function _setValue(targetMoment,index){var oldDate=this.unset?null:this._dates[index];var outpValue='';if(!targetMoment){if(!this._options.allowMultidate||this._dates.length===1){this.unset=true;this._dates=[];this._datesFormatted=[];}else{outpValue=this._element.data('date')+',';outpValue=outpValue.replace(oldDate.format(this.actualFormat)+',','').replace(',,','').replace(/,\s*$/,'');this._dates.splice(index,1);this._datesFormatted.splice(index,1);} 4868if(this.input!==undefined){this.input.val(outpValue);this.input.trigger('input');} 4869this._element.data('date',outpValue);this._notifyEvent({type:DateTimePicker.Event.CHANGE,date:false,oldDate:oldDate});this._update();return;} 4870targetMoment=targetMoment.clone().locale(this._options.locale);if(this._hasTimeZone()){targetMoment.tz(this._options.timeZone);} 4871if(this._options.stepping!==1){targetMoment.minutes(Math.round(targetMoment.minutes()/this._options.stepping)*this._options.stepping).seconds(0);} 4872if(this._isValid(targetMoment)){this._dates[index]=targetMoment;this._datesFormatted[index]=targetMoment.format('YYYY-MM-DD');this._viewDate=targetMoment.clone();if(this._options.allowMultidate&&this._dates.length>1){for(var i=0;i<this._dates.length;i++){outpValue+=''+this._dates[i].format(this.actualFormat)+this._options.multidateSeparator;} 4873outpValue=outpValue.replace(/,\s*$/,'');}else{outpValue=this._dates[index].format(this.actualFormat);} 4874if(this.input!==undefined){this.input.val(outpValue);this.input.trigger('input');} 4875this._element.data('date',outpValue);this.unset=false;this._update();this._notifyEvent({type:DateTimePicker.Event.CHANGE,date:this._dates[index].clone(),oldDate:oldDate});}else{if(!this._options.keepInvalid){if(this.input!==undefined){this.input.val(''+(this.unset?'':this._dates[index].format(this.actualFormat)));this.input.trigger('input');}}else{this._notifyEvent({type:DateTimePicker.Event.CHANGE,date:targetMoment,oldDate:oldDate});} 4876this._notifyEvent({type:DateTimePicker.Event.ERROR,date:targetMoment,oldDate:oldDate});}};DateTimePicker.prototype._change=function _change(e){var val=$(e.target).val().trim(),parsedDate=val?this._parseInputDate(val):null;this._setValue(parsedDate,0);e.stopImmediatePropagation();return false;};DateTimePicker.prototype._getOptions=function _getOptions(options){options=$.extend(true,{},Default,options);return options;};DateTimePicker.prototype._hasTimeZone=function _hasTimeZone(){return moment.tz!==undefined&&this._options.timeZone!==undefined&&this._options.timeZone!==null&&this._options.timeZone!=='';};DateTimePicker.prototype._isEnabled=function _isEnabled(granularity){if(typeof granularity!=='string'||granularity.length>1){throw new TypeError('isEnabled expects a single character string parameter');} 4877switch(granularity){case'y':return this.actualFormat.indexOf('Y')!==-1;case'M':return this.actualFormat.indexOf('M')!==-1;case'd':return this.actualFormat.toLowerCase().indexOf('d')!==-1;case'h':case'H':return this.actualFormat.toLowerCase().indexOf('h')!==-1;case'm':return this.actualFormat.indexOf('m')!==-1;case's':return this.actualFormat.indexOf('s')!==-1;case'a':case'A':return this.actualFormat.toLowerCase().indexOf('a')!==-1;default:return false;}};DateTimePicker.prototype._hasTime=function _hasTime(){return this._isEnabled('h')||this._isEnabled('m')||this._isEnabled('s');};DateTimePicker.prototype._hasDate=function _hasDate(){return this._isEnabled('y')||this._isEnabled('M')||this._isEnabled('d');};DateTimePicker.prototype._dataToOptions=function _dataToOptions(){var eData=this._element.data();var dataOptions={};if(eData.dateOptions&&eData.dateOptions instanceof Object){dataOptions=$.extend(true,dataOptions,eData.dateOptions);} 4878$.each(this._options,function(key){var attributeName='date'+key.charAt(0).toUpperCase()+key.slice(1);if(eData[attributeName]!==undefined){dataOptions[key]=eData[attributeName];}else{delete dataOptions[key];}});return dataOptions;};DateTimePicker.prototype._notifyEvent=function _notifyEvent(e){if(e.type===DateTimePicker.Event.CHANGE){if(!e.date&&!e.oldDate){return;} 4879var bothUTC=e.date&&e.oldDate&&e.date._isUTC===e.oldDate._isUTC;if(bothUTC&&e.date.isSame(e.oldDate)){return;}} 4880this._element.trigger(e);};DateTimePicker.prototype._viewUpdate=function _viewUpdate(e){if(e==='y'){e='YYYY';} 4881this._notifyEvent({type:DateTimePicker.Event.UPDATE,change:e,viewDate:this._viewDate.clone()});};DateTimePicker.prototype._showMode=function _showMode(dir){if(!this.widget){return;} 4882if(dir){this.currentViewMode=Math.max(this.MinViewModeNumber,Math.min(3,this.currentViewMode+dir));} 4883this.widget.find('.datepicker > div').hide().filter('.datepicker-'+DatePickerModes[this.currentViewMode].CLASS_NAME).show();};DateTimePicker.prototype._isInDisabledDates=function _isInDisabledDates(testDate){return this._options.disabledDates[testDate.format('YYYY-MM-DD')]===true;};DateTimePicker.prototype._isInEnabledDates=function _isInEnabledDates(testDate){return this._options.enabledDates[testDate.format('YYYY-MM-DD')]===true;};DateTimePicker.prototype._isInDisabledHours=function _isInDisabledHours(testDate){return this._options.disabledHours[testDate.format('H')]===true;};DateTimePicker.prototype._isInEnabledHours=function _isInEnabledHours(testDate){return this._options.enabledHours[testDate.format('H')]===true;};DateTimePicker.prototype._isValid=function _isValid(targetMoment,granularity){if(!targetMoment.isValid()){return false;} 4884if(this._options.disabledDates&&granularity==='d'&&this._isInDisabledDates(targetMoment)){return false;} 4885if(this._options.enabledDates&&granularity==='d'&&!this._isInEnabledDates(targetMoment)){return false;} 4886if(this._options.minDate&&targetMoment.isBefore(this._options.minDate,granularity)){return false;} 4887if(this._options.maxDate&&targetMoment.isAfter(this._options.maxDate,granularity)){return false;} 4888if(this._options.daysOfWeekDisabled&&granularity==='d'&&this._options.daysOfWeekDisabled.indexOf(targetMoment.day())!==-1){return false;} 4889if(this._options.disabledHours&&(granularity==='h'||granularity==='m'||granularity==='s')&&this._isInDisabledHours(targetMoment)){return false;} 4890if(this._options.enabledHours&&(granularity==='h'||granularity==='m'||granularity==='s')&&!this._isInEnabledHours(targetMoment)){return false;} 4891if(this._options.disabledTimeIntervals&&(granularity==='h'||granularity==='m'||granularity==='s')){var found=false;$.each(this._options.disabledTimeIntervals,function(){if(targetMoment.isBetween(this[0],this[1])){found=true;return false;}});if(found){return false;}} 4892return true;};DateTimePicker.prototype._parseInputDate=function _parseInputDate(inputDate){if(this._options.parseInputDate===undefined){if(!moment.isMoment(inputDate)){inputDate=this.getMoment(inputDate);}}else{inputDate=this._options.parseInputDate(inputDate);} 4893return inputDate;};DateTimePicker.prototype._keydown=function _keydown(e){var handler=null,index=void 0,index2=void 0,keyBindKeys=void 0,allModifiersPressed=void 0;var pressedKeys=[],pressedModifiers={},currentKey=e.which,pressed='p';keyState[currentKey]=pressed;for(index in keyState){if(keyState.hasOwnProperty(index)&&keyState[index]===pressed){pressedKeys.push(index);if(parseInt(index,10)!==currentKey){pressedModifiers[index]=true;}}} 4894for(index in this._options.keyBinds){if(this._options.keyBinds.hasOwnProperty(index)&&typeof this._options.keyBinds[index]==='function'){keyBindKeys=index.split(' ');if(keyBindKeys.length===pressedKeys.length&&KeyMap[currentKey]===keyBindKeys[keyBindKeys.length-1]){allModifiersPressed=true;for(index2=keyBindKeys.length-2;index2>=0;index2--){if(!(KeyMap[keyBindKeys[index2]]in pressedModifiers)){allModifiersPressed=false;break;}} 4895if(allModifiersPressed){handler=this._options.keyBinds[index];break;}}}} 4896if(handler){if(handler.call(this)){e.stopPropagation();e.preventDefault();}}};DateTimePicker.prototype._keyup=function _keyup(e){keyState[e.which]='r';if(keyPressHandled[e.which]){keyPressHandled[e.which]=false;e.stopPropagation();e.preventDefault();}};DateTimePicker.prototype._indexGivenDates=function _indexGivenDates(givenDatesArray){var givenDatesIndexed={},self=this;$.each(givenDatesArray,function(){var dDate=self._parseInputDate(this);if(dDate.isValid()){givenDatesIndexed[dDate.format('YYYY-MM-DD')]=true;}});return Object.keys(givenDatesIndexed).length?givenDatesIndexed:false;};DateTimePicker.prototype._indexGivenHours=function _indexGivenHours(givenHoursArray){var givenHoursIndexed={};$.each(givenHoursArray,function(){givenHoursIndexed[this]=true;});return Object.keys(givenHoursIndexed).length?givenHoursIndexed:false;};DateTimePicker.prototype._initFormatting=function _initFormatting(){var format=this._options.format||'L LT',self=this;this.actualFormat=format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(formatInput){return self._dates[0].localeData().longDateFormat(formatInput)||formatInput;});this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[];if(this.parseFormats.indexOf(format)<0&&this.parseFormats.indexOf(this.actualFormat)<0){this.parseFormats.push(this.actualFormat);} 4897this.use24Hours=this.actualFormat.toLowerCase().indexOf('a')<1&&this.actualFormat.replace(/\[.*?]/g,'').indexOf('h')<1;if(this._isEnabled('y')){this.MinViewModeNumber=2;} 4898if(this._isEnabled('M')){this.MinViewModeNumber=1;} 4899if(this._isEnabled('d')){this.MinViewModeNumber=0;} 4900this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode);if(!this.unset){this._setValue(this._dates[0],0);}};DateTimePicker.prototype._getLastPickedDate=function _getLastPickedDate(){return this._dates[this._getLastPickedDateIndex()]||this.getMoment();};DateTimePicker.prototype._getLastPickedDateIndex=function _getLastPickedDateIndex(){return this._dates.length-1;};DateTimePicker.prototype.getMoment=function getMoment(d,f){var returnMoment=void 0;if(!f){f=this.parseFormats;} 4901if(d===undefined||d===null){returnMoment=moment();}else if(this._hasTimeZone()){returnMoment=moment.tz(d,f,this._options.locale,this._options.useStrict,this._options.timeZone);}else{returnMoment=moment(d,f,this._options.locale,this._options.useStrict);} 4902if(this._hasTimeZone()){returnMoment.tz(this._options.timeZone);} 4903return returnMoment;};DateTimePicker.prototype.toggle=function toggle(){return this.widget?this.hide():this.show();};DateTimePicker.prototype.ignoreReadonly=function ignoreReadonly(_ignoreReadonly){if(arguments.length===0){return this._options.ignoreReadonly;} 4904if(typeof _ignoreReadonly!=='boolean'){throw new TypeError('ignoreReadonly () expects a boolean parameter');} 4905this._options.ignoreReadonly=_ignoreReadonly;};DateTimePicker.prototype.options=function options(newOptions){if(arguments.length===0){return $.extend(true,{},this._options);} 4906if(!(newOptions instanceof Object)){throw new TypeError('options() this.options parameter should be an object');} 4907$.extend(true,this._options,newOptions);var self=this;$.each(this._options,function(key,value){if(self[key]!==undefined){self[key](value);}});};DateTimePicker.prototype.date=function date(newDate,index){index=index||0;if(arguments.length===0){if(this.unset){return null;} 4908if(this._options.allowMultidate){return this._dates.join(this._options.multidateSeparator);}else{return this._dates[index].clone();}} 4909if(newDate!==null&&typeof newDate!=='string'&&!moment.isMoment(newDate)&&!(newDate instanceof Date)){throw new TypeError('date() parameter must be one of [null, string, moment or Date]');} 4910this._setValue(newDate===null?null:this._parseInputDate(newDate),index);};DateTimePicker.prototype.format=function format(newFormat){if(arguments.length===0){return this._options.format;} 4911if(typeof newFormat!=='string'&&(typeof newFormat!=='boolean'||newFormat!==false)){throw new TypeError('format() expects a string or boolean:false parameter '+newFormat);} 4912this._options.format=newFormat;if(this.actualFormat){this._initFormatting();}};DateTimePicker.prototype.timeZone=function timeZone(newZone){if(arguments.length===0){return this._options.timeZone;} 4913if(typeof newZone!=='string'){throw new TypeError('newZone() expects a string parameter');} 4914this._options.timeZone=newZone;};DateTimePicker.prototype.dayViewHeaderFormat=function dayViewHeaderFormat(newFormat){if(arguments.length===0){return this._options.dayViewHeaderFormat;} 4915if(typeof newFormat!=='string'){throw new TypeError('dayViewHeaderFormat() expects a string parameter');} 4916this._options.dayViewHeaderFormat=newFormat;};DateTimePicker.prototype.extraFormats=function extraFormats(formats){if(arguments.length===0){return this._options.extraFormats;} 4917if(formats!==false&&!(formats instanceof Array)){throw new TypeError('extraFormats() expects an array or false parameter');} 4918this._options.extraFormats=formats;if(this.parseFormats){this._initFormatting();}};DateTimePicker.prototype.disabledDates=function disabledDates(dates){if(arguments.length===0){return this._options.disabledDates?$.extend({},this._options.disabledDates):this._options.disabledDates;} 4919if(!dates){this._options.disabledDates=false;this._update();return true;} 4920if(!(dates instanceof Array)){throw new TypeError('disabledDates() expects an array parameter');} 4921this._options.disabledDates=this._indexGivenDates(dates);this._options.enabledDates=false;this._update();};DateTimePicker.prototype.enabledDates=function enabledDates(dates){if(arguments.length===0){return this._options.enabledDates?$.extend({},this._options.enabledDates):this._options.enabledDates;} 4922if(!dates){this._options.enabledDates=false;this._update();return true;} 4923if(!(dates instanceof Array)){throw new TypeError('enabledDates() expects an array parameter');} 4924this._options.enabledDates=this._indexGivenDates(dates);this._options.disabledDates=false;this._update();};DateTimePicker.prototype.daysOfWeekDisabled=function daysOfWeekDisabled(_daysOfWeekDisabled){if(arguments.length===0){return this._options.daysOfWeekDisabled.splice(0);} 4925if(typeof _daysOfWeekDisabled==='boolean'&&!_daysOfWeekDisabled){this._options.daysOfWeekDisabled=false;this._update();return true;} 4926if(!(_daysOfWeekDisabled instanceof Array)){throw new TypeError('daysOfWeekDisabled() expects an array parameter');} 4927this._options.daysOfWeekDisabled=_daysOfWeekDisabled.reduce(function(previousValue,currentValue){currentValue=parseInt(currentValue,10);if(currentValue>6||currentValue<0||isNaN(currentValue)){return previousValue;} 4928if(previousValue.indexOf(currentValue)===-1){previousValue.push(currentValue);} 4929return previousValue;},[]).sort();if(this._options.useCurrent&&!this._options.keepInvalid){for(var i=0;i<this._dates.length;i++){var tries=0;while(!this._isValid(this._dates[i],'d')){this._dates[i].add(1,'d');if(tries===31){throw'Tried 31 times to find a valid date';} 4930tries++;} 4931this._setValue(this._dates[i],i);}} 4932this._update();};DateTimePicker.prototype.maxDate=function maxDate(_maxDate){if(arguments.length===0){return this._options.maxDate?this._options.maxDate.clone():this._options.maxDate;} 4933if(typeof _maxDate==='boolean'&&_maxDate===false){this._options.maxDate=false;this._update();return true;} 4934if(typeof _maxDate==='string'){if(_maxDate==='now'||_maxDate==='moment'){_maxDate=this.getMoment();}} 4935var parsedDate=this._parseInputDate(_maxDate);if(!parsedDate.isValid()){throw new TypeError('maxDate() Could not parse date parameter: '+_maxDate);} 4936if(this._options.minDate&&parsedDate.isBefore(this._options.minDate)){throw new TypeError('maxDate() date parameter is before this.options.minDate: '+parsedDate.format(this.actualFormat));} 4937this._options.maxDate=parsedDate;for(var i=0;i<this._dates.length;i++){if(this._options.useCurrent&&!this._options.keepInvalid&&this._dates[i].isAfter(_maxDate)){this._setValue(this._options.maxDate,i);}} 4938if(this._viewDate.isAfter(parsedDate)){this._viewDate=parsedDate.clone().subtract(this._options.stepping,'m');} 4939this._update();};DateTimePicker.prototype.minDate=function minDate(_minDate){if(arguments.length===0){return this._options.minDate?this._options.minDate.clone():this._options.minDate;} 4940if(typeof _minDate==='boolean'&&_minDate===false){this._options.minDate=false;this._update();return true;} 4941if(typeof _minDate==='string'){if(_minDate==='now'||_minDate==='moment'){_minDate=this.getMoment();}} 4942var parsedDate=this._parseInputDate(_minDate);if(!parsedDate.isValid()){throw new TypeError('minDate() Could not parse date parameter: '+_minDate);} 4943if(this._options.maxDate&&parsedDate.isAfter(this._options.maxDate)){throw new TypeError('minDate() date parameter is after this.options.maxDate: '+parsedDate.format(this.actualFormat));} 4944this._options.minDate=parsedDate;for(var i=0;i<this._dates.length;i++){if(this._options.useCurrent&&!this._options.keepInvalid&&this._dates[i].isBefore(_minDate)){this._setValue(this._options.minDate,i);}} 4945if(this._viewDate.isBefore(parsedDate)){this._viewDate=parsedDate.clone().add(this._options.stepping,'m');} 4946this._update();};DateTimePicker.prototype.defaultDate=function defaultDate(_defaultDate){if(arguments.length===0){return this._options.defaultDate?this._options.defaultDate.clone():this._options.defaultDate;} 4947if(!_defaultDate){this._options.defaultDate=false;return true;} 4948if(typeof _defaultDate==='string'){if(_defaultDate==='now'||_defaultDate==='moment'){_defaultDate=this.getMoment();}else{_defaultDate=this.getMoment(_defaultDate);}} 4949var parsedDate=this._parseInputDate(_defaultDate);if(!parsedDate.isValid()){throw new TypeError('defaultDate() Could not parse date parameter: '+_defaultDate);} 4950if(!this._isValid(parsedDate)){throw new TypeError('defaultDate() date passed is invalid according to component setup validations');} 4951this._options.defaultDate=parsedDate;if(this._options.defaultDate&&this._options.inline||this.input!==undefined&&this.input.val().trim()===''){this._setValue(this._options.defaultDate,0);}};DateTimePicker.prototype.locale=function locale(_locale){if(arguments.length===0){return this._options.locale;} 4952if(!moment.localeData(_locale)){throw new TypeError('locale() locale '+_locale+' is not loaded from moment locales!');} 4953this._options.locale=_locale;for(var i=0;i<this._dates.length;i++){this._dates[i].locale(this._options.locale);} 4954this._viewDate.locale(this._options.locale);if(this.actualFormat){this._initFormatting();} 4955if(this.widget){this.hide();this.show();}};DateTimePicker.prototype.stepping=function stepping(_stepping){if(arguments.length===0){return this._options.stepping;} 4956_stepping=parseInt(_stepping,10);if(isNaN(_stepping)||_stepping<1){_stepping=1;} 4957this._options.stepping=_stepping;};DateTimePicker.prototype.useCurrent=function useCurrent(_useCurrent){var useCurrentOptions=['year','month','day','hour','minute'];if(arguments.length===0){return this._options.useCurrent;} 4958if(typeof _useCurrent!=='boolean'&&typeof _useCurrent!=='string'){throw new TypeError('useCurrent() expects a boolean or string parameter');} 4959if(typeof _useCurrent==='string'&&useCurrentOptions.indexOf(_useCurrent.toLowerCase())===-1){throw new TypeError('useCurrent() expects a string parameter of '+useCurrentOptions.join(', '));} 4960this._options.useCurrent=_useCurrent;};DateTimePicker.prototype.collapse=function collapse(_collapse){if(arguments.length===0){return this._options.collapse;} 4961if(typeof _collapse!=='boolean'){throw new TypeError('collapse() expects a boolean parameter');} 4962if(this._options.collapse===_collapse){return true;} 4963this._options.collapse=_collapse;if(this.widget){this.hide();this.show();}};DateTimePicker.prototype.icons=function icons(_icons){if(arguments.length===0){return $.extend({},this._options.icons);} 4964if(!(_icons instanceof Object)){throw new TypeError('icons() expects parameter to be an Object');} 4965$.extend(this._options.icons,_icons);if(this.widget){this.hide();this.show();}};DateTimePicker.prototype.tooltips=function tooltips(_tooltips){if(arguments.length===0){return $.extend({},this._options.tooltips);} 4966if(!(_tooltips instanceof Object)){throw new TypeError('tooltips() expects parameter to be an Object');} 4967$.extend(this._options.tooltips,_tooltips);if(this.widget){this.hide();this.show();}};DateTimePicker.prototype.useStrict=function useStrict(_useStrict){if(arguments.length===0){return this._options.useStrict;} 4968if(typeof _useStrict!=='boolean'){throw new TypeError('useStrict() expects a boolean parameter');} 4969this._options.useStrict=_useStrict;};DateTimePicker.prototype.sideBySide=function sideBySide(_sideBySide){if(arguments.length===0){return this._options.sideBySide;} 4970if(typeof _sideBySide!=='boolean'){throw new TypeError('sideBySide() expects a boolean parameter');} 4971this._options.sideBySide=_sideBySide;if(this.widget){this.hide();this.show();}};DateTimePicker.prototype.viewMode=function viewMode(_viewMode){if(arguments.length===0){return this._options.viewMode;} 4972if(typeof _viewMode!=='string'){throw new TypeError('viewMode() expects a string parameter');} 4973if(DateTimePicker.ViewModes.indexOf(_viewMode)===-1){throw new TypeError('viewMode() parameter must be one of ('+DateTimePicker.ViewModes.join(', ')+') value');} 4974this._options.viewMode=_viewMode;this.currentViewMode=Math.max(DateTimePicker.ViewModes.indexOf(_viewMode)-1,this.MinViewModeNumber);this._showMode();};DateTimePicker.prototype.calendarWeeks=function calendarWeeks(_calendarWeeks){if(arguments.length===0){return this._options.calendarWeeks;} 4975if(typeof _calendarWeeks!=='boolean'){throw new TypeError('calendarWeeks() expects parameter to be a boolean value');} 4976this._options.calendarWeeks=_calendarWeeks;this._update();};DateTimePicker.prototype.buttons=function buttons(_buttons){if(arguments.length===0){return $.extend({},this._options.buttons);} 4977if(!(_buttons instanceof Object)){throw new TypeError('buttons() expects parameter to be an Object');} 4978$.extend(this._options.buttons,_buttons);if(typeof this._options.buttons.showToday!=='boolean'){throw new TypeError('buttons.showToday expects a boolean parameter');} 4979if(typeof this._options.buttons.showClear!=='boolean'){throw new TypeError('buttons.showClear expects a boolean parameter');} 4980if(typeof this._options.buttons.showClose!=='boolean'){throw new TypeError('buttons.showClose expects a boolean parameter');} 4981if(this.widget){this.hide();this.show();}};DateTimePicker.prototype.keepOpen=function keepOpen(_keepOpen){if(arguments.length===0){return this._options.keepOpen;} 4982if(typeof _keepOpen!=='boolean'){throw new TypeError('keepOpen() expects a boolean parameter');} 4983this._options.keepOpen=_keepOpen;};DateTimePicker.prototype.focusOnShow=function focusOnShow(_focusOnShow){if(arguments.length===0){return this._options.focusOnShow;} 4984if(typeof _focusOnShow!=='boolean'){throw new TypeError('focusOnShow() expects a boolean parameter');} 4985this._options.focusOnShow=_focusOnShow;};DateTimePicker.prototype.inline=function inline(_inline){if(arguments.length===0){return this._options.inline;} 4986if(typeof _inline!=='boolean'){throw new TypeError('inline() expects a boolean parameter');} 4987this._options.inline=_inline;};DateTimePicker.prototype.clear=function clear(){this._setValue(null);};DateTimePicker.prototype.keyBinds=function keyBinds(_keyBinds){if(arguments.length===0){return this._options.keyBinds;} 4988this._options.keyBinds=_keyBinds;};DateTimePicker.prototype.debug=function debug(_debug){if(typeof _debug!=='boolean'){throw new TypeError('debug() expects a boolean parameter');} 4989this._options.debug=_debug;};DateTimePicker.prototype.allowInputToggle=function allowInputToggle(_allowInputToggle){if(arguments.length===0){return this._options.allowInputToggle;} 4990if(typeof _allowInputToggle!=='boolean'){throw new TypeError('allowInputToggle() expects a boolean parameter');} 4991this._options.allowInputToggle=_allowInputToggle;};DateTimePicker.prototype.keepInvalid=function keepInvalid(_keepInvalid){if(arguments.length===0){return this._options.keepInvalid;} 4992if(typeof _keepInvalid!=='boolean'){throw new TypeError('keepInvalid() expects a boolean parameter');} 4993this._options.keepInvalid=_keepInvalid;};DateTimePicker.prototype.datepickerInput=function datepickerInput(_datepickerInput){if(arguments.length===0){return this._options.datepickerInput;} 4994if(typeof _datepickerInput!=='string'){throw new TypeError('datepickerInput() expects a string parameter');} 4995this._options.datepickerInput=_datepickerInput;};DateTimePicker.prototype.parseInputDate=function parseInputDate(_parseInputDate2){if(arguments.length===0){return this._options.parseInputDate;} 4996if(typeof _parseInputDate2!=='function'){throw new TypeError('parseInputDate() should be as function');} 4997this._options.parseInputDate=_parseInputDate2;};DateTimePicker.prototype.disabledTimeIntervals=function disabledTimeIntervals(_disabledTimeIntervals){if(arguments.length===0){return this._options.disabledTimeIntervals?$.extend({},this._options.disabledTimeIntervals):this._options.disabledTimeIntervals;} 4998if(!_disabledTimeIntervals){this._options.disabledTimeIntervals=false;this._update();return true;} 4999if(!(_disabledTimeIntervals instanceof Array)){throw new TypeError('disabledTimeIntervals() expects an array parameter');} 5000this._options.disabledTimeIntervals=_disabledTimeIntervals;this._update();};DateTimePicker.prototype.disabledHours=function disabledHours(hours){if(arguments.length===0){return this._options.disabledHours?$.extend({},this._options.disabledHours):this._options.disabledHours;} 5001if(!hours){this._options.disabledHours=false;this._update();return true;} 5002if(!(hours instanceof Array)){throw new TypeError('disabledHours() expects an array parameter');} 5003this._options.disabledHours=this._indexGivenHours(hours);this._options.enabledHours=false;if(this._options.useCurrent&&!this._options.keepInvalid){for(var i=0;i<this._dates.length;i++){var tries=0;while(!this._isValid(this._dates[i],'h')){this._dates[i].add(1,'h');if(tries===24){throw'Tried 24 times to find a valid date';} 5004tries++;} 5005this._setValue(this._dates[i],i);}} 5006this._update();};DateTimePicker.prototype.enabledHours=function enabledHours(hours){if(arguments.length===0){return this._options.enabledHours?$.extend({},this._options.enabledHours):this._options.enabledHours;} 5007if(!hours){this._options.enabledHours=false;this._update();return true;} 5008if(!(hours instanceof Array)){throw new TypeError('enabledHours() expects an array parameter');} 5009this._options.enabledHours=this._indexGivenHours(hours);this._options.disabledHours=false;if(this._options.useCurrent&&!this._options.keepInvalid){for(var i=0;i<this._dates.length;i++){var tries=0;while(!this._isValid(this._dates[i],'h')){this._dates[i].add(1,'h');if(tries===24){throw'Tried 24 times to find a valid date';} 5010tries++;} 5011this._setValue(this._dates[i],i);}} 5012this._update();};DateTimePicker.prototype.viewDate=function viewDate(newDate){if(arguments.length===0){return this._viewDate.clone();} 5013if(!newDate){this._viewDate=(this._dates[0]||this.getMoment()).clone();return true;} 5014if(typeof newDate!=='string'&&!moment.isMoment(newDate)&&!(newDate instanceof Date)){throw new TypeError('viewDate() parameter must be one of [string, moment or Date]');} 5015this._viewDate=this._parseInputDate(newDate);this._viewUpdate();};DateTimePicker.prototype.allowMultidate=function allowMultidate(_allowMultidate){if(typeof _allowMultidate!=='boolean'){throw new TypeError('allowMultidate() expects a boolean parameter');} 5016this._options.allowMultidate=_allowMultidate;};DateTimePicker.prototype.multidateSeparator=function multidateSeparator(_multidateSeparator){if(arguments.length===0){return this._options.multidateSeparator;} 5017if(typeof _multidateSeparator!=='string'||_multidateSeparator.length>1){throw new TypeError('multidateSeparator expects a single character string parameter');} 5018this._options.multidateSeparator=_multidateSeparator;};_createClass(DateTimePicker,null,[{key:'NAME',get:function get(){return NAME;}},{key:'DATA_KEY',get:function get(){return DATA_KEY;}},{key:'EVENT_KEY',get:function get(){return EVENT_KEY;}},{key:'DATA_API_KEY',get:function get(){return DATA_API_KEY;}},{key:'DatePickerModes',get:function get(){return DatePickerModes;}},{key:'ViewModes',get:function get(){return ViewModes;}},{key:'Event',get:function get(){return Event;}},{key:'Selector',get:function get(){return Selector;}},{key:'Default',get:function get(){return Default;},set:function set(value){Default=value;}},{key:'ClassName',get:function get(){return ClassName;}}]);return DateTimePicker;}();return DateTimePicker;}(jQuery,moment);var TempusDominusBootstrap4=function($){var JQUERY_NO_CONFLICT=$.fn[DateTimePicker.NAME],verticalModes=['top','bottom','auto'],horizontalModes=['left','right','auto'],toolbarPlacements=['default','top','bottom'],getSelectorFromElement=function getSelectorFromElement($element){var selector=$element.data('target'),$selector=void 0;if(!selector){selector=$element.attr('href')||'';selector=/^#[a-z]/i.test(selector)?selector:null;} 5019$selector=$(selector);if($selector.length===0){return $selector;} 5020if(!$selector.data(DateTimePicker.DATA_KEY)){$.extend({},$selector.data(),$(this).data());} 5021return $selector;};var TempusDominusBootstrap4=function(_DateTimePicker){_inherits(TempusDominusBootstrap4,_DateTimePicker);function TempusDominusBootstrap4(element,options){_classCallCheck(this,TempusDominusBootstrap4);var _this=_possibleConstructorReturn(this,_DateTimePicker.call(this,element,options));_this._init();return _this;} 5022TempusDominusBootstrap4.prototype._init=function _init(){if(this._element.hasClass('input-group')){var datepickerButton=this._element.find('.datepickerbutton');if(datepickerButton.length===0){this.component=this._element.find('[data-toggle="datetimepicker"]');}else{this.component=datepickerButton;}}};TempusDominusBootstrap4.prototype._getDatePickerTemplate=function _getDatePickerTemplate(){var headTemplate=$('<thead>').append($('<tr>').append($('<th>').addClass('prev').attr('data-action','previous').append($('<span>').addClass(this._options.icons.previous))).append($('<th>').addClass('picker-switch').attr('data-action','pickerSwitch').attr('colspan',''+(this._options.calendarWeeks?'6':'5'))).append($('<th>').addClass('next').attr('data-action','next').append($('<span>').addClass(this._options.icons.next)))),contTemplate=$('<tbody>').append($('<tr>').append($('<td>').attr('colspan',''+(this._options.calendarWeeks?'8':'7'))));return[$('<div>').addClass('datepicker-days').append($('<table>').addClass('table table-sm').append(headTemplate).append($('<tbody>'))),$('<div>').addClass('datepicker-months').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())),$('<div>').addClass('datepicker-years').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())),$('<div>').addClass('datepicker-decades').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone()))];};TempusDominusBootstrap4.prototype._getTimePickerMainTemplate=function _getTimePickerMainTemplate(){var topRow=$('<tr>'),middleRow=$('<tr>'),bottomRow=$('<tr>');if(this._isEnabled('h')){topRow.append($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','title':this._options.tooltips.incrementHour}).addClass('btn').attr('data-action','incrementHours').append($('<span>').addClass(this._options.icons.up))));middleRow.append($('<td>').append($('<span>').addClass('timepicker-hour').attr({'data-time-component':'hours','title':this._options.tooltips.pickHour}).attr('data-action','showHours')));bottomRow.append($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','title':this._options.tooltips.decrementHour}).addClass('btn').attr('data-action','decrementHours').append($('<span>').addClass(this._options.icons.down))));} 5023if(this._isEnabled('m')){if(this._isEnabled('h')){topRow.append($('<td>').addClass('separator'));middleRow.append($('<td>').addClass('separator').html(':'));bottomRow.append($('<td>').addClass('separator'));} 5024topRow.append($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','title':this._options.tooltips.incrementMinute}).addClass('btn').attr('data-action','incrementMinutes').append($('<span>').addClass(this._options.icons.up))));middleRow.append($('<td>').append($('<span>').addClass('timepicker-minute').attr({'data-time-component':'minutes','title':this._options.tooltips.pickMinute}).attr('data-action','showMinutes')));bottomRow.append($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','title':this._options.tooltips.decrementMinute}).addClass('btn').attr('data-action','decrementMinutes').append($('<span>').addClass(this._options.icons.down))));} 5025if(this._isEnabled('s')){if(this._isEnabled('m')){topRow.append($('<td>').addClass('separator'));middleRow.append($('<td>').addClass('separator').html(':'));bottomRow.append($('<td>').addClass('separator'));} 5026topRow.append($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','title':this._options.tooltips.incrementSecond}).addClass('btn').attr('data-action','incrementSeconds').append($('<span>').addClass(this._options.icons.up))));middleRow.append($('<td>').append($('<span>').addClass('timepicker-second').attr({'data-time-component':'seconds','title':this._options.tooltips.pickSecond}).attr('data-action','showSeconds')));bottomRow.append($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','title':this._options.tooltips.decrementSecond}).addClass('btn').attr('data-action','decrementSeconds').append($('<span>').addClass(this._options.icons.down))));} 5027if(!this.use24Hours){topRow.append($('<td>').addClass('separator'));middleRow.append($('<td>').append($('<button>').addClass('btn btn-primary').attr({'data-action':'togglePeriod',tabindex:'-1','title':this._options.tooltips.togglePeriod})));bottomRow.append($('<td>').addClass('separator'));} 5028return $('<div>').addClass('timepicker-picker').append($('<table>').addClass('table-condensed').append([topRow,middleRow,bottomRow]));};TempusDominusBootstrap4.prototype._getTimePickerTemplate=function _getTimePickerTemplate(){var hoursView=$('<div>').addClass('timepicker-hours').append($('<table>').addClass('table-condensed')),minutesView=$('<div>').addClass('timepicker-minutes').append($('<table>').addClass('table-condensed')),secondsView=$('<div>').addClass('timepicker-seconds').append($('<table>').addClass('table-condensed')),ret=[this._getTimePickerMainTemplate()];if(this._isEnabled('h')){ret.push(hoursView);} 5029if(this._isEnabled('m')){ret.push(minutesView);} 5030if(this._isEnabled('s')){ret.push(secondsView);} 5031return ret;};TempusDominusBootstrap4.prototype._getToolbar=function _getToolbar(){var row=[];if(this._options.buttons.showToday){row.push($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','data-action':'today','title':this._options.tooltips.today}).append($('<span>').addClass(this._options.icons.today))));} 5032if(!this._options.sideBySide&&this._hasDate()&&this._hasTime()){var title=void 0,icon=void 0;if(this._options.viewMode==='times'){title=this._options.tooltips.selectDate;icon=this._options.icons.date;}else{title=this._options.tooltips.selectTime;icon=this._options.icons.time;} 5033row.push($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','data-action':'togglePicker','title':title}).append($('<span>').addClass(icon))));} 5034if(this._options.buttons.showClear){row.push($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','data-action':'clear','title':this._options.tooltips.clear}).append($('<span>').addClass(this._options.icons.clear))));} 5035if(this._options.buttons.showClose){row.push($('<td>').append($('<a>').attr({href:'#',tabindex:'-1','data-action':'close','title':this._options.tooltips.close}).append($('<span>').addClass(this._options.icons.close))));} 5036return row.length===0?'':$('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row)));};TempusDominusBootstrap4.prototype._getTemplate=function _getTemplate(){var template=$('<div>').addClass('bootstrap-datetimepicker-widget dropdown-menu'),dateView=$('<div>').addClass('datepicker').append(this._getDatePickerTemplate()),timeView=$('<div>').addClass('timepicker').append(this._getTimePickerTemplate()),content=$('<ul>').addClass('list-unstyled'),toolbar=$('<li>').addClass('picker-switch'+(this._options.collapse?' accordion-toggle':'')).append(this._getToolbar());if(this._options.inline){template.removeClass('dropdown-menu');} 5037if(this.use24Hours){template.addClass('usetwentyfour');} 5038if(this._isEnabled('s')&&!this.use24Hours){template.addClass('wider');} 5039if(this._options.sideBySide&&this._hasDate()&&this._hasTime()){template.addClass('timepicker-sbs');if(this._options.toolbarPlacement==='top'){template.append(toolbar);} 5040template.append($('<div>').addClass('row').append(dateView.addClass('col-md-6')).append(timeView.addClass('col-md-6')));if(this._options.toolbarPlacement==='bottom'||this._options.toolbarPlacement==='default'){template.append(toolbar);} 5041return template;} 5042if(this._options.toolbarPlacement==='top'){content.append(toolbar);} 5043if(this._hasDate()){content.append($('<li>').addClass(this._options.collapse&&this._hasTime()?'collapse':'').addClass(this._options.collapse&&this._hasTime()&&this._options.viewMode==='times'?'':'show').append(dateView));} 5044if(this._options.toolbarPlacement==='default'){content.append(toolbar);} 5045if(this._hasTime()){content.append($('<li>').addClass(this._options.collapse&&this._hasDate()?'collapse':'').addClass(this._options.collapse&&this._hasDate()&&this._options.viewMode==='times'?'show':'').append(timeView));} 5046if(this._options.toolbarPlacement==='bottom'){content.append(toolbar);} 5047return template.append(content);};TempusDominusBootstrap4.prototype._place=function _place(e){var self=e&&e.data&&e.data.picker||this,vertical=self._options.widgetPositioning.vertical,horizontal=self._options.widgetPositioning.horizontal,parent=void 0;var position=(self.component&&self.component.length?self.component:self._element).position(),offset=(self.component&&self.component.length?self.component:self._element).offset();if(self._options.widgetParent){parent=self._options.widgetParent.append(self.widget);}else if(self._element.is('input')){parent=self._element.after(self.widget).parent();}else if(self._options.inline){parent=self._element.append(self.widget);return;}else{parent=self._element;self._element.children().first().after(self.widget);} 5048var parentOffset=parent.offset();position.top=offset.top-parentOffset.top;position.left=offset.left-parentOffset.left;if(vertical==='auto'){if(offset.top+self.widget.height()*1.5>=$(window).height()+$(window).scrollTop()&&self.widget.height()+self._element.outerHeight()<offset.top){vertical='top';}else{vertical='bottom';}} 5049if(horizontal==='auto'){if(parent.width()<offset.left+self.widget.outerWidth()/2&&offset.left+self.widget.outerWidth()>$(window).width()){horizontal='right';}else{horizontal='left';}} 5050if(vertical==='top'){self.widget.addClass('top').removeClass('bottom');}else{self.widget.addClass('bottom').removeClass('top');} 5051if(horizontal==='right'){self.widget.addClass('float-right');}else{self.widget.removeClass('float-right');} 5052if(parent.css('position')!=='relative'){parent=parent.parents().filter(function(){return $(this).css('position')==='relative';}).first();} 5053if(parent.length===0){throw new Error('datetimepicker component should be placed within a relative positioned container');} 5054self.widget.css({top:vertical==='top'?'auto':position.top+self._element.outerHeight()+'px',bottom:vertical==='top'?parent.outerHeight()-(parent===self._element?0:position.top)+'px':'auto',left:horizontal==='left'?(parent===self._element?0:position.left)+'px':'auto',right:horizontal==='left'?'auto':parent.outerWidth()-self._element.outerWidth()-(parent===self._element?0:position.left)+'px'});};TempusDominusBootstrap4.prototype._fillDow=function _fillDow(){var row=$('<tr>'),currentDate=this._viewDate.clone().startOf('w').startOf('d');if(this._options.calendarWeeks===true){row.append($('<th>').addClass('cw').text('#'));} 5055while(currentDate.isBefore(this._viewDate.clone().endOf('w'))){row.append($('<th>').addClass('dow').text(currentDate.format('dd')));currentDate.add(1,'d');} 5056this.widget.find('.datepicker-days thead').append(row);};TempusDominusBootstrap4.prototype._fillMonths=function _fillMonths(){var spans=[],monthsShort=this._viewDate.clone().startOf('y').startOf('d');while(monthsShort.isSame(this._viewDate,'y')){spans.push($('<span>').attr('data-action','selectMonth').addClass('month').text(monthsShort.format('MMM')));monthsShort.add(1,'M');} 5057this.widget.find('.datepicker-months td').empty().append(spans);};TempusDominusBootstrap4.prototype._updateMonths=function _updateMonths(){var monthsView=this.widget.find('.datepicker-months'),monthsViewHeader=monthsView.find('th'),months=monthsView.find('tbody').find('span'),self=this;monthsViewHeader.eq(0).find('span').attr('title',this._options.tooltips.prevYear);monthsViewHeader.eq(1).attr('title',this._options.tooltips.selectYear);monthsViewHeader.eq(2).find('span').attr('title',this._options.tooltips.nextYear);monthsView.find('.disabled').removeClass('disabled');if(!this._isValid(this._viewDate.clone().subtract(1,'y'),'y')){monthsViewHeader.eq(0).addClass('disabled');} 5058monthsViewHeader.eq(1).text(this._viewDate.year());if(!this._isValid(this._viewDate.clone().add(1,'y'),'y')){monthsViewHeader.eq(2).addClass('disabled');} 5059months.removeClass('active');if(this._getLastPickedDate().isSame(this._viewDate,'y')&&!this.unset){months.eq(this._getLastPickedDate().month()).addClass('active');} 5060months.each(function(index){if(!self._isValid(self._viewDate.clone().month(index),'M')){$(this).addClass('disabled');}});};TempusDominusBootstrap4.prototype._getStartEndYear=function _getStartEndYear(factor,year){var step=factor/10,startYear=Math.floor(year/factor)*factor,endYear=startYear+step*9,focusValue=Math.floor(year/step)*step;return[startYear,endYear,focusValue];};TempusDominusBootstrap4.prototype._updateYears=function _updateYears(){var yearsView=this.widget.find('.datepicker-years'),yearsViewHeader=yearsView.find('th'),yearCaps=this._getStartEndYear(10,this._viewDate.year()),startYear=this._viewDate.clone().year(yearCaps[0]),endYear=this._viewDate.clone().year(yearCaps[1]);var html='';yearsViewHeader.eq(0).find('span').attr('title',this._options.tooltips.prevDecade);yearsViewHeader.eq(1).attr('title',this._options.tooltips.selectDecade);yearsViewHeader.eq(2).find('span').attr('title',this._options.tooltips.nextDecade);yearsView.find('.disabled').removeClass('disabled');if(this._options.minDate&&this._options.minDate.isAfter(startYear,'y')){yearsViewHeader.eq(0).addClass('disabled');} 5061yearsViewHeader.eq(1).text(startYear.year()+'-'+endYear.year());if(this._options.maxDate&&this._options.maxDate.isBefore(endYear,'y')){yearsViewHeader.eq(2).addClass('disabled');} 5062html+='<span data-action="selectYear" class="year old'+(!this._isValid(startYear,'y')?' disabled':'')+'">'+(startYear.year()-1)+'</span>';while(!startYear.isAfter(endYear,'y')){html+='<span data-action="selectYear" class="year'+(startYear.isSame(this._getLastPickedDate(),'y')&&!this.unset?' active':'')+(!this._isValid(startYear,'y')?' disabled':'')+'">'+startYear.year()+'</span>';startYear.add(1,'y');} 5063html+='<span data-action="selectYear" class="year old'+(!this._isValid(startYear,'y')?' disabled':'')+'">'+startYear.year()+'</span>';yearsView.find('td').html(html);};TempusDominusBootstrap4.prototype._updateDecades=function _updateDecades(){var decadesView=this.widget.find('.datepicker-decades'),decadesViewHeader=decadesView.find('th'),yearCaps=this._getStartEndYear(100,this._viewDate.year()),startDecade=this._viewDate.clone().year(yearCaps[0]),endDecade=this._viewDate.clone().year(yearCaps[1]);var minDateDecade=false,maxDateDecade=false,endDecadeYear=void 0,html='';decadesViewHeader.eq(0).find('span').attr('title',this._options.tooltips.prevCentury);decadesViewHeader.eq(2).find('span').attr('title',this._options.tooltips.nextCentury);decadesView.find('.disabled').removeClass('disabled');if(startDecade.year()===0||this._options.minDate&&this._options.minDate.isAfter(startDecade,'y')){decadesViewHeader.eq(0).addClass('disabled');} 5064decadesViewHeader.eq(1).text(startDecade.year()+'-'+endDecade.year());if(this._options.maxDate&&this._options.maxDate.isBefore(endDecade,'y')){decadesViewHeader.eq(2).addClass('disabled');} 5065if(startDecade.year()-10<0){html+='<span> </span>';}else{html+='<span data-action="selectDecade" class="decade old" data-selection="'+(startDecade.year()+6)+'">'+(startDecade.year()-10)+'</span>';} 5066while(!startDecade.isAfter(endDecade,'y')){endDecadeYear=startDecade.year()+11;minDateDecade=this._options.minDate&&this._options.minDate.isAfter(startDecade,'y')&&this._options.minDate.year()<=endDecadeYear;maxDateDecade=this._options.maxDate&&this._options.maxDate.isAfter(startDecade,'y')&&this._options.maxDate.year()<=endDecadeYear;html+='<span data-action="selectDecade" class="decade'+(this._getLastPickedDate().isAfter(startDecade)&&this._getLastPickedDate().year()<=endDecadeYear?' active':'')+(!this._isValid(startDecade,'y')&&!minDateDecade&&!maxDateDecade?' disabled':'')+'" data-selection="'+(startDecade.year()+6)+'">'+startDecade.year()+'</span>';startDecade.add(10,'y');} 5067html+='<span data-action="selectDecade" class="decade old" data-selection="'+(startDecade.year()+6)+'">'+startDecade.year()+'</span>';decadesView.find('td').html(html);};TempusDominusBootstrap4.prototype._fillDate=function _fillDate(){var daysView=this.widget.find('.datepicker-days'),daysViewHeader=daysView.find('th'),html=[];var currentDate=void 0,row=void 0,clsName=void 0,i=void 0;if(!this._hasDate()){return;} 5068daysViewHeader.eq(0).find('span').attr('title',this._options.tooltips.prevMonth);daysViewHeader.eq(1).attr('title',this._options.tooltips.selectMonth);daysViewHeader.eq(2).find('span').attr('title',this._options.tooltips.nextMonth);daysView.find('.disabled').removeClass('disabled');daysViewHeader.eq(1).text(this._viewDate.format(this._options.dayViewHeaderFormat));if(!this._isValid(this._viewDate.clone().subtract(1,'M'),'M')){daysViewHeader.eq(0).addClass('disabled');} 5069if(!this._isValid(this._viewDate.clone().add(1,'M'),'M')){daysViewHeader.eq(2).addClass('disabled');} 5070var now=this.getMoment();currentDate=this._viewDate.clone().startOf('M').startOf('w').add(12,'hours');for(i=0;i<42;i++){if(currentDate.weekday()===0){row=$('<tr>');if(this._options.calendarWeeks){row.append('<td class="cw">'+currentDate.week()+'</td>');} 5071html.push(row);} 5072clsName='';if(currentDate.isBefore(this._viewDate,'M')){clsName+=' old';} 5073if(currentDate.isAfter(this._viewDate,'M')){clsName+=' new';} 5074if(this._options.allowMultidate){var index=this._datesFormatted.indexOf(currentDate.format('YYYY-MM-DD'));if(index!==-1){if(currentDate.isSame(this._datesFormatted[index],'d')&&!this.unset){clsName+=' active';}}}else{if(currentDate.isSame(this._getLastPickedDate(),'d')&&!this.unset){clsName+=' active';}} 5075if(!this._isValid(currentDate,'d')){clsName+=' disabled';} 5076if(currentDate.date()===now.date()&¤tDate.month()===now.month()&¤tDate.year()===now.year()){clsName+=' today';} 5077if(currentDate.day()===0||currentDate.day()===6){clsName+=' weekend';} 5078row.append('<td data-action="selectDay" data-day="'+currentDate.format('L')+'" class="day'+clsName+'">'+currentDate.date()+'</td>');currentDate.add(1,'d');} 5079daysView.find('tbody').empty().append(html);this._updateMonths();this._updateYears();this._updateDecades();};TempusDominusBootstrap4.prototype._fillHours=function _fillHours(){var table=this.widget.find('.timepicker-hours table'),currentHour=this._viewDate.clone().startOf('d'),html=[];var row=$('<tr>');if(this._viewDate.hour()>11&&!this.use24Hours){currentHour.hour(12);} 5080while(currentHour.isSame(this._viewDate,'d')&&(this.use24Hours||this._viewDate.hour()<12&¤tHour.hour()<12||this._viewDate.hour()>11)){if(currentHour.hour()%4===0){row=$('<tr>');html.push(row);} 5081row.append('<td data-action="selectHour" class="hour'+(!this._isValid(currentHour,'h')?' disabled':'')+'">'+currentHour.format(this.use24Hours?'HH':'hh')+'</td>');currentHour.add(1,'h');} 5082table.empty().append(html);};TempusDominusBootstrap4.prototype._fillMinutes=function _fillMinutes(){var table=this.widget.find('.timepicker-minutes table'),currentMinute=this._viewDate.clone().startOf('h'),html=[],step=this._options.stepping===1?5:this._options.stepping;var row=$('<tr>');while(this._viewDate.isSame(currentMinute,'h')){if(currentMinute.minute()%(step*4)===0){row=$('<tr>');html.push(row);} 5083row.append('<td data-action="selectMinute" class="minute'+(!this._isValid(currentMinute,'m')?' disabled':'')+'">'+currentMinute.format('mm')+'</td>');currentMinute.add(step,'m');} 5084table.empty().append(html);};TempusDominusBootstrap4.prototype._fillSeconds=function _fillSeconds(){var table=this.widget.find('.timepicker-seconds table'),currentSecond=this._viewDate.clone().startOf('m'),html=[];var row=$('<tr>');while(this._viewDate.isSame(currentSecond,'m')){if(currentSecond.second()%20===0){row=$('<tr>');html.push(row);} 5085row.append('<td data-action="selectSecond" class="second'+(!this._isValid(currentSecond,'s')?' disabled':'')+'">'+currentSecond.format('ss')+'</td>');currentSecond.add(5,'s');} 5086table.empty().append(html);};TempusDominusBootstrap4.prototype._fillTime=function _fillTime(){var toggle=void 0,newDate=void 0;var timeComponents=this.widget.find('.timepicker span[data-time-component]');if(!this.use24Hours){toggle=this.widget.find('.timepicker [data-action=togglePeriod]');newDate=this._getLastPickedDate().clone().add(this._getLastPickedDate().hours()>=12?-12:12,'h');toggle.text(this._getLastPickedDate().format('A'));if(this._isValid(newDate,'h')){toggle.removeClass('disabled');}else{toggle.addClass('disabled');}} 5087timeComponents.filter('[data-time-component=hours]').text(this._getLastPickedDate().format(''+(this.use24Hours?'HH':'hh')));timeComponents.filter('[data-time-component=minutes]').text(this._getLastPickedDate().format('mm'));timeComponents.filter('[data-time-component=seconds]').text(this._getLastPickedDate().format('ss'));this._fillHours();this._fillMinutes();this._fillSeconds();};TempusDominusBootstrap4.prototype._doAction=function _doAction(e,action){var lastPicked=this._getLastPickedDate();if($(e.currentTarget).is('.disabled')){return false;} 5088action=action||$(e.currentTarget).data('action');switch(action){case'next':{var navFnc=DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.add(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP,navFnc);this._fillDate();this._viewUpdate(navFnc);break;} 5089case'previous':{var _navFnc=DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.subtract(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP,_navFnc);this._fillDate();this._viewUpdate(_navFnc);break;} 5090case'pickerSwitch':this._showMode(1);break;case'selectMonth':{var month=$(e.target).closest('tbody').find('span').index($(e.target));this._viewDate.month(month);if(this.currentViewMode===this.MinViewModeNumber){this._setValue(lastPicked.clone().year(this._viewDate.year()).month(this._viewDate.month()),this._getLastPickedDateIndex());if(!this._options.inline){this.hide();}}else{this._showMode(-1);this._fillDate();} 5091this._viewUpdate('M');break;} 5092case'selectYear':{var year=parseInt($(e.target).text(),10)||0;this._viewDate.year(year);if(this.currentViewMode===this.MinViewModeNumber){this._setValue(lastPicked.clone().year(this._viewDate.year()),this._getLastPickedDateIndex());if(!this._options.inline){this.hide();}}else{this._showMode(-1);this._fillDate();} 5093this._viewUpdate('YYYY');break;} 5094case'selectDecade':{var _year=parseInt($(e.target).data('selection'),10)||0;this._viewDate.year(_year);if(this.currentViewMode===this.MinViewModeNumber){this._setValue(lastPicked.clone().year(this._viewDate.year()),this._getLastPickedDateIndex());if(!this._options.inline){this.hide();}}else{this._showMode(-1);this._fillDate();} 5095this._viewUpdate('YYYY');break;} 5096case'selectDay':{var day=this._viewDate.clone();if($(e.target).is('.old')){day.subtract(1,'M');} 5097if($(e.target).is('.new')){day.add(1,'M');} 5098this._setValue(day.date(parseInt($(e.target).text(),10)),this._getLastPickedDateIndex());if(!this._hasTime()&&!this._options.keepOpen&&!this._options.inline){this.hide();} 5099break;} 5100case'incrementHours':{var newDate=lastPicked.clone().add(1,'h');if(this._isValid(newDate,'h')){this._setValue(newDate,this._getLastPickedDateIndex());} 5101break;} 5102case'incrementMinutes':{var _newDate=lastPicked.clone().add(this._options.stepping,'m');if(this._isValid(_newDate,'m')){this._setValue(_newDate,this._getLastPickedDateIndex());} 5103break;} 5104case'incrementSeconds':{var _newDate2=lastPicked.clone().add(1,'s');if(this._isValid(_newDate2,'s')){this._setValue(_newDate2,this._getLastPickedDateIndex());} 5105break;} 5106case'decrementHours':{var _newDate3=lastPicked.clone().subtract(1,'h');if(this._isValid(_newDate3,'h')){this._setValue(_newDate3,this._getLastPickedDateIndex());} 5107break;} 5108case'decrementMinutes':{var _newDate4=lastPicked.clone().subtract(this._options.stepping,'m');if(this._isValid(_newDate4,'m')){this._setValue(_newDate4,this._getLastPickedDateIndex());} 5109break;} 5110case'decrementSeconds':{var _newDate5=lastPicked.clone().subtract(1,'s');if(this._isValid(_newDate5,'s')){this._setValue(_newDate5,this._getLastPickedDateIndex());} 5111break;} 5112case'togglePeriod':{this._setValue(lastPicked.clone().add(lastPicked.hours()>=12?-12:12,'h'),this._getLastPickedDateIndex());break;} 5113case'togglePicker':{var $this=$(e.target),$link=$this.closest('a'),$parent=$this.closest('ul'),expanded=$parent.find('.show'),closed=$parent.find('.collapse:not(.show)'),$span=$this.is('span')?$this:$this.find('span');var collapseData=void 0;if(expanded&&expanded.length){collapseData=expanded.data('collapse');if(collapseData&&collapseData.transitioning){return true;} 5114if(expanded.collapse){expanded.collapse('hide');closed.collapse('show');}else{expanded.removeClass('show');closed.addClass('show');} 5115$span.toggleClass(this._options.icons.time+' '+this._options.icons.date);if($span.hasClass(this._options.icons.date)){$link.attr('title',this._options.tooltips.selectDate);}else{$link.attr('title',this._options.tooltips.selectTime);}}} 5116break;case'showPicker':this.widget.find('.timepicker > div:not(.timepicker-picker)').hide();this.widget.find('.timepicker .timepicker-picker').show();break;case'showHours':this.widget.find('.timepicker .timepicker-picker').hide();this.widget.find('.timepicker .timepicker-hours').show();break;case'showMinutes':this.widget.find('.timepicker .timepicker-picker').hide();this.widget.find('.timepicker .timepicker-minutes').show();break;case'showSeconds':this.widget.find('.timepicker .timepicker-picker').hide();this.widget.find('.timepicker .timepicker-seconds').show();break;case'selectHour':{var hour=this.getMoment($(e.target).text(),this.use24Hours?'HH':'hh').hour();if(!this.use24Hours){if(lastPicked.hours()>=12){if(hour!==12){hour+=12;}}else{if(hour===12){hour=0;}}} 5117this._setValue(lastPicked.clone().hours(hour),this._getLastPickedDateIndex());if(!this._isEnabled('a')&&!this._isEnabled('m')&&!this._options.keepOpen&&!this._options.inline){this.hide();}else{this._doAction(e,'showPicker');} 5118break;} 5119case'selectMinute':this._setValue(lastPicked.clone().minutes(this.getMoment($(e.target).text(),'mm').minute()),this._getLastPickedDateIndex());if(!this._isEnabled('a')&&!this._isEnabled('s')&&!this._options.keepOpen&&!this._options.inline){this.hide();}else{this._doAction(e,'showPicker');} 5120break;case'selectSecond':this._setValue(lastPicked.clone().seconds(this.getMoment($(e.target).text(),'ss').second()),this._getLastPickedDateIndex());if(!this._isEnabled('a')&&!this._options.keepOpen&&!this._options.inline){this.hide();}else{this._doAction(e,'showPicker');} 5121break;case'clear':this.clear();break;case'close':this.hide();break;case'today':{var todaysDate=this.getMoment();if(this._isValid(todaysDate,'d')){this._setValue(todaysDate,this._getLastPickedDateIndex());} 5122break;}} 5123return false;};TempusDominusBootstrap4.prototype.hide=function hide(){var transitioning=false;if(!this.widget){return;} 5124this.widget.find('.collapse').each(function(){var collapseData=$(this).data('collapse');if(collapseData&&collapseData.transitioning){transitioning=true;return false;} 5125return true;});if(transitioning){return;} 5126if(this.component&&this.component.hasClass('btn')){this.component.toggleClass('active');} 5127this.widget.hide();$(window).off('resize',this._place());this.widget.off('click','[data-action]');this.widget.off('mousedown',false);this.widget.remove();this.widget=false;this._notifyEvent({type:DateTimePicker.Event.HIDE,date:this._getLastPickedDate().clone()});if(this.input!==undefined){this.input.blur();} 5128this._viewDate=this._getLastPickedDate().clone();};TempusDominusBootstrap4.prototype.show=function show(){var currentMoment=void 0;var useCurrentGranularity={'year':function year(m){return m.month(0).date(1).hours(0).seconds(0).minutes(0);},'month':function month(m){return m.date(1).hours(0).seconds(0).minutes(0);},'day':function day(m){return m.hours(0).seconds(0).minutes(0);},'hour':function hour(m){return m.seconds(0).minutes(0);},'minute':function minute(m){return m.seconds(0);}};if(this.input!==undefined){if(this.input.prop('disabled')||!this._options.ignoreReadonly&&this.input.prop('readonly')||this.widget){return;} 5129if(this.input.val()!==undefined&&this.input.val().trim().length!==0){this._setValue(this._parseInputDate(this.input.val().trim()),0);}else if(this.unset&&this._options.useCurrent){currentMoment=this.getMoment();if(typeof this._options.useCurrent==='string'){currentMoment=useCurrentGranularity[this._options.useCurrent](currentMoment);} 5130this._setValue(currentMoment,0);}}else if(this.unset&&this._options.useCurrent){currentMoment=this.getMoment();if(typeof this._options.useCurrent==='string'){currentMoment=useCurrentGranularity[this._options.useCurrent](currentMoment);} 5131this._setValue(currentMoment,0);} 5132this.widget=this._getTemplate();this._fillDow();this._fillMonths();this.widget.find('.timepicker-hours').hide();this.widget.find('.timepicker-minutes').hide();this.widget.find('.timepicker-seconds').hide();this._update();this._showMode();$(window).on('resize',{picker:this},this._place);this.widget.on('click','[data-action]',$.proxy(this._doAction,this));this.widget.on('mousedown',false);
5132if(this.component&&this.component.hasClass('btn')){this.component.toggleClass('active');} 5133this._place();this.widget.show();if(this.input!==undefined&&this._options.focusOnShow&&!this.input.is(':focus')){this.input.focus();} 5134this._notifyEvent({type:DateTimePicker.Event.SHOW});};TempusDominusBootstrap4.prototype.destroy=function destroy(){this.hide();this._element.removeData(DateTimePicker.DATA_KEY);this._element.removeData('date');};TempusDominusBootstrap4.prototype.disable=function disable(){this.hide();if(this.component&&this.component.hasClass('btn')){this.component.addClass('disabled');} 5135if(this.input!==undefined){this.input.prop('disabled',true);}};TempusDominusBootstrap4.prototype.enable=function enable(){if(this.component&&this.component.hasClass('btn')){this.component.removeClass('disabled');} 5136if(this.input!==undefined){this.input.prop('disabled',false);}};TempusDominusBootstrap4.prototype.toolbarPlacement=function toolbarPlacement(_toolbarPlacement){if(arguments.length===0){return this._options.toolbarPlacement;} 5137if(typeof _toolbarPlacement!=='string'){throw new TypeError('toolbarPlacement() expects a string parameter');} 5138if(toolbarPlacements.indexOf(_toolbarPlacement)===-1){throw new TypeError('toolbarPlacement() parameter must be one of ('+toolbarPlacements.join(', ')+') value');} 5139this._options.toolbarPlacement=_toolbarPlacement;if(this.widget){this.hide();this.show();}};TempusDominusBootstrap4.prototype.widgetPositioning=function widgetPositioning(_widgetPositioning){if(arguments.length===0){return $.extend({},this._options.widgetPositioning);} 5140if({}.toString.call(_widgetPositioning)!=='[object Object]'){throw new TypeError('widgetPositioning() expects an object variable');} 5141if(_widgetPositioning.horizontal){if(typeof _widgetPositioning.horizontal!=='string'){throw new TypeError('widgetPositioning() horizontal variable must be a string');} 5142_widgetPositioning.horizontal=_widgetPositioning.horizontal.toLowerCase();if(horizontalModes.indexOf(_widgetPositioning.horizontal)===-1){throw new TypeError('widgetPositioning() expects horizontal parameter to be one of ('+horizontalModes.join(', ')+')');} 5143this._options.widgetPositioning.horizontal=_widgetPositioning.horizontal;} 5144if(_widgetPositioning.vertical){if(typeof _widgetPositioning.vertical!=='string'){throw new TypeError('widgetPositioning() vertical variable must be a string');} 5145_widgetPositioning.vertical=_widgetPositioning.vertical.toLowerCase();if(verticalModes.indexOf(_widgetPositioning.vertical)===-1){throw new TypeError('widgetPositioning() expects vertical parameter to be one of ('+verticalModes.join(', ')+')');} 5146this._options.widgetPositioning.vertical=_widgetPositioning.vertical;} 5147this._update();};TempusDominusBootstrap4.prototype.widgetParent=function widgetParent(_widgetParent){if(arguments.length===0){return this._options.widgetParent;} 5148if(typeof _widgetParent==='string'){_widgetParent=$(_widgetParent);} 5149if(_widgetParent!==null&&typeof _widgetParent!=='string'&&!(_widgetParent instanceof $)){throw new TypeError('widgetParent() expects a string or a jQuery object parameter');} 5150this._options.widgetParent=_widgetParent;if(this.widget){this.hide();this.show();}};TempusDominusBootstrap4._jQueryHandleThis=function _jQueryHandleThis(me,option,argument){var data=$(me).data(DateTimePicker.DATA_KEY);if((typeof option==='undefined'?'undefined':_typeof(option))==='object'){$.extend({},DateTimePicker.Default,option);} 5151if(!data){data=new TempusDominusBootstrap4($(me),option);$(me).data(DateTimePicker.DATA_KEY,data);} 5152if(typeof option==='string'){if(data[option]===undefined){throw new Error('No method named "'+option+'"');} 5153if(argument===undefined){return data[option]();}else{return data[option](argument);}}};TempusDominusBootstrap4._jQueryInterface=function _jQueryInterface(option,argument){if(this.length===1){return TempusDominusBootstrap4._jQueryHandleThis(this[0],option,argument);} 5154return this.each(function(){TempusDominusBootstrap4._jQueryHandleThis(this,option,argument);});};return TempusDominusBootstrap4;}(DateTimePicker);$(document).on(DateTimePicker.Event.CLICK_DATA_API,DateTimePicker.Selector.DATA_TOGGLE,function(){var $target=getSelectorFromElement($(this));if($target.length===0){return;} 5155TempusDominusBootstrap4._jQueryInterface.call($target,'toggle');}).on(DateTimePicker.Event.CHANGE,'.'+DateTimePicker.ClassName.INPUT,function(event){var $target=getSelectorFromElement($(this));if($target.length===0){return;} 5156TempusDominusBootstrap4._jQueryInterface.call($target,'_change',event);}).on(DateTimePicker.Event.BLUR,'.'+DateTimePicker.ClassName.INPUT,function(event){var $target=getSelectorFromElement($(this)),config=$target.data(DateTimePicker.DATA_KEY);if($target.length===0){return;} 5157if(config&&config._options.debug||window.debug){return;} 5158TempusDominusBootstrap4._jQueryInterface.call($target,'hide',event);}).on(DateTimePicker.Event.KEYDOWN,'.'+DateTimePicker.ClassName.INPUT,function(event){var $target=getSelectorFromElement($(this));if($target.length===0){return;} 5159TempusDominusBootstrap4._jQueryInterface.call($target,'_keydown',event);}).on(DateTimePicker.Event.KEYUP,'.'+DateTimePicker.ClassName.INPUT,function(event){var $target=getSelectorFromElement($(this));if($target.length===0){return;} 5160TempusDominusBootstrap4._jQueryInterface.call($target,'_keyup',event);}).on(DateTimePicker.Event.FOCUS,'.'+DateTimePicker.ClassName.INPUT,function(event){var $target=getSelectorFromElement($(this)),config=$target.data(DateTimePicker.DATA_KEY);if($target.length===0){return;} 5161if(!(config&&config._options.allowInputToggle)){return;} 5162TempusDominusBootstrap4._jQueryInterface.call($target,'show',event);});$.fn[DateTimePicker.NAME]=TempusDominusBootstrap4._jQueryInterface;$.fn[DateTimePicker.NAME].Constructor=TempusDominusBootstrap4;$.fn[DateTimePicker.NAME].noConflict=function(){$.fn[DateTimePicker.NAME]=JQUERY_NO_CONFLICT;return TempusDominusBootstrap4._jQueryInterface;};return TempusDominusBootstrap4;}(jQuery);}();; 5163 5164/* /web/static/lib/select2/select2.js */ 5165(function($){if(typeof $.fn.each2=="undefined"){$.extend($.fn,{each2:function(c){var j=$([0]),i=-1,l=this.length;while(++i<l&&(j.context=j[0]=this[i])&&c.call(j[0],i,j)!==false);return this;}});}})(jQuery);(function($,undefined){"use strict";if(window.Select2!==undefined){return;} 5166var AbstractSelect2,SingleSelect2,MultiSelect2,nextUid,sizer,lastMousePosition={x:0,y:0},$document,scrollBarDimensions,KEY={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(k){k=k.which?k.which:k;switch(k){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:return true;} 5167return false;},isControl:function(e){var k=e.which;switch(k){case KEY.SHIFT:case KEY.CTRL:case KEY.ALT:return true;} 5168if(e.metaKey)return true;return false;},isFunctionKey:function(k){k=k.which?k.which:k;return k>=112&&k<=123;}},MEASURE_SCROLLBAR_TEMPLATE="<div class='select2-measure-scrollbar'></div>",DIACRITICS={"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18"
5168:"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC
51685":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038A":"\u0399","\u03AA":"\u0399","\u038C":"\u039F","\u038E":"\u03A5","\u03AB":"\u03A5","\u038F":"\u03A9","\u03AC":"\u03B1","\u03AD":"\u03B5","\u03AE":"\u03B7","\u03AF":"\u03B9","\u03CA":"\u03B9","\u0390":"\u03B9","\u03CC":"\u03BF","\u03CD":"\u03C5","\u03CB":"\u03C5","\u03B0":"\u03C5","\u03C9":"\u03C9","\u03C2":"\u03C3"};$document=$(document);nextUid=(function(){var counter=1;return function(){return counter++;};}());function reinsertElement(element){var placeholder=$(document.createTextNode(''));element.before(placeholder);placeholder.before(element);placeholder.remove();} 5169function stripDiacritics(str){function match(a){return DIACRITICS[a]||a;}
5170return str.replace(/[^\u0000-\u007E]/g,match);} 5171function indexOf(value,array){var i=0,l=array.length;for(;i<l;i=i+1){if(equal(value,array[i]))return i;} 5172return-1;} 5173function measureScrollbar(){var $template=$(MEASURE_SCROLLBAR_TEMPLATE);$template.appendTo(document.body);var dim={width:$template.width()-$template[0].clientWidth,height:$template.height()-$template[0].clientHeight};$template.remove();return dim;} 5174function equal(a,b){if(a===b)return true;if(a===undefined||b===undefined)return false;if(a===null||b===null)return false;if(a.constructor===String)return a+''===b+'';if(b.constructor===String)return b+''===a+'';return false;} 5175function splitVal(string,separator,transform){var val,i,l;if(string===null||string.length<1)return[];val=string.split(separator);for(i=0,l=val.length;i<l;i=i+1)val[i]=transform(val[i]);return val;} 5176function getSideBorderPadding(element){return element.outerWidth(false)-element.width();} 5177function installKeyUpChangeEvent(element){var key="keyup-change-value";element.on("keydown",function(){if($.data(element,key)===undefined){$.data(element,key,element.val());}});element.on("keyup",function(){var val=$.data(element,key);if(val!==undefined&&element.val()!==val){$.removeData(element,key);element.trigger("keyup-change");}});} 5178function installFilteredMouseMove(element){element.on("mousemove",function(e){var lastpos=lastMousePosition;if(lastpos===undefined||lastpos.x!==e.pageX||lastpos.y!==e.pageY){$(e.target).trigger("mousemove-filtered",e);}});} 5179function debounce(quietMillis,fn,ctx){ctx=ctx||undefined;var timeout;return function(){var args=arguments;window.clearTimeout(timeout);timeout=window.setTimeout(function(){fn.apply(ctx,args);},quietMillis);};} 5180function installDebouncedScroll(threshold,element){var notify=debounce(threshold,function(e){element.trigger("scroll-debounced",e);});element.on("scroll",function(e){if(indexOf(e.target,element.get())>=0)notify(e);});} 5181function focus($el){if($el[0]===document.activeElement)return;window.setTimeout(function(){var el=$el[0],pos=$el.val().length,range;$el.focus();var isVisible=(el.offsetWidth>0||el.offsetHeight>0);if(isVisible&&el===document.activeElement){if(el.setSelectionRange) 5182{el.setSelectionRange(pos,pos);} 5183else if(el.createTextRange){range=el.createTextRange();range.collapse(false);range.select();}}},0);} 5184function getCursorInfo(el){el=$(el)[0];var offset=0;var length=0;if('selectionStart'in el){offset=el.selectionStart;length=el.selectionEnd-offset;}else if('selection'in document){el.focus();var sel=document.selection.createRange();length=document.selection.createRange().text.length;sel.moveStart('character',-el.value.length);offset=sel.text.length-length;} 5185return{offset:offset,length:length};} 5186function killEvent(event){event.preventDefault();event.stopPropagation();} 5187function killEventImmediately(event){event.preventDefault();event.stopImmediatePropagation();} 5188function measureTextWidth(e){if(!sizer){var style=e[0].currentStyle||window.getComputedStyle(e[0],null);sizer=$(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:style.fontSize,fontFamily:style.fontFamily,fontStyle:style.fontStyle,fontWeight:style.fontWeight,letterSpacing:style.letterSpacing,textTransform:style.textTransform,whiteSpace:"nowrap"});sizer.attr("class","select2-sizer");$(document.body).append(sizer);} 5189sizer.text(e.val());return sizer.width();} 5190function syncCssClasses(dest,src,adapter){var classes,replacements=[],adapted;classes=$.trim(dest.attr("class"));if(classes){classes=''+classes;$(classes.split(/\s+/)).each2(function(){if(this.indexOf("select2-")===0){replacements.push(this);}});} 5191classes=$.trim(src.attr("class"));if(classes){classes=''+classes;$(classes.split(/\s+/)).each2(function(){if(this.indexOf("select2-")!==0){adapted=adapter(this);if(adapted){replacements.push(adapted);}}});} 5192dest.attr("class",replacements.join(" "));} 5193function markMatch(text,term,markup,escapeMarkup){var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),tl=term.length;if(match<0){markup.push(escapeMarkup(text));return;} 5194markup.push(escapeMarkup(text.substring(0,match)));markup.push("<span class='select2-match'>");markup.push(escapeMarkup(text.substring(match,match+tl)));markup.push("</span>");markup.push(escapeMarkup(text.substring(match+tl,text.length)));} 5195function defaultEscapeMarkup(markup){var replace_map={'\\':'\','&':'&','<':'<','>':'>','"':'"',"'":''',"/":'/'};return String(markup).replace(/[&<>"'\/\\]/g,function(match){return replace_map[match];});} 5196function ajax(options){var timeout,handler=null,quietMillis=options.quietMillis||
5196100,ajaxUrl=options.url,self=this;return function(query){window.clearTimeout(timeout);timeout=window.setTimeout(function(){var data=options.data,url=ajaxUrl,transport=options.transport||$.fn.select2.ajaxDefaults.transport,deprecated={type:options.type||'GET',cache:options.cache||false,jsonpCallback:options.jsonpCallback||undefined,dataType:options.dataType||"json"},params=$.extend({},$.fn.select2.ajaxDefaults.params,deprecated);data=data?data.call(self,query.term,query.page,query.context):null;url=(typeof url==='function')?url.call(self,query.term,query.page,query.context):url;if(handler&&typeof handler.abort==="function"){handler.abort();} 5197if(options.params){if($.isFunction(options.params)){$.extend(params,options.params.call(self));}else{$.extend(params,options.params);}} 5198$.extend(params,{url:url,dataType:options.dataType,data:data,success:function(data){var results=options.results(data,query.page,query);query.callback(results);},error:function(jqXHR,textStatus,errorThrown){var results={hasError:true,jqXHR:jqXHR,textStatus:textStatus,errorThrown:errorThrown};query.callback(results);}});handler=transport.call(self,params);},quietMillis);};} 5199function local(options){var data=options,dataText,tmp,text=function(item){return""+item.text;};if($.isArray(data)){tmp=data;data={results:tmp};} 5200if($.isFunction(data)===false){tmp=data;data=function(){return tmp;};} 5201var dataItem=data();if(dataItem.text){text=dataItem.text;if(!$.isFunction(text)){dataText=dataItem.text;text=function(item){return item[dataText];};}} 5202return function(query){var t=query.term,filtered={results:[]},process;if(t===""){query.callback(data());return;} 5203process=function(datum,collection){var group,attr;datum=datum[0];if(datum.children){group={};for(attr in datum){if(datum.hasOwnProperty(attr))group[attr]=datum[attr];} 5204group.children=[];$(datum.children).each2(function(i,childDatum){process(childDatum,group.children);});if(group.children.length||query.matcher(t,text(group),datum)){collection.push(group);}}else{if(query.matcher(t,text(datum),datum)){collection.push(datum);}}};$(data().results).each2(function(i,datum){process(datum,filtered.results);});query.callback(filtered);};} 5205function tags(data){var isFunc=$.isFunction(data);return function(query){var t=query.term,filtered={results:[]};var result=isFunc?data(query):data;if($.isArray(result)){$(result).each(function(){var isObject=this.text!==undefined,text=isObject?this.text:this;if(t===""||query.matcher(t,text)){filtered.results.push(isObject?this:{id:this,text:this});}});query.callback(filtered);}};} 5206function checkFormatter(formatter,formatterName){if($.isFunction(formatter))return true;if(!formatter)return false;if(typeof(formatter)==='string')return true;throw new Error(formatterName+" must be a string, function, or falsy value");} 5207function evaluate(val,context){if($.isFunction(val)){var args=Array.prototype.slice.call(arguments,2);return val.apply(context,args);} 5208return val;} 5209function countResults(results){var count=0;$.each(results,function(i,item){if(item.children){count+=countResults(item.children);}else{count++;}});return count;} 5210function defaultTokenizer(input,selection,selectCallback,opts){var original=input,dupe=false,token,index,i,l,separator;if(!opts.createSearchChoice||!opts.tokenSeparators||opts.tokenSeparators.length<1)return undefined;while(true){index=-1;for(i=0,l=opts.tokenSeparators.length;i<l;i++){separator=opts.tokenSeparators[i];index=input.indexOf(separator);if(index>=0)break;} 5211if(index<0)break;token=input.substring(0,index);input=input.substring(index+separator.length);if(token.length>0){token=opts.createSearchChoice.call(this,token,selection);if(token!==undefined&&token!==null&&opts.id(token)!==undefined&&opts.id(token)!==null){dupe=false;for(i=0,l=selection.length;i<l;i++){if(equal(opts.id(token),opts.id(selection[i]))){dupe=true;break;}} 5212if(!dupe)selectCallback(token);}}}
5213if(original!==input)return input;} 5214function cleanupJQueryElements(){var self=this;$.each(arguments,function(i,element){self[element].remove();self[element]=null;});} 5215function clazz(SuperClass,methods){var constructor=function(){};constructor.prototype=new SuperClass;constructor.prototype.constructor=constructor;constructor.prototype.parent=SuperClass.prototype;constructor.prototype=$.extend(constructor.prototype,methods);return constructor;} 5216AbstractSelect2=clazz(Object,{bind:function(func){var self=this;return function(){func.apply(self,arguments);};},init:function(opts){var results,search,resultsSelector=".select2-results";this.opts=opts=this.prepareOpts(opts);this.id=opts.id;if(opts.element.data("select2")!==undefined&&opts.element.data("select2")!==null){opts.element.data("select2").destroy();} 5217this.container=this.createContainer();this.liveRegion=$('.select2-hidden-accessible');if(this.liveRegion.length==0){this.liveRegion=$("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body);} 5218this.containerId="s2id_"+(opts.element.attr("id")||"autogen"+nextUid());this.containerEventName=this.containerId.replace(/([.])/g,'_').replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,'\\$1');this.container.attr("id",this.containerId);this.container.attr("title",opts.element.attr("title"));this.body=$(document.body);syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.attr("style",opts.element.attr("style"));this.container.css(evaluate(opts.containerCss,this.opts.element));this.container.addClass(evaluate(opts.containerCssClass,this.opts.element));this.elementTabIndex=this.opts.element.attr("tabindex");this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",killEvent);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(evaluate(opts.dropdownCssClass,this.opts.element));this.dropdown.data("select2",this);this.dropdown.on("click",killEvent);this.results=results=this.container.find(resultsSelector);this.search=search=this.container.find("input.select2-input");this.queryCount=0;this.resultsPage=0;this.context=null;this.initContainer();this.container.on("click",killEvent);installFilteredMouseMove(this.results);this.dropdown.on("mousemove-filtered",resultsSelector,this.bind(this.highlightUnderEvent));this.dropdown.on("touchstart touchmove touchend",resultsSelector,this.bind(function(event){this._touchEvent=true;this.highlightUnderEvent(event);}));this.dropdown.on("touchmove",resultsSelector,this.bind(this.touchMoved));this.dropdown.on("touchstart touchend",resultsSelector,this.bind(this.clearTouchMoved));this.dropdown.on('click',this.bind(function(event){if(this._touchEvent){this._touchEvent=false;this.selectHighlighted();}}));installDebouncedScroll(80,this.results);this.dropdown.on("scroll-debounced",resultsSelector,this.bind(this.loadMoreIfNeeded));$(this.container).on("change",".select2-input",function(e){e.stopPropagation();});$(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation();});if($.fn.mousewheel){results.mousewheel(function(e,delta,deltaX,deltaY){var top=results.scrollTop();if(deltaY>0&&top-deltaY<=0){results.scrollTop(0);killEvent(e);}else if(deltaY<0&&results.get(0).scrollHeight-results.scrollTop()+deltaY<=results.height()){results.scrollTop(results.get(0).scrollHeight-results.height());killEvent(e);}});} 5219installKeyUpChangeEvent(search);search.on("keyup-change input paste",this.bind(this.updateResults));search.on("focus",function(){search.addClass("select2-focused");});search.on("blur",function(){search.removeClass("select2-focused");});this.dropdown.on("mouseup",resultsSelector,this.bind(function(e){if($(e.target).closest(".select2-result-selectable").length>0){this.highlightUnderEvent(e);this.selectHighlighted(e);}}));this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation();});this.lastSearchTerm=undefined;if($.isFunction(this.opts.initSelection)){this.initSelection();this.monitorSource();} 5220if(opts.maximumInputLength!==null){this.search.attr("maxlength",opts.maximumInputLength);} 5221var disabled=opts.element.prop("disabled");if(disabled===undefined)disabled=false;this.enable(!disabled);var readonly=opts.element.prop("readonly");if(readonly===undefined)readonly=false;this.readonly(readonly);scrollBarDimensions=scrollBarDimensions||measureScrollbar();this.autofocus=opts.element.prop("autofocus");opts.element.prop("autofocus",false);
5221if(this.autofocus)this.focus();this.search.attr("placeholder",opts.searchInputPlaceholder);},destroy:function(){var element=this.opts.element,select2=element.data("select2"),self=this;this.close();if(element.length&&element[0].detachEvent&&self._sync){element.each(function(){if(self._sync){this.detachEvent("onpropertychange",self._sync);}});} 5222if(this.propertyObserver){this.propertyObserver.disconnect();this.propertyObserver=null;} 5223this._sync=null;if(select2!==undefined){select2.container.remove();select2.liveRegion.remove();select2.dropdown.remove();element.removeData("select2").off(".select2");if(!element.is("input[type='hidden']")){element.show().prop("autofocus",this.autofocus||false);if(this.elementTabIndex){element.attr({tabindex:this.elementTabIndex});}else{element.removeAttr("tabindex");} 5224element.show();}else{element.css("display","");}} 5225cleanupJQueryElements.call(this,"container","liveRegion","dropdown","results","search");},optionToData:function(element){if(element.is("option")){return{id:element.prop("value"),text:element.text(),element:element.get(),css:element.attr("class"),disabled:element.prop("disabled"),locked:equal(element.attr("locked"),"locked")||equal(element.data("locked"),true)};}else if(element.is("optgroup")){return{text:element.attr("label"),children:[],element:element.get(),css:element.attr("class")};}},prepareOpts:function(opts){var element,select,idKey,ajaxUrl,self=this;element=opts.element;if(element.get(0).tagName.toLowerCase()==="select"){this.select=select=opts.element;} 5226if(select){$.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in opts){throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");}});} 5227opts.debug=opts.debug||$.fn.select2.defaults.debug;if(opts.debug&&console&&console.warn){if(opts.id!=null){console.warn('Select2: The `id` option has been removed in Select2 4.0.0, '+'consider renaming your `id` property or mapping the property before your data makes it to Select2. '+'You can read more at https://select2.github.io/announcements-4.0.html#changed-id');} 5228if(opts.text!=null){console.warn('Select2: The `text` option has been removed in Select2 4.0.0, '+'consider renaming your `text` property or mapping the property before your data makes it to Select2. '+'You can read more at https://select2.github.io/announcements-4.0.html#changed-id');} 5229if(opts.sortResults!=null){console.warn('Select2: the `sortResults` option has been renamed to `sorter` in Select2 4.0.0. ');} 5230if(opts.selectOnBlur!=null){console.warn('Select2: The `selectOnBlur` option has been renamed to `selectOnClose` in Select2 4.0.0.');} 5231if(opts.ajax!=null&&opts.ajax.results!=null){console.warn('Select2: The `ajax.results` option has been renamed to `ajax.processResults` in Select2 4.0.0.');} 5232if(opts.formatNoResults!=null){console.warn('Select2: The `formatNoResults` option has been renamed to `language.noResults` in Select2 4.0.0.');} 5233if(opts.formatSearching!=null){console.warn('Select2: The `formatSearching` option has been renamed to `language.searching` in Select2 4.0.0.');} 5234if(opts.formatInputTooShort!=null){console.warn('Select2: The `formatInputTooShort` option has been renamed to `language.inputTooShort` in Select2 4.0.0.');} 5235if(opts.formatInputTooLong!=null){console.warn('Select2: The `formatInputTooLong` option has been renamed to `language.inputTooLong` in Select2 4.0.0.');} 5236if(opts.formatLoading!=null){console.warn('Select2: The `formatLoading` option has been renamed to `language.loadingMore` in Select2 4.0.0.');} 5237if(opts.formatSelectionTooBig!=null){console.warn('Select2: The `formatSelectionTooBig` option has been renamed to `language.maximumSelected` in Select2 4.0.0.');} 5238if(opts.element.data('select2Tags')){console.warn('Select2: The `data-select2-tags` attribute has been renamed to `data-tags` in Select2 4.0.0.');}} 5239if(opts.element.data('tags')!=null){var elemTags=opts.element.data('tags');if(!$.isArray(elemTags)){elemTags=[];} 5240opts.element.data('select2Tags',elemTags);} 5241if(opts.sorter!=null){opts.sortResults=opts.sorter;} 5242if(opts.selectOnClose!=null){opts.selectOnBlur=opts.selectOnClose;} 5243if(opts.ajax!=null){if($.isFunction(opts.ajax.processResults)){opts.ajax.results=opts.ajax.processResults;}} 5244if(opts.language!=null){var lang=opts.language;if($.isFunction(lang.noMatches)){opts.formatNoMatches=lang.noMatches;} 5245if($.isFunction(lang.searching)){opts.formatSearching=lang.searching;} 5246if($.isFunction(lang.inputTooShort)){opts.formatInputTooShort=lang.inputTooShort;} 5247if($.isFunction(lang.inputTooLong)){opts.formatInputTooLong=lang.inputTooLong;} 5248if($.isFunction(lang.loadingMore)){opts.formatLoading=lang.loadingMore;} 5249if($.isFunction(lang.maximumSelected)){opts.formatSelectionTooBig=lang.maximumSelected;}} 5250opts=$.extend({},{populateResults:function(container,results,query){var populate,id=this.opts.id,liveRegion=this.liveRegion;populate=function(results,container,depth){var i,l,result,selectable,disabled,compound,node,label,innerContainer,formatted;results=opts.sortResults(results,container,query);var nodes=[];for(i=0,l=results.length;i<l;i=i+1){result=results[i];disabled=(result.disabled===true);selectable=(!disabled)&&(id(result)!==undefined);compound=result.children&&result.children.length>0;node=$("<li></li>");node.addClass("select2-results-dept-"+depth);
5250node.addClass("select2-result");node.addClass(selectable?"select2-result-selectable":"select2-result-unselectable");if(disabled){node.addClass("select2-disabled");} 5251if(compound){node.addClass("select2-result-with-children");} 5252node.addClass(self.opts.formatResultCssClass(result));node.attr("role","presentation");label=$(document.createElement("div"));label.addClass("select2-result-label");label.attr("id","select2-result-label-"+nextUid());label.attr("role","option");formatted=opts.formatResult(result,label,query,self.opts.escapeMarkup);if(formatted!==undefined){label.html(formatted);node.append(label);} 5253if(compound){innerContainer=$("<ul></ul>");innerContainer.addClass("select2-result-sub");populate(result.children,innerContainer,depth+1);node.append(innerContainer);} 5254node.data("select2-data",result);nodes.push(node[0]);} 5255container.append(nodes);liveRegion.text(opts.formatMatches(results.length));};populate(results,container,0);}},$.fn.select2.defaults,opts);if(typeof(opts.id)!=="function"){idKey=opts.id;opts.id=function(e){return e[idKey];};}
5256if($.isArray(opts.element.data("select2Tags"))){if("tags"in opts){throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+opts.element.attr("id");} 5257opts.tags=opts.element.data("select2Tags");} 5258if(select){opts.query=this.bind(function(query){var data={results:[],more:false},term=query.term,children,placeholderOption,process;process=function(element,collection){var group;if(element.is("option")){if(query.matcher(term,element.text(),element)){collection.push(self.optionToData(element));}}else if(element.is("optgroup")){group=self.optionToData(element);element.children().each2(function(i,elm){process(elm,group.children);});if(group.children.length>0){collection.push(group);}}};children=element.children();if(this.getPlaceholder()!==undefined&&children.length>0){placeholderOption=this.getPlaceholderOption();if(placeholderOption){children=children.not(placeholderOption);}} 5259children.each2(function(i,elm){process(elm,data.results);});query.callback(data);});opts.id=function(e){return e.id;};}else{if(!("query"in opts)){if("ajax"in opts){ajaxUrl=opts.element.data("ajax-url");if(ajaxUrl&&ajaxUrl.length>0){opts.ajax.url=ajaxUrl;} 5260opts.query=ajax.call(opts.element,opts.ajax);}else if("data"in opts){opts.query=local(opts.data);}else if("tags"in opts){opts.query=tags(opts.tags);if(opts.createSearchChoice===undefined){opts.createSearchChoice=function(term){return{id:$.trim(term),text:$.trim(term)};};} 5261if(opts.initSelection===undefined){opts.initSelection=function(element,callback){var data=[];$(splitVal(element.val(),opts.separator,opts.transformVal)).each(function(){var obj={id:this,text:this},tags=opts.tags;if($.isFunction(tags))tags=tags();$(tags).each(function(){if(equal(this.id,obj.id)){obj=this;return false;}});data.push(obj);});callback(data);};}}}} 5262if(typeof(opts.query)!=="function"){throw"query function not defined for Select2 "+opts.element.attr("id");} 5263if(opts.createSearchChoicePosition==='top'){opts.createSearchChoicePosition=function(list,item){list.unshift(item);};} 5264else if(opts.createSearchChoicePosition==='bottom'){opts.createSearchChoicePosition=function(list,item){list.push(item);};} 5265else if(typeof(opts.createSearchChoicePosition)!=="function"){throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";} 5266return opts;},monitorSource:function(){var el=this.opts.element,observer,self=this;el.on("change.select2",this.bind(function(e){if(this.opts.element.data("select2-change-triggered")!==true){this.initSelection();}}));this._sync=this.bind(function(){var disabled=el.prop("disabled");if(disabled===undefined)disabled=false;this.enable(!disabled);var readonly=el.prop("readonly");if(readonly===undefined)readonly=false;this.readonly(readonly);if(this.container){syncCssClasses(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.addClass(evaluate(this.opts.containerCssClass,this.opts.element));} 5267if(this.dropdown){syncCssClasses(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(evaluate(this.opts.dropdownCssClass,this.opts.element));}});if(el.length&&el[0].attachEvent){el.each(function(){this.attachEvent("onpropertychange",self._sync);});} 5268observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(observer!==undefined){if(this.propertyObserver){delete this.propertyObserver;this.propertyObserver=null;} 5269this.propertyObserver=new observer(function(mutations){$.each(mutations,self._sync);});this.propertyObserver.observe(el.get(0),{attributes:true,subtree:false});}},triggerSelect:function(data){var evt=$.Event("select2-selecting",{val:this.id(data),object:data,choice:data});this.opts.element.trigger(evt);return!evt.isDefaultPrevented();},triggerChange:function(details){details=details||{};details=$.extend({},details,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",true);this.opts.element.trigger(details);this.opts.element.data("select2-change-triggered",false);this.opts.element.click();if(this.opts.blurOnChange) 5270this.opts.element.blur();},isInterfaceEnabled:function() 5271{return this.enabledInterface===true;},enableInterface:function(){var enabled=this._enabled&&!this._readonly,disabled=!enabled;if(enabled===this.enabledInterface)return false;this.container.toggleClass("select2-container-disabled",disabled);this.close();this.enabledInterface=enabled;return true;},enable:function(enabled){if(enabled===undefined)enabled=true;if(this._enabled===enabled)return;this._enabled=enabled;this.opts.element.prop("disabled",!enabled);this.enableInterface();},disable:function(){this.enable(false);},readonly:function(enabled){if(enabled===undefined)enabled=false;if(this._readonly===enabled)return;this._readonly=enabled;this.opts.element.prop("readonly",enabled);this.enableInterface();},opened:function(){return(this.container)?this.container.hasClass("select2-dropdown-open"):false;},positionDropdown:function(){var $dropdown=this.dropdown,container=this.container,offset=container.offset(),height=container.outerHeight(false),width=container.outerWidth(false),dropHeight=$dropdown.outerHeight(false),$window=$(window),windowWidth=$window.width(),windowHeight=$window.height(),viewPortRight=$window.scrollLeft()+windowWidth,viewportBottom=$window.scrollTop()+windowHeight,dropTop=offset.top+height,dropLeft=offset.left,enoughRoomBelow=dropTop+dropHeight<=viewportBottom,enoughRoomAbove=(offset.top-dropHeight)>=$window.scrollTop(),dropWidth=$dropdown.outerWidth(false),enoughRoomOnRight=function(){return dropLeft+dropWidth<=viewPortRight;},enoughRoomOnLeft=function(){return offset.left+viewPortRight+container.outerWidth(false)>dropWidth;},aboveNow=$dropdown.hasClass("select2-drop-above"),bodyOffset,above,changeDirection,css,resultsListNode;if(aboveNow){above=true;if(!enoughRoomAbove&&enoughRoomBelow){changeDirection=true;above=false;}}else{above=false;if(!enoughRoomBelow&&enoughRoomAbove){changeDirection=true;above=true;}} 5272if(changeDirection){$dropdown.hide();offset=this.container.offset();height=this.container.outerHeight(false);width=this.container.outerWidth(false);dropHeight=$dropdown.outerHeight(false);viewPortRight=$window.scrollLeft()+windowWidth;viewportBottom=$window.scrollTop()+windowHeight;dropTop=offset.top+height;dropLeft=offset.left;dropWidth=$dropdown.outerWidth(false);$dropdown.show();this.focusSearch();} 5273if(this.opts.dropdownAutoWidth){resultsListNode=$('.select2-results',$dropdown)[0];$dropdown.addClass('select2-drop-auto-width');$dropdown.css('width','');dropWidth=$dropdown.outerWidth(false)+(resultsListNode.scrollHeight===resultsListNode.clientHeight?0:scrollBarDimensions.width);dropWidth>width?width=dropWidth:dropWidth=width;dropHeight=$dropdown.outerHeight(false);} 5274else{this.container.removeClass('select2-drop-auto-width');} 5275if(this.body.css('position')!=='static'){bodyOffset=this.body.offset();dropTop-=bodyOffset.top;dropLeft-=bodyOffset.left;} 5276if(!enoughRoomOnRight()&&enoughRoomOnLeft()){dropLeft=offset.left+this.container.outerWidth(false)-dropWidth;} 5277css={left:dropLeft,width:width};if(above){this.container.addClass("select2-drop-above");$dropdown.addClass("select2-drop-above");dropHeight=$dropdown.outerHeight(false);css.top=offset.top-dropHeight;css.bottom='auto';} 5278else{css.top=dropTop;css.bottom='auto';this.container.removeClass("select2-drop-above");$dropdown.removeClass("select2-drop-above");} 5279css=$.extend(css,evaluate(this.opts.dropdownCss,this.opts.element));$dropdown.css(css);},shouldOpen:function(){var event;if(this.opened())return false;if(this._enabled===false||this._readonly===true)return false;event=$.Event("select2-opening");this.opts.element.trigger(event);return!event.isDefaultPrevented();},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above");},open:function(){if(!this.shouldOpen())return false;this.opening();$document.on("mousemove.select2Event",function(e){lastMousePosition.x=e.pageX;lastMousePosition.y=e.pageY;});return true;},opening:function(){var cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid,mask;this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.clearDropdownAlignmentPreference();
5279if(this.dropdown[0]!==this.body.children().last()[0]){this.dropdown.detach().appendTo(this.body);} 5280mask=$("#select2-drop-mask");if(mask.length===0){mask=$(document.createElement("div"));mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");mask.hide();mask.appendTo(this.body);mask.on("mousedown touchstart click",function(e){reinsertElement(mask);var dropdown=$("#select2-drop"),self;if(dropdown.length>0){self=dropdown.data("select2");if(self.opts.selectOnBlur){self.selectHighlighted({noFocus:true});} 5281self.close();e.preventDefault();e.stopPropagation();}});} 5282if(this.dropdown.prev()[0]!==mask[0]){this.dropdown.before(mask);} 5283$("#select2-drop").removeAttr("id");this.dropdown.attr("id","select2-drop");mask.show();this.positionDropdown();this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");var that=this;this.container.parents().add(window).each(function(){$(this).on(resize+" "+scroll+" "+orient,function(e){if(that.opened())that.positionDropdown();});});},close:function(){if(!this.opened())return;var cid=this.containerEventName,scroll="scroll."+cid,resize="resize."+cid,orient="orientationchange."+cid;this.container.parents().add(window).each(function(){$(this).off(scroll).off(resize).off(orient);});this.clearDropdownAlignmentPreference();$("#select2-drop-mask").hide();this.dropdown.removeAttr("id");this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();$document.off("mousemove.select2Event");this.clearSearch();this.search.removeClass("select2-active");this.search.removeAttr("aria-activedescendant");this.opts.element.trigger($.Event("select2-close"));},externalSearch:function(term){this.open();this.search.val(term);this.updateResults(false);},clearSearch:function(){},prefillNextSearchTerm:function(){if(this.search.val()!==""){return false;} 5284var nextSearchTerm=this.opts.nextSearchTerm(this.data(),this.lastSearchTerm);if(nextSearchTerm!==undefined){this.search.val(nextSearchTerm);this.search.select();return true;} 5285return false;},getMaximumSelectionSize:function(){return evaluate(this.opts.maximumSelectionSize,this.opts.element);},ensureHighlightVisible:function(){var results=this.results,children,index,child,hb,rb,y,more,topOffset;index=this.highlight();if(index<0)return;if(index==0){results.scrollTop(0);return;} 5286children=this.findHighlightableChoices().find('.select2-result-label');child=$(children[index]);topOffset=(child.offset()||{}).top||0;hb=topOffset+child.outerHeight(true);if(index===children.length-1){more=results.find("li.select2-more-results");if(more.length>0){hb=more.offset().top+more.outerHeight(true);}} 5287rb=results.offset().top+results.outerHeight(false);if(hb>rb){results.scrollTop(results.scrollTop()+(hb-rb));} 5288y=topOffset-results.offset().top;if(y<0&&child.css('display')!='none'){results.scrollTop(results.scrollTop()+y);}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");},moveHighlight:function(delta){var choices=this.findHighlightableChoices(),index=this.highlight();while(index>-1&&index<choices.length){index+=delta;var choice=$(choices[index]);if(choice.hasClass("select2-result-selectable")&&!choice.hasClass("select2-disabled")&&!choice.hasClass("select2-selected")){this.highlight(index);break;}}},highlight:function(index){var choices=this.findHighlightableChoices(),choice,data;if(arguments.length===0){return indexOf(choices.filter(".select2-highlighted")[0],choices.get());} 5289if(index>=choices.length)index=choices.length-1;if(index<0)index=0;this.removeHighlight();choice=$(choices[index]);choice.addClass("select2-highlighted");this.search.attr("aria-activedescendant",choice.find(".select2-result-label").attr("id"));this.ensureHighlightVisible();this.liveRegion.text(choice.text());data=choice.data("select2-data");if(data){this.opts.element.trigger({type:"select2-highlight",val:this.id(data),choice:data});}},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted");},touchMoved:function(){this._touchMoved=true;},clearTouchMoved:function(){this._touchMoved=false;},countSelectableResults:function(){return this.findHighlightableChoices().length;},highlightUnderEvent:function(event){var el=$(event.target).closest(".select2-result-selectable");if(el.length>0&&!el.is(".select2-highlighted")){var choices=this.findHighlightableChoices();this.highlight(choices.index(el));}else if(el.length==0){this.removeHighlight();}},loadMoreIfNeeded:function(){var results=this.results,more=results.find("li.select2-more-results"),below,page=this.resultsPage+1,self=this,term=this.search.val(),context=this.context;if(more.length===0)return;below=more.offset().top-results.offset().top-results.height();if(below<=this.opts.loadMorePadding){more.addClass("select2-active");this.opts.query({element:this.opts.element,term:term,page:page,context:context,matcher:this.opts.matcher,callback:this.bind(function(data){if(!self.opened())return;self.opts.populateResults.call(this,results,data.results,{term:term,page:page,context:context});self.postprocessResults(data,false,false);
5289if(data.more===true){more.detach().appendTo(results).html(self.opts.escapeMarkup(evaluate(self.opts.formatLoadMore,self.opts.element,page+1)));window.setTimeout(function(){self.loadMoreIfNeeded();},10);}else{more.remove();} 5290self.positionDropdown();self.resultsPage=page;self.context=data.context;this.opts.element.trigger({type:"select2-loaded",items:data});})});}},tokenize:function(){},updateResults:function(initial){var search=this.search,results=this.results,opts=this.opts,data,self=this,input,term=search.val(),lastTerm=$.data(this.container,"select2-last-term"),queryNumber;if(initial!==true&&lastTerm&&equal(term,lastTerm))return;$.data(this.container,"select2-last-term",term);if(initial!==true&&(this.showSearchInput===false||!this.opened())){return;} 5291function postRender(){search.removeClass("select2-active");self.positionDropdown();if(results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length){self.liveRegion.text(results.text());} 5292else{self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable:not(".select2-selected")').length));}} 5293function render(html){results.html(html);postRender();} 5294queryNumber=++this.queryCount;var maxSelSize=this.getMaximumSelectionSize();if(maxSelSize>=1){data=this.data();if($.isArray(data)&&data.length>=maxSelSize&&checkFormatter(opts.formatSelectionTooBig,"formatSelectionTooBig")){render("<li class='select2-selection-limit'>"+evaluate(opts.formatSelectionTooBig,opts.element,maxSelSize)+"</li>");return;}} 5295if(search.val().length<opts.minimumInputLength){if(checkFormatter(opts.formatInputTooShort,"formatInputTooShort")){render("<li class='select2-no-results'>"+evaluate(opts.formatInputTooShort,opts.element,search.val(),opts.minimumInputLength)+"</li>");}else{render("");} 5296if(initial&&this.showSearch)this.showSearch(true);return;} 5297if(opts.maximumInputLength&&search.val().length>opts.maximumInputLength){if(checkFormatter(opts.formatInputTooLong,"formatInputTooLong")){render("<li class='select2-no-results'>"+evaluate(opts.formatInputTooLong,opts.element,search.val(),opts.maximumInputLength)+"</li>");}else{render("");} 5298return;} 5299if(opts.formatSearching&&this.findHighlightableChoices().length===0){render("<li class='select2-searching'>"+evaluate(opts.formatSearching,opts.element)+"</li>");} 5300search.addClass("select2-active");this.removeHighlight();input=this.tokenize();if(input!=undefined&&input!=null){search.val(input);} 5301this.resultsPage=1;opts.query({element:opts.element,term:search.val(),page:this.resultsPage,context:null,matcher:opts.matcher,callback:this.bind(function(data){var def;if(queryNumber!=this.queryCount){return;} 5302if(!this.opened()){this.search.removeClass("select2-active");return;} 5303if(data.hasError!==undefined&&checkFormatter(opts.formatAjaxError,"formatAjaxError")){render("<li class='select2-ajax-error'>"+evaluate(opts.formatAjaxError,opts.element,data.jqXHR,data.textStatus,data.errorThrown)+"</li>");return;} 5304this.context=(data.context===undefined)?null:data.context;if(this.opts.createSearchChoice&&search.val()!==""){def=this.opts.createSearchChoice.call(self,search.val(),data.results);if(def!==undefined&&def!==null&&self.id(def)!==undefined&&self.id(def)!==null){if($(data.results).filter(function(){return equal(self.id(this),self.id(def));}).length===0){this.opts.createSearchChoicePosition(data.results,def);}}} 5305if(data.results.length===0&&checkFormatter(opts.formatNoMatches,"formatNoMatches")){render("<li class='select2-no-results'>"+evaluate(opts.formatNoMatches,opts.element,search.val())+"</li>");if(this.showSearch){this.showSearch(search.val());} 5306return;} 5307results.empty();self.opts.populateResults.call(this,results,data.results,{term:search.val(),page:this.resultsPage,context:null});if(data.more===true&&checkFormatter(opts.formatLoadMore,"formatLoadMore")){results.append("<li class='select2-more-results'>"+opts.escapeMarkup(evaluate(opts.formatLoadMore,opts.element,this.resultsPage))+"</li>");window.setTimeout(function(){self.loadMoreIfNeeded();},10);} 5308this.postprocessResults(data,initial);postRender();this.opts.element.trigger({type:"select2-loaded",items:data});})});},cancel:function(){this.close();},blur:function(){if(this.opts.selectOnBlur) 5309this.selectHighlighted({noFocus:true});this.close();this.container.removeClass("select2-container-active");if(this.search[0]===document.activeElement){this.search.blur();} 5310this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");},focusSearch:function(){focus(this.search);},selectHighlighted:function(options){if(this._touchMoved){this.clearTouchMoved();return;} 5311var index=this.highlight(),highlighted=this.results.find(".select2-highlighted"),data=highlighted.closest('.select2-result').data("select2-data");if(data){this.highlight(index);this.onSelect(data,options);}else if(options&&options.noFocus){this.close();}},getPlaceholder:function(){var placeholderOption;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((placeholderOption=this.getPlaceholderOption())!==undefined?placeholderOption.text():undefined);},getPlaceholderOption:function(){if(this.select){var firstOption=this.select.children('option').first();
5311if(this.opts.placeholderOption!==undefined){return(this.opts.placeholderOption==="first"&&firstOption)||(typeof this.opts.placeholderOption==="function"&&this.opts.placeholderOption(this.select));}else if($.trim(firstOption.text())===""&&firstOption.val()===""){return firstOption;}}},initContainerWidth:function(){function resolveContainerWidth(){var style,attrs,matches,i,l,attr;if(this.opts.width==="off"){return null;}else if(this.opts.width==="element"){return this.opts.element.outerWidth(false)===0?'auto':this.opts.element.outerWidth(false)+'px';}else if(this.opts.width==="copy"||this.opts.width==="resolve"){style=this.opts.element.attr('style');if(typeof(style)==="string"){attrs=style.split(';');for(i=0,l=attrs.length;i<l;i=i+1){attr=attrs[i].replace(/\s/g,'');matches=attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);if(matches!==null&&matches.length>=1) 5312return matches[1];}} 5313if(this.opts.width==="resolve"){style=this.opts.element.css('width');if(style.indexOf("%")>0)return style;return(this.opts.element.outerWidth(false)===0?'auto':this.opts.element.outerWidth(false)+'px');} 5314return null;}else if($.isFunction(this.opts.width)){return this.opts.width();}else{return this.opts.width;}};var width=resolveContainerWidth.call(this);if(width!==null){this.container.css("width",width);}}});SingleSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return container;},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.focusser.prop("disabled",!this.isInterfaceEnabled());}},opening:function(){var el,range,len;if(this.opts.minimumResultsForSearch>=0){this.showSearch(true);} 5315this.parent.opening.apply(this,arguments);if(this.showSearchInput!==false){this.search.val(this.focusser.val());} 5316if(this.opts.shouldFocusInput(this)){this.search.focus();el=this.search.get(0);if(el.createTextRange){range=el.createTextRange();range.collapse(false);range.select();}else if(el.setSelectionRange){len=this.search.val().length;el.setSelectionRange(len,len);}} 5317this.prefillNextSearchTerm();this.focusser.prop("disabled",true).val("");this.updateResults(true);this.opts.element.trigger($.Event("select2-open"));},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments);this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus();}},focus:function(){if(this.opened()){this.close();}else{this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus();}}},isFocused:function(){return this.container.hasClass("select2-container-active");},cancel:function(){this.parent.cancel.apply(this,arguments);this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus();}},destroy:function(){$("label[for='"+this.focusser.attr('id')+"']").attr('for',this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments);cleanupJQueryElements.call(this,"selection","focusser");},initContainer:function(){var selection,container=this.container,dropdown=this.dropdown,idSuffix=nextUid(),elementLabel;if(this.opts.minimumResultsForSearch<0){this.showSearch(false);}else{this.showSearch(true);} 5318this.selection=selection=container.find(".select2-choice");this.focusser=container.find(".select2-focusser");selection.find(".select2-chosen").attr("id","select2-chosen-"+idSuffix);this.focusser.attr("aria-labelledby","select2-chosen-"+idSuffix);this.results.attr("id","select2-results-"+idSuffix);this.search.attr("aria-owns","select2-results-"+idSuffix);this.focusser.attr("id","s2id_autogen"+idSuffix);elementLabel=$("label[for='"+this.opts.element.attr("id")+"']");this.opts.element.on('focus.select2',this.bind(function(){this.focus();}));this.focusser.prev().text(elementLabel.text()).attr('for',this.focusser.attr('id'));var originalTitle=this.opts.element.attr("title");this.opts.element.attr("title",(originalTitle||elementLabel.text()));this.focusser.attr("tabindex",this.elementTabIndex);this.search.attr("id",this.focusser.attr('id')+'_search');this.search.prev().text($("label[for='"+this.focusser.attr('id')+"']").text()).attr('for',this.search.attr('id'));this.search.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;if(229==e.keyCode)return;if(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN){killEvent(e);return;} 5319switch(e.which){case KEY.UP:case KEY.DOWN:this.moveHighlight((e.which===KEY.UP)?-1:1);killEvent(e);return;case KEY.ENTER:this.selectHighlighted();killEvent(e);return;case KEY.TAB:this.selectHighlighted({noFocus:true});return;case KEY.ESC:this.cancel(e);killEvent(e);return;}}));this.search.on("blur",this.bind(function(e){if(document.activeElement===this.body.get(0)){window.setTimeout(this.bind(function(){if(this.opened()&&this.results&&this.results.length>1){this.search.focus();}}),0);}}));
5319this.focusser.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;if(e.which===KEY.TAB||KEY.isControl(e)||KEY.isFunctionKey(e)||e.which===KEY.ESC){return;} 5320if(this.opts.openOnEnter===false&&e.which===KEY.ENTER){killEvent(e);return;} 5321if(e.which==KEY.DOWN||e.which==KEY.UP||(e.which==KEY.ENTER&&this.opts.openOnEnter)){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;this.open();killEvent(e);return;} 5322if(e.which==KEY.DELETE||e.which==KEY.BACKSPACE){if(this.opts.allowClear){this.clear();} 5323killEvent(e);return;}}));installKeyUpChangeEvent(this.focusser);this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){e.stopPropagation();if(this.opened())return;this.open();}}));selection.on("mousedown touchstart","abbr",this.bind(function(e){if(!this.isInterfaceEnabled()){return;} 5324this.clear();killEventImmediately(e);this.close();if(this.selection){this.selection.focus();}}));selection.on("mousedown touchstart",this.bind(function(e){reinsertElement(selection);if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger($.Event("select2-focus"));} 5325if(this.opened()){this.close();}else if(this.isInterfaceEnabled()){this.open();} 5326killEvent(e);}));dropdown.on("mousedown touchstart",this.bind(function(){if(this.opts.shouldFocusInput(this)){this.search.focus();}}));selection.on("focus",this.bind(function(e){killEvent(e);}));this.focusser.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger($.Event("select2-focus"));} 5327this.container.addClass("select2-container-active");})).on("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active");this.opts.element.trigger($.Event("select2-blur"));}}));this.search.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger($.Event("select2-focus"));} 5328this.container.addClass("select2-container-active");}));this.initContainerWidth();this.opts.element.hide();this.setPlaceholder();},clear:function(triggerChange){var data=this.selection.data("select2-data");if(data){var evt=$.Event("select2-clearing");this.opts.element.trigger(evt);if(evt.isDefaultPrevented()){return;} 5329var placeholderOption=this.getPlaceholderOption();this.opts.element.val(placeholderOption?placeholderOption.val():"");this.selection.find(".select2-chosen").empty();this.selection.removeData("select2-data");this.setPlaceholder();if(triggerChange!==false){this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data});this.triggerChange({removed:data});}}},initSelection:function(){var selected;if(this.isPlaceholderOptionSelected()){this.updateSelection(null);this.close();this.setPlaceholder();}else{var self=this;this.opts.initSelection.call(null,this.opts.element,function(selected){if(selected!==undefined&&selected!==null){self.updateSelection(selected);self.close();self.setPlaceholder();self.lastSearchTerm=self.search.val();}});}},isPlaceholderOptionSelected:function(){var placeholderOption;if(this.getPlaceholder()===undefined)return false;return((placeholderOption=this.getPlaceholderOption())!==undefined&&placeholderOption.prop("selected"))||(this.opts.element.val()==="")||(this.opts.element.val()===undefined)||(this.opts.element.val()===null);},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;if(opts.element.get(0).tagName.toLowerCase()==="select"){opts.initSelection=function(element,callback){var selected=element.find("option").filter(function(){return this.selected&&!this.disabled});callback(self.optionToData(selected));};}else if("data"in opts){opts.initSelection=opts.initSelection||function(element,callback){var id=element.val();var match=null;opts.query({matcher:function(term,text,el){var is_match=equal(id,opts.id(el));if(is_match){match=el;} 5330return is_match;},callback:!$.isFunction(callback)?$.noop:function(){callback(match);}});};} 5331return opts;},getPlaceholder:function(){if(this.select){if(this.getPlaceholderOption()===undefined){return undefined;}} 5332return this.parent.getPlaceholder.apply(this,arguments);},setPlaceholder:function(){var placeholder=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&placeholder!==undefined){if(this.select&&this.getPlaceholderOption()===undefined)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder));this.selection.addClass("select2-default");this.container.removeClass("select2-allowclear");}},postprocessResults:function(data,initial,noHighlightUpdate){var selected=0,self=this,showSearchInput=true;this.findHighlightableChoices().each2(function(i,elm){if(equal(self.id(elm.data("select2-data")),self.opts.element.val())){selected=i;return false;}});if(noHighlightUpdate!==false){if(initial===true&&selected>=0){this.highlight(selected);}else{this.highlight(0);}} 5333if(initial===true){var min=this.opts.minimumResultsForSearch;if(min>=0){this.showSearch(countResults(data.results)>=min);}}},showSearch:function(showSearchInput){if(this.showSearchInput===showSearchInput)return;this.showSearchInput=showSearchInput;this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!showSearchInput);this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!showSearchInput);$(this.dropdown,this.container).toggleClass("select2-with-searchbox",showSearchInput);},onSelect:function(data,options){if(!this.triggerSelect(data)){return;} 5334var old=this.opts.element.val(),oldData=this.data();this.opts.element.val(this.id(data));this.updateSelection(data);this.opts.element.trigger({type:"select2-selected",val:this.id(data),choice:data});this.lastSearchTerm=this.search.val();this.close();if((!options||!options.noFocus)&&this.opts.shouldFocusInput(this)){this.focusser.focus();} 5335if(!equal(old,this.id(data))){this.triggerChange({added:data,removed:oldData}
5335);}},updateSelection:function(data){var container=this.selection.find(".select2-chosen"),formatted,cssClass;this.selection.data("select2-data",data);container.empty();if(data!==null){formatted=this.opts.formatSelection(data,container,this.opts.escapeMarkup);} 5336if(formatted!==undefined){container.append(formatted);} 5337cssClass=this.opts.formatSelectionCssClass(data,container);if(cssClass!==undefined){container.addClass(cssClass);} 5338this.selection.removeClass("select2-default");if(this.opts.allowClear&&this.getPlaceholder()!==undefined){this.container.addClass("select2-allowclear");}},val:function(){var val,triggerChange=false,data=null,self=this,oldData=this.data();if(arguments.length===0){return this.opts.element.val();} 5339val=arguments[0];if(arguments.length>1){triggerChange=arguments[1];if(this.opts.debug&&console&&console.warn){console.warn('Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. '+'The `change` event will always be triggered in 4.0.0.');}} 5340if(this.select){if(this.opts.debug&&console&&console.warn){console.warn('Select2: Setting the value on a <select> using `select2("val")` is no longer supported in 4.0.0. '+'You can use the `.val(newValue).trigger("change")` method provided by jQuery instead.');} 5341this.select.val(val).find("option").filter(function(){return this.selected}).each2(function(i,elm){data=self.optionToData(elm);return false;});this.updateSelection(data);this.setPlaceholder();if(triggerChange){this.triggerChange({added:data,removed:oldData});}}else{if(!val&&val!==0){this.clear(triggerChange);return;} 5342if(this.opts.initSelection===undefined){throw new Error("cannot call val() if initSelection() is not defined");} 5343this.opts.element.val(val);this.opts.initSelection(this.opts.element,function(data){self.opts.element.val(!data?"":self.id(data));self.updateSelection(data);self.setPlaceholder();if(triggerChange){self.triggerChange({added:data,removed:oldData});}});}},clearSearch:function(){this.search.val("");this.focusser.val("");},data:function(value){var data,triggerChange=false;if(arguments.length===0){data=this.selection.data("select2-data");if(data==undefined)data=null;return data;}else{if(this.opts.debug&&console&&console.warn){console.warn('Select2: The `select2("data")` method can no longer set selected values in 4.0.0, '+'consider using the `.val()` method instead.');} 5344if(arguments.length>1){triggerChange=arguments[1];} 5345if(!value){this.clear(triggerChange);}else{data=this.data();this.opts.element.val(!value?"":this.id(value));this.updateSelection(value);if(triggerChange){this.triggerChange({added:value,removed:data});}}}}});MultiSelect2=clazz(AbstractSelect2,{createContainer:function(){var container=$(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return container;},prepareOpts:function(){var opts=this.parent.prepareOpts.apply(this,arguments),self=this;if(opts.element.get(0).tagName.toLowerCase()==="select"){opts.initSelection=function(element,callback){var data=[];element.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(i,elm){data.push(self.optionToData(elm));});callback(data);};}else if("data"in opts){opts.initSelection=opts.initSelection||function(element,callback){var ids=splitVal(element.val(),opts.separator,opts.transformVal);var matches=[];opts.query({matcher:function(term,text,el){var is_match=$.grep(ids,function(id){return equal(id,opts.id(el));}).length;if(is_match){matches.push(el);} 5346return is_match;},callback:!$.isFunction(callback)?$.noop:function(){var ordered=[];for(var i=0;i<ids.length;i++){var id=ids[i];for(var j=0;j<matches.length;j++){var match=matches[j];if(equal(id,opts.id(match))){ordered.push(match);matches.splice(j,1);break;}}} 5347callback(ordered);}});};} 5348return opts;},selectChoice:function(choice){var selected=this.container.find(".select2-search-choice-focus");if(selected.length&&choice&&choice[0]==selected[0]){}else{if(selected.length){this.opts.element.trigger("choice-deselected",selected);} 5349selected.removeClass("select2-search-choice-focus");if(choice&&choice.length){this.close();choice.addClass("select2-search-choice-focus");this.opts.element.trigger("choice-selected",choice);}}},destroy:function(){$("label[for='"+this.search.attr('id')+"']").attr('for',this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments);cleanupJQueryElements.call(this,"searchContainer","selection");},initContainer:function(){var selector=".select2-choices",selection;this.searchContainer=this.container.find(".select2-search-field");this.selection=selection=this.container.find(selector);var _this=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(e){_this.search[0].focus();_this.selectChoice($(this));});this.search.attr("id","s2id_autogen"+nextUid());this.search.prev().text($("label[for='"+this.opts.element.attr("id")+"']").text()).attr('for',this.search.attr('id'));this.opts.element.on('focus.select2',this.bind(function(){this.focus();}));this.search.on("input paste",this.bind(function(){if(this.search.attr('placeholder')&&this.search.val().length==0)return;if(!this.isInterfaceEnabled())return;if(!this.opened()){this.open();}}));this.search.attr("tabindex",this.elementTabIndex);this.keydowns=0;this.search.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;++this.keydowns;var selected=selection.find(".select2-search-choice-focus");
5349var prev=selected.prev(".select2-search-choice:not(.select2-locked)");var next=selected.next(".select2-search-choice:not(.select2-locked)");var pos=getCursorInfo(this.search);if(selected.length&&(e.which==KEY.LEFT||e.which==KEY.RIGHT||e.which==KEY.BACKSPACE||e.which==KEY.DELETE||e.which==KEY.ENTER)){var selectedChoice=selected;if(e.which==KEY.LEFT&&prev.length){selectedChoice=prev;} 5350else if(e.which==KEY.RIGHT){selectedChoice=next.length?next:null;} 5351else if(e.which===KEY.BACKSPACE){if(this.unselect(selected.first())){this.search.width(10);selectedChoice=prev.length?prev:next;}}else if(e.which==KEY.DELETE){if(this.unselect(selected.first())){this.search.width(10);selectedChoice=next.length?next:null;}}else if(e.which==KEY.ENTER){selectedChoice=null;} 5352this.selectChoice(selectedChoice);killEvent(e);if(!selectedChoice||!selectedChoice.length){this.open();} 5353return;}else if(((e.which===KEY.BACKSPACE&&this.keydowns==1)||e.which==KEY.LEFT)&&(pos.offset==0&&!pos.length)){this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());killEvent(e);return;}else{this.selectChoice(null);} 5354if(this.opened()){switch(e.which){case KEY.UP:case KEY.DOWN:this.moveHighlight((e.which===KEY.UP)?-1:1);killEvent(e);return;case KEY.ENTER:this.selectHighlighted();killEvent(e);return;case KEY.TAB:this.selectHighlighted({noFocus:true});this.close();return;case KEY.ESC:this.cancel(e);killEvent(e);return;}} 5355if(e.which===KEY.TAB||KEY.isControl(e)||KEY.isFunctionKey(e)||e.which===KEY.BACKSPACE||e.which===KEY.ESC){return;} 5356if(e.which===KEY.ENTER){if(this.opts.openOnEnter===false){return;}else if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return;}} 5357this.open();if(e.which===KEY.PAGE_UP||e.which===KEY.PAGE_DOWN){killEvent(e);} 5358if(e.which===KEY.ENTER){killEvent(e);}}));this.search.on("keyup",this.bind(function(e){this.keydowns=0;this.resizeSearch();}));this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.selectChoice(null);if(!this.opened())this.clearSearch();e.stopImmediatePropagation();this.opts.element.trigger($.Event("select2-blur"));}));this.container.on("click",selector,this.bind(function(e){if(!this.isInterfaceEnabled())return;if($(e.target).closest(".select2-search-choice").length>0){return;} 5359this.selectChoice(null);this.clearPlaceholder();if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger($.Event("select2-focus"));} 5360this.open();this.focusSearch();e.preventDefault();}));this.container.on("focus",selector,this.bind(function(){if(!this.isInterfaceEnabled())return;if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger($.Event("select2-focus"));} 5361this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");this.clearPlaceholder();}));this.initContainerWidth();this.opts.element.hide();this.clearSearch();},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.search.prop("disabled",!this.isInterfaceEnabled());}},initSelection:function(){var data;if(this.opts.element.val()===""&&this.opts.element.text()===""){this.updateSelection([]);this.close();this.clearSearch();} 5362if(this.select||this.opts.element.val()!==""){var self=this;this.opts.initSelection.call(null,this.opts.element,function(data){if(data!==undefined&&data!==null){self.updateSelection(data);self.close();self.clearSearch();}});}},clearSearch:function(){var placeholder=this.getPlaceholder(),maxWidth=this.getMaxSearchWidth();if(placeholder!==undefined&&this.getVal().length===0&&this.search.hasClass("select2-focused")===false){this.search.val(placeholder).addClass("select2-default");this.search.width(maxWidth>0?maxWidth:this.container.css("width"));}else{this.search.val("").width(10);}},clearPlaceholder:function(){if(this.search.hasClass("select2-default")){this.search.val("").removeClass("select2-default");}},opening:function(){this.clearPlaceholder();this.resizeSearch();this.parent.opening.apply(this,arguments);this.focusSearch();this.prefillNextSearchTerm();this.updateResults(true);if(this.opts.shouldFocusInput(this)){this.search.focus();} 5363this.opts.element.trigger($.Event("select2-open"));},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments);},focus:function(){this.close();this.search.focus();},isFocused:function(){return this.search.hasClass("select2-focused");},updateSelection:function(data){var ids={},filtered=[],self=this;$(data).each(function(){if(!(self.id(this)in ids)){ids[self.id(this)]=0;filtered.push(this);}});this.selection.find(".select2-search-choice").remove();this.addSelectedChoice(filtered);self.postprocessResults();},tokenize:function(){var input=this.search.val();input=this.opts.tokenizer.call(this,input,this.data(),this.bind(this.onSelect),this.opts);if(input!=null&&input!=undefined){this.search.val(input);if(input.length>0){this.open();}}},onSelect:function(data,options){if(!this.triggerSelect(data)||data.text===""){return;} 5364this.addSelectedChoice(data);this.opts.element.trigger({type:"selected",val:this.id(data),choice:data});this.lastSearchTerm=this.search.val();this.clearSearch();this.updateResults();if(this.select||!this.opts.closeOnSelect)this.postprocessResults(data,false,this.opts.closeOnSelect===true);if(this.opts.closeOnSelect){this.close();this.search.width(10);}else{if(this.countSelectableResults()>0){this.search.width(10);this.resizeSearch();if(this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()){this.updateResults(true);}else{if(this.prefillNextSearchTerm()){this.updateResults();}} 5365this.positionDropdown();}else{this.close();this.search.width(10);}} 5366this.triggerChange({added:data});if(!options||!options.noFocus) 5367this.focusSearch();},cancel:function(){this.close();this.focusSearch();},addSelectedChoice:function(data){var val=this.getVal(),self=this;$(data).each(function(){val.push(self.createChoice(this));});this.setVal(val);},createChoice:function(data){var enableChoice=!data.locked,enabledItem=$("<li class='select2-search-choice'>"+" <div></div>"+" <a href='#' class='select2-search-choice-close' tabindex='-1'></a>"+"</li>"),disabledItem=$("<li class='select2-search-choice select2-locked'>"+"<div></div>"+"</li>");var choice=enableChoice?enabledItem:disabledItem,id=this.id(data),formatted,cssClass;formatted=this.opts.formatSelection(data,choice.find("div"),this.opts.escapeMarkup);if(formatted!=undefined){choice.find("div").replaceWith($("<div></div>").html(formatted));} 5368cssClass=this.opts.formatSelectionCssClass(data,choice.find("div"));if(cssClass!=undefined){choice.addClass(cssClass);} 5369if(enableChoice){choice.find(".select2-search-choice-close").on("mousedown",killEvent).on("click dblclick",this.bind(function(e){if(!this.isInterfaceEnabled())return;this.unselect($(e.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");killEvent(e);this.close();this.focusSearch();})).on("focus",this.bind(function(){if(!this.isInterfaceEnabled())return;this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");}));} 5370choice.data("select2-data",data);choice.insertBefore(this.searchContainer);return id;},unselect:function(selected){var val=this.getVal(),data,index;selected=selected.closest(".select2-search-choice");if(selected.length===0){throw"Invalid argument: "+selected+". Must be .select2-search-choice";} 5371data=selected.data("select2-data");if(!data){return;} 5372var evt=$.Event("select2-removing");evt.val=this.id(data);evt.choice=data;this.opts.element.trigger(evt);if(evt.isDefaultPrevented()){return false;} 5373while((index=indexOf(this.id(data),val))>=0){val.splice(index,1);this.setVal(val);if(this.select)this.postprocessResults();} 5374selected.remove();this.opts.element.trigger({type:"select2-removed",val:this.id(data),choice:data});this.triggerChange({removed:data});return true;},postprocessResults:function(data,initial,noHighlightUpdate){var val=this.getVal(),choices=this.results.find(".select2-result"),compound=this.results.find(".select2-result-with-children"),self=this;choices.each2(function(i,choice){var id=self.id(choice.data("select2-data"));if(indexOf(id,val)>=0){choice.addClass("select2-selected");choice.find(".select2-result-selectable").addClass("select2-selected");}});compound.each2(function(i,choice){if(!choice.is('.select2-result-selectable')&&choice.find(".select2-result-selectable:not(.select2-selected)").length===0){choice.addClass("select2-selected");}});if(this.highlight()==-1&&noHighlightUpdate!==false&&this.opts.closeOnSelect===true){self.highlight(0);}
5375if(!this.opts.createSearchChoice&&!choices.filter('.select2-result:not(.select2-selected)').length>0){if(!data||data&&!data.more&&this.results.find(".select2-no-results").length===0){if(checkFormatter(self.opts.formatNoMatches,"formatNoMatches")){this.results.append("<li class='select2-no-results'>"+evaluate(self.opts.formatNoMatches,self.opts.element,self.search.val())+"</li>");}}}},getMaxSearchWidth:function(){return this.selection.width()-getSideBorderPadding(this.search);},resizeSearch:function(){var minimumWidth,left,maxWidth,containerLeft,searchWidth,sideBorderPadding=getSideBorderPadding(this.search);minimumWidth=measureTextWidth(this.search)+10;left=this.search.offset().left;maxWidth=this.selection.width();containerLeft=this.selection.offset().left;searchWidth=maxWidth-(left-containerLeft)-sideBorderPadding;if(searchWidth<minimumWidth){searchWidth=maxWidth-sideBorderPadding;} 5376if(searchWidth<40){searchWidth=maxWidth-sideBorderPadding;} 5377if(searchWidth<=0){searchWidth=minimumWidth;} 5378this.search.width(Math.floor(searchWidth));},getVal:function(){var val;if(this.select){val=this.select.val();return val===null?[]:val;}else{val=this.opts.element.val();return splitVal(val,this.opts.separator,this.opts.transformVal);}},setVal:function(val){if(this.select){this.select.val(val);}else{var unique=[],valMap={};$(val).each(function(){if(!(this in valMap)){unique.push(this);valMap[this]=0;}});this.opts.element.val(unique.length===0?"":unique.join(this.opts.separator));}},buildChangeDetails:function(old,current){var current=current.slice(0),old=old.slice(0);for(var i=0;i<current.length;i++){for(var j=0;j<old.length;j++){if(equal(this.opts.id(current[i]),this.opts.id(old[j]))){current.splice(i,1);i--;old.splice(j,1);break;}}} 5379return{added:current,removed:old};},val:function(val,triggerChange){var oldData,self=this;if(arguments.length===0){return this.getVal();} 5380oldData=this.data();if(!oldData.length)oldData=[];if(!val&&val!==0){this.opts.element.val("");this.updateSelection([]);this.clearSearch();if(triggerChange){this.triggerChange({added:this.data(),removed:oldData});} 5381return;} 5382this.setVal(val);if(this.select){this.opts.initSelection(this.select,this.bind(this.updateSelection));if(triggerChange){this.triggerChange(this.buildChangeDetails(oldData,this.data()));}}else{if(this.opts.initSelection===undefined){throw new Error("val() cannot be called if initSelection() is not defined");} 5383this.opts.initSelection(this.opts.element,function(data){var ids=$.map(data,self.id);self.setVal(ids);self.updateSelection(data);self.clearSearch();if(triggerChange){self.triggerChange(self.buildChangeDetails(oldData,self.data()));}});} 5384this.clearSearch();},onSortStart:function(){if(this.select){throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");} 5385this.search.width(0);this.searchContainer.hide();},onSortEnd:function(){var val=[],self=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){val.push(self.opts.id($(this).data("select2-data")));});this.setVal(val);this.triggerChange();},data:function(values,triggerChange){var self=this,ids,old;if(arguments.length===0){return this.selection.children(".select2-search-choice").map(function(){return $(this).data("select2-data");}).get();}else{old=this.data();if(!values){values=[];} 5386ids=$.map(values,function(e){return self.opts.id(e);});this.setVal(ids);this.updateSelection(values);this.clearSearch();if(triggerChange){this.triggerChange(this.buildChangeDetails(old,this.data()));}}}});$.fn.select2=function(){var args=Array.prototype.slice.call(arguments,0),opts,select2,method,value,multiple,allowedMethods=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],valueMethods=["opened","isFocused","container","dropdown"],propertyMethods=["val","data"],methodsMap={search:"externalSearch"};this.each(function(){if(args.length===0||typeof(args[0])==="object"){opts=args.length===0?{}:$.extend({},args[0]);opts.element=$(this);if(opts.element.get(0).tagName.toLowerCase()==="select"){multiple=opts.element.prop("multiple");}else{multiple=opts.multiple||false;if("tags"in opts){opts.multiple=multiple=true;}} 5387select2=multiple?new window.Select2["class"].multi():new window.Select2["class"].single();select2.init(opts);}
5387else if(typeof(args[0])==="string"){if(indexOf(args[0],allowedMethods)<0){throw"Unknown method: "+args[0];} 5388value=undefined;select2=$(this).data("select2");if(select2===undefined)return;method=args[0];if(method==="container"){value=select2.container;}else if(method==="dropdown"){value=select2.dropdown;}else{if(methodsMap[method])method=methodsMap[method];value=select2[method].apply(select2,args.slice(1));} 5389if(indexOf(args[0],valueMethods)>=0||(indexOf(args[0],propertyMethods)>=0&&args.length==1)){return false;}}else{throw"Invalid arguments to select2 plugin: "+args;}});return(value===undefined)?this:value;};$.fn.select2.defaults={debug:false,width:"copy",loadMorePadding:0,closeOnSelect:true,openOnEnter:true,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(result,container,query,escapeMarkup){var markup=[];markMatch(this.text(result),query.term,markup,escapeMarkup);return markup.join("");},transformVal:function(val){return $.trim(val);},formatSelection:function(data,container,escapeMarkup){return data?escapeMarkup(this.text(data)):undefined;},sortResults:function(results,container,query){return results;},formatResultCssClass:function(data){return data.css;},formatSelectionCssClass:function(data,container){return undefined;},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==undefined?null:e.id;},text:function(e){if(e&&this.data&&this.data.text){if($.isFunction(this.data.text)){return this.data.text(e);}else{return e[this.data.text];}}else{return e.text;}},matcher:function(term,text){return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase())>=0;},separator:",",tokenSeparators:[],tokenizer:defaultTokenizer,escapeMarkup:defaultEscapeMarkup,blurOnChange:false,selectOnBlur:false,adaptContainerCssClass:function(c){return c;},adaptDropdownCssClass:function(c){return null;},nextSearchTerm:function(selectedObject,currentSearchTerm){return undefined;},searchInputPlaceholder:'',createSearchChoicePosition:'top',shouldFocusInput:function(instance){var supportsTouchEvents=(('ontouchstart'in window)||(navigator.msMaxTouchPoints>0));if(!supportsTouchEvents){return true;} 5390if(instance.opts.minimumResultsForSearch<0){return false;} 5391return true;}};$.fn.select2.locales=[];$.fn.select2.locales['en']={formatMatches:function(matches){if(matches===1){return"One result is available, press enter to select it.";}return matches+" results are available, use up and down arrow keys to navigate.";},formatNoMatches:function(){return"No matches found";},formatAjaxError:function(jqXHR,textStatus,errorThrown){return"Loading failed";},formatInputTooShort:function(input,min){var n=min-input.length;return"Please enter "+n+" or more character"+(n==1?"":"s");},formatInputTooLong:function(input,max){var n=input.length-max;return"Please delete "+n+" character"+(n==1?"":"s");},formatSelectionTooBig:function(limit){return"You can only select "+limit+" item"+(limit==1?"":"s");},formatLoadMore:function(pageNumber){return"Loading more resultsâ¦";},formatSearching:function(){return"Searchingâ¦";}};$.extend($.fn.select2.defaults,$.fn.select2.locales['en']);$.fn.select2.ajaxDefaults={transport:$.ajax,params:{type:"GET",cache:false,dataType:"json"}};window.Select2={query:{ajax:ajax,local:local,tags:tags},util:{debounce:debounce,markMatch:markMatch,escapeMarkup:defaultEscapeMarkup,stripDiacritics:stripDiacritics},"class":{"abstract":AbstractSelect2,"single":SingleSelect2,"multi":MultiSelect2}};}(jQuery));; 5392 5393/* /web/static/lib/clipboard/clipboard.js */ 5394(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==='object'&&typeof module==='object') 5395module.exports=factory();else if(typeof define==='function'&&define.amd) 5396define([],factory);else if(typeof exports==='object') 5397exports["ClipboardJS"]=factory();else 5398root["ClipboardJS"]=factory();})(this,function(){return(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports;} 5399var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports;} 5400__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.i=function(value){return value;};__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{configurable:false,enumerable:true,get:getter});}};__webpack_require__.n=function(module){var getter=module&&module.__esMo
5400dule?function getDefault(){return module['default'];}:function getModuleExports(){return module;};__webpack_require__.d(getter,'a',getter);return getter;};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property);};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=3);}) 5401([(function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(global,factory){if(true){!(__WEBPACK_AMD_DEFINE_ARRAY__=[module,__webpack_require__(7)],__WEBPACK_AMD_DEFINE_FACTORY__=(factory),__WEBPACK_AMD_DEFINE_RESULT__=(typeof __WEBPACK_AMD_DEFINE_FACTORY__==='function'?(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__)):__WEBPACK_AMD_DEFINE_FACTORY__),__WEBPACK_AMD_DEFINE_RESULT__!==undefined&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__));}else if(typeof exports!=="undefined"){factory(module,require('select'));}else{var mod={exports:{}};factory(mod,global.select);global.clipboardAction=mod.exports;}})(this,function(module,_select){'use strict';var _select2=_interopRequireDefault(_select);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};} 5402var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}} 5403var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}} 5404return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var ClipboardAction=function(){function ClipboardAction(options){_classCallCheck(this,ClipboardAction);this.resolveOptions(options);this.initSelection();} 5405_createClass(ClipboardAction,[{key:'resolveOptions',value:function resolveOptions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=options.action;this.container=options.container;this.emitter=options.emitter;this.target=options.target;this.text=options.text;this.trigger=options.trigger;this.selectedText='';}},{key:'initSelection',value:function initSelection(){if(this.text){this.selectFake();}else if(this.target){this.selectTarget();}}},{key:'selectFake',value:function selectFake(){var _this=this;var isRTL=document.documentElement.getAttribute('dir')=='rtl';this.removeFake();this.fakeHandlerCallback=function(){return _this.removeFake();};this.fakeHandler=this.container.addEventListener('click',this.fakeHandlerCallback)||true;this.fakeElem=document.createElement('textarea');this.fakeElem.style.fontSize='12pt';this.fakeElem.style.border='0';this.fakeElem.style.padding='0';this.fakeElem.style.margin='0';this.fakeElem.style.position='absolute';this.fakeElem.style[isRTL?'right':'left']='-9999px';var yPosition=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=yPosition+'px';this.fakeElem.setAttribute('readonly','');this.fakeElem.value=this.text;this.container.appendChild(this.fakeElem);this.selectedText=(0,_select2.default)(this.fakeElem);this.copyText();}},{key:'removeFake',value:function removeFake(){if(this.fakeHandler){this.container.removeEventListener('click',this.fakeHandlerCallback);this.fakeHandler=null;this.fakeHandlerCallback=null;} 5406if(this.fakeElem){this.container.removeChild(this.fakeElem);this.fakeElem=null;}}},{key:'selectTarget',value:function selectTarget(){this.selectedText=(0,_select2.default)(this.target);this.copyText();}},{key:'copyText',value:function copyText(){var succeeded=void 0;try{succeeded=document.execCommand(this.action);}catch(err){succeeded=false;} 5407this.handleResult(succeeded);}},{key:'handleResult',value:function handleResult(succeeded){this.emitter.emit(succeeded?'success':'error',{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)});}},{key:'clearSelection',value:function clearSelection(){if(this.trigger){this.trigger.focus();} 5408window.getSelection().removeAllRanges();}},{key:'destroy',value:function destroy(){this.removeFake();}},{key:'action',set:function set(){var action=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'copy';this._action=action;if(this._action!=='copy'&&this._action!=='cut'){throw new Error('Invalid "action" value, use either "copy" or "cut"');}},get:function get(){return this._action;}},{key:'target',set:function set(target){if(target!==undefined){if(target&&(typeof target==='undefined'?'undefined':_typeof(target))==='object'&&target.nodeType===1){if(this.action==='copy'&&target.hasAttribute('disabled')){throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');} 5409if(this.action==='cut'&&(target.hasAttribute('readonly')||target.hasAttribute('disabled'))){throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');} 5410this._target=target;}else{throw new Error('Invalid "target" value, use a valid Element');}}},get:function get(){return this._target;}}]);return ClipboardAction;}();module.exports=ClipboardAction;});}),(function(module,exports,__webpack_require__){var is=__webpack_require__(6);var delegate=__webpack_require__(5);function listen(target,type,callback){if(!target&&!type&&!callback){throw new Error('Missing required arguments');} 5411if(!is.string(type)){throw new TypeError('Second argument must be a String');} 5412if(!is.fn(callback)){throw new TypeError('Third argument must be a Function');} 5413if(is.node(target)){return listenNode(target,type,callback);} 5414else if(is.nodeList(target)){return listenNodeList(target,type,callback);} 5415else if(is.string(target)){return listenSelector(target,type,callback);} 5416else{throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');}} 5417function listenNode(node,type,callback){node.addEventListener(type,callback);return{destroy:function(){node.removeEventListener(type,callback);}}} 5418function listenNodeList(nodeList,type,callback){Array.prototype.forEach.call(nodeList,function(node){node.addEventListener(type,callback);});return{destroy:function(){Array.prototype.forEach.call(nodeList,function(node){node.removeEventListener(type,callback);});}}} 5419function listenSelector(selector,type,callback){return delegate(document.body,selector,type,callback);} 5420module.exports=listen;}),(function(module,exports){function E(){} 5421E.prototype={on:function(name,callback,ctx){var e=this.e||(this.e={});(e[name]||(e[name]=[])).push({fn:callback,ctx:ctx});return this;},once:function(name,callback,ctx){var self=this;function listener(){self.off(name,listener);callback.apply(ctx,arguments);};listener._=callback 5422return this.on(name,listener,ctx);}
5422,emit:function(name){var data=[].slice.call(arguments,1);var evtArr=((this.e||(this.e={}))[name]||[]).slice();var i=0;var len=evtArr.length;for(i;i<len;i++){evtArr[i].fn.apply(evtArr[i].ctx,data);} 5423return this;},off:function(name,callback){var e=this.e||(this.e={});var evts=e[name];var liveEvents=[];if(evts&&callback){for(var i=0,len=evts.length;i<len;i++){if(evts[i].fn!==callback&&evts[i].fn._!==callback) 5424liveEvents.push(evts[i]);}} 5425(liveEvents.length)?e[name]=liveEvents:delete e[name];return this;}};module.exports=E;}),(function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(global,factory){if(true){!(__WEBPACK_AMD_DEFINE_ARRAY__=[module,__webpack_require__(0),__webpack_require__(2),__webpack_require__(1)],__WEBPACK_AMD_DEFINE_FACTORY__=(factory),__WEBPACK_AMD_DEFINE_RESULT__=(typeof __WEBPACK_AMD_DEFINE_FACTORY__==='function'?(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__)):__WEBPACK_AMD_DEFINE_FACTORY__),__WEBPACK_AMD_DEFINE_RESULT__!==undefined&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__));}else if(typeof exports!=="undefined"){factory(module,require('./clipboard-action'),require('tiny-emitter'),require('good-listener'));}else{var mod={exports:{}};factory(mod,global.clipboardAction,global.tinyEmitter,global.goodListener);global.clipboard=mod.exports;}})(this,function(module,_clipboardAction,_tinyEmitter,_goodListener){'use strict';var _clipboardAction2=_interopRequireDefault(_clipboardAction);var _tinyEmitter2=_interopRequireDefault(_tinyEmitter);var _goodListener2=_interopRequireDefault(_goodListener);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};} 5426var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}} 5427var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}} 5428return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");} 5429return call&&(typeof call==="object"||typeof call==="function")?call:self;} 5430function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);} 5431subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;} 5432var Clipboard=function(_Emitter){_inherits(Clipboard,_Emitter);function Clipboard(trigger,options){_classCallCheck(this,Clipboard);var _this=_possibleConstructorReturn(this,(Clipboard.__proto__||Object.getPrototypeOf(Clipboard)).call(this));_this.resolveOptions(options);_this.listenClick(trigger);return _this;} 5433_createClass(Clipboard,[{key:'resolveOptions',value:function resolveOptions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof options.action==='function'?options.action:this.defaultAction;this.target=typeof options.target==='function'?options.target:this.defaultTarget;this.text=typeof options.text==='function'?options.text:this.defaultText;this.container=_typeof(options.container)==='object'?options.container:document.body;}},{key:'listenClick',value:function listenClick(trigger){var _this2=this;this.listener=(0,_goodListener2.default)(trigger,'click',function(e){return _this2.onClick(e);});}},{key:'onClick',value:function onClick(e){var trigger=e.delegateTarget||e.currentTarget;if(this.clipboardAction){this.clipboardAction=null;} 5434this.clipboardAction=new _clipboardAction2.default({action:this.action(trigger),target:this.target(trigger),text:this.text(trigger),container:this.container,trigger:trigger,emitter:this});}},{key:'defaultAction',value:function defaultAction(trigger){return getAttributeValue('action',trigger);}},{key:'defaultTarget',value:function defaultTarget(trigger){var selector=getAttributeValue('target',trigger);if(selector){return document.querySelector(selector);}}},{key:'defaultText',value:function defaultText(trigger){return getAttributeValue('text',trigger);}},{key:'destroy',value:function destroy(){this.listener.destroy();if(this.clipboardAction){this.clipboardAction.destroy();this.clipboardAction=null;}}}],[{key:'isSupported',value:function isSupported(){var action=arguments.length>0&&arguments[0]!==undefined?arguments[0]:['copy','cut'];var actions=typeof action==='string'?[action]:action;var support=!!document.queryCommandSupported;actions.forEach(function(action){support=support&&!!document.queryCommandSupported(action);});return support;}}]);return Clipboard;}(_tinyEmitter2.default);function getAttributeValue(suffix,element){var attribute='data-clipboard-'+suffix;if(!element.hasAttribute(attribute)){return;} 5435return element.getAttribute(attribute);} 5436module.exports=Clipboard;});}),(function(module,exports){var DOCUMENT_NODE_TYPE=9;if(typeof Element!=='undefined'&&!Element.prototype.matches){var proto=Element.prototype;proto.matches=proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector;} 5437function closest(element,selector){while(element&&element.nodeType!==DOCUMENT_NODE_TYPE){if(typeof element.matches==='function'&&element.matches(selector)){return element;} 5438element=element.parentNode;}} 5439module.exports=closest;}),(function(module,exports,__webpack_require__){var closest=__webpack_require__(4);function _delegate(element,selector,type,callback,useCapture){var listenerFn=listener.apply(this,arguments);element.addEventListener(type,listenerFn,useCapture);return{destroy:function(){element.removeEventListener(type,listenerFn,useCapture);}}} 5440function delegate(elements,selector,type,callback,useCapture){if(typeof elements.addEventListener==='function'){return _delegate.apply(null,arguments);} 5441if(typeof type==='function'){return _delegate.bind(null,document).apply(null,arguments);} 5442if(typeof elements==='string'){elements=document.querySelectorAll(elements);} 5443return Array.prototype.map.call(elements,function(element){return _delegate(element,selector,type,callback,useCapture);});} 5444function listener(element,selector,type,callback){return function(e){e.delegateTarget=closest(e.target,selector);if(e.delegateTarget){callback.call(element,e);}}} 5445module.exports=delegate;}),(function(module,exports){exports.node=function(value){return value!==undefined&&value instanceof HTMLElement&&value.nodeType===1;};exports.nodeList=function(value){var type=Object.prototype.toString.call(value);return value!==undefined&&(type==='[object NodeList]'||type==='[object HTMLCollection]')&&('length'in value)&&(value.length===0||exports.node(value[0]));};exports.string=function(value){return typeof value==='string'||value instanceof String;};exports.fn=function(value){var type=Object.prototype.toString.call(value);return type==='[object Function]';};}),(function(module,exports){function select(element){var selectedText;if(element.nodeName==='SELECT'){element.focus();selectedText=element.value;} 5446else if(element.nodeName==='INPUT'||element.nodeName==='TEXTAREA'){var isReadOnly=element.hasAttribute('readonly');if(!isReadOnly){element.setAttribute('readonly','');} 5447element.select();element.setSelectionRange(0,element.value.length);if(!isReadOnly){element.removeAttribute('readonly');} 5448selectedText=element.value;} 5449else{if(element.hasAttribute('contenteditable')){element.focus();} 5450var selection=window.getSelection();var range=document.createRange();range.selectNodeContents(element);selection.removeAllRanges();selection.addRange(range);selectedText=selection.toString();} 5451return selectedText;} 5452module.exports=select;})]);});; 5453 5454/* /web/static/lib/jSignature/jSignatureCustom.js */ 5455;(function(){var apinamespace='jSignature' 5456var KickTimerClass=function(time,callback){var timer;this.kick=function(){clearTimeout(timer);timer=setTimeout(callback,time);} 5457this.clear=function(){clearTimeout(timer);} 5458return this;} 5459var PubSubClass=function(context){'use strict' 5460this.topics={};this.context=context?context:this;this.publish=function(topic,arg1,arg2,etc){'use strict' 5461if(this.topics[topic]){var currentTopic=this.topics[topic],args=Array.prototype.slice.call(arguments,1
5461),toremove=[],torun=[],fn,i,l,pair;for(i=0,l=currentTopic.length;i<l;i++){pair=currentTopic[i];fn=pair[0];if(pair[1]){pair[0]=function(){};toremove.push(i);} 5462torun.push(fn);} 5463for(i=0,l=toremove.length;i<l;i++){currentTopic.splice(toremove[i],1);} 5464for(i=0,l=torun.length;i<l;i++){torun[i].apply(this.context,args);}}} 5465this.subscribe=function(topic,callback,once){'use strict' 5466if(!this.topics[topic]){this.topics[topic]=[[callback,once]];}else{this.topics[topic].push([callback,once]);} 5467return{"topic":topic,"callback":callback};};this.unsubscribe=function(token){if(this.topics[token.topic]){var currentTopic=this.topics[token.topic];for(var i=0,l=currentTopic.length;i<l;i++){if(currentTopic[i]&¤tTopic[i][0]===token.callback){currentTopic.splice(i,1);}}}}} 5468function getColors($e){var tmp,undef,frontcolor=$e.css('color'),backcolor,e=$e[0];var toOfDOM=false;while(e&&!backcolor&&!toOfDOM){try{tmp=$(e).css('background-color');}catch(ex){tmp='transparent';} 5469if(tmp!=='transparent'&&tmp!=='rgba(0, 0, 0, 0)'){backcolor=tmp;} 5470toOfDOM=e.body;e=e.parentNode;} 5471var rgbaregex=/rgb[a]*\((\d+),\s*(\d+),\s*(\d+)/,hexregex=/#([AaBbCcDdEeFf\d]{2})([AaBbCcDdEeFf\d]{2})([AaBbCcDdEeFf\d]{2})/,frontcolorcomponents;tmp=undef;tmp=frontcolor.match(rgbaregex);if(tmp){frontcolorcomponents={'r':parseInt(tmp[1],10),'g':parseInt(tmp[2],10),'b':parseInt(tmp[3],10)};}else{tmp=frontcolor.match(hexregex);if(tmp){frontcolorcomponents={'r':parseInt(tmp[1],16),'g':parseInt(tmp[2],16),'b':parseInt(tmp[3],16)};}} 5472var backcolorcomponents 5473if(!backcolor){if(frontcolorcomponents){if(Math.max.apply(null,[frontcolorcomponents.r,frontcolorcomponents.g,frontcolorcomponents.b])>127){backcolorcomponents={'r':0,'g':0,'b':0};}else{backcolorcomponents={'r':255,'g':255,'b':255};}}else{backcolorcomponents={'r':255,'g':255,'b':255};}}else{tmp=undef;tmp=backcolor.match(rgbaregex);if(tmp){backcolorcomponents={'r':parseInt(tmp[1],10),'g':parseInt(tmp[2],10),'b':parseInt(tmp[3],10)};}else{tmp=backcolor.match(hexregex);if(tmp){backcolorcomponents={'r':parseInt(tmp[1],16),'g':parseInt(tmp[2],16),'b':parseInt(tmp[3],16)};}}} 5474var toRGBfn=function(o){return'rgb('+[o.r,o.g,o.b].join(', ')+')'},decorcolorcomponents,frontcolorbrightness,adjusted;if(frontcolorcomponents&&backcolorcomponents){var backcolorbrightness=Math.max.apply(null,[frontcolorcomponents.r,frontcolorcomponents.g,frontcolorcomponents.b]);frontcolorbrightness=Math.max.apply(null,[backcolorcomponents.r,backcolorcomponents.g,backcolorcomponents.b]);
5474adjusted=Math.round(frontcolorbrightness+(-1*(frontcolorbrightness-backcolorbrightness)*0.75));decorcolorcomponents={'r':adjusted,'g':adjusted,'b':adjusted};}else if(frontcolorcomponents){frontcolorbrightness=Math.max.apply(null,[frontcolorcomponents.r,frontcolorcomponents.g,frontcolorcomponents.b]);var polarity=+1;if(frontcolorbrightness>127){polarity=-1;} 5475adjusted=Math.round(frontcolorbrightness+(polarity*96));decorcolorcomponents={'r':adjusted,'g':adjusted,'b':adjusted};}else{decorcolorcomponents={'r':191,'g':191,'b':191};} 5476return{'color':frontcolor,'background-color':backcolorcomponents?toRGBfn(backcolorcomponents):backcolor,'decor-color':toRGBfn(decorcolorcomponents)};} 5477function Vector(x,y){this.x=x;this.y=y;this.reverse=function(){return new this.constructor(this.x*-1,this.y*-1);};this._length=null;this.getLength=function(){if(!this._length){this._length=Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));} 5478return this._length;};var polarity=function(e){return Math.round(e/Math.abs(e));};this.resizeTo=function(length){if(this.x===0&&this.y===0){this._length=0;}else if(this.x===0){this._length=length;this.y=length*polarity(this.y);}else if(this.y===0){this._length=length;this.x=length*polarity(this.x);}else{var proportion=Math.abs(this.y/this.x),x=Math.sqrt(Math.pow(length,2)/(1+Math.pow(proportion,2))),y=proportion*x;this._length=length;this.x=x*polarity(this.x);this.y=y*polarity(this.y);} 5479return this;};this.angleTo=function(vectorB){var divisor=this.getLength()*vectorB.getLength();if(divisor===0){return 0;}else{return Math.acos(Math.min(Math.max((this.x*vectorB.x+this.y*vectorB.y)/divisor,-1.0),1.0))/Math.PI;}};} 5480function Point(x,y){this.x=x;this.y=y;this.getVectorToCoordinates=function(x,y){return new Vector(x-this.x,y-this.y);};this.getVectorFromCoordinates=function(x,y){return this.getVectorToCoordinates(x,y).reverse();};this.getVectorToPoint=function(point){return new Vector(point.x-this.x,point.y-this.y);};this.getVectorFromPoint=function(point){return this.getVectorToPoint(point).reverse();};} 5481function DataEngine(storageObject,context,startStrokeFn,addToStrokeFn,endStrokeFn){this.data=storageObject;this.context=context;if(storageObject.length){var numofstrokes=storageObject.length,stroke,numofpoints;for(var i=0;i<numofstrokes;i++){stroke=storageObject[i];numofpoints=stroke.x.length;startStrokeFn.call(context,stroke);for(var j=1;j<numofpoints;j++){addToStrokeFn.call(context,stroke,j);} 5482endStrokeFn.call(context,stroke);}} 5483this.changed=function(){};this.startStrokeFn=startStrokeFn;this.addToStrokeFn=addToStrokeFn;this.endStrokeFn=endStrokeFn;this.inStroke=false;this._lastPoint=null;this._stroke=null;this.startStroke=function(point){if(point&&typeof(point.x)=="number"&&typeof(point.y)=="number"){this._stroke={'x':[point.x],'y':[point.y]};this.data.push(this._stroke);this._lastPoint=point;this.inStroke=true;var stroke=this._stroke,fn=this.startStrokeFn,context=this.context;setTimeout(function(){fn.call(context,stroke)},3);return point;}else{return null;}};this.addToStroke=function(point){if(this.inStroke&&typeof(point.x)==="number"&&typeof(point.y)==="number"&&(Math.abs(point.x-this._lastPoint.x)+Math.abs(point.y-this._lastPoint.y))>4){var positionInStroke=this._stroke.x.length;this._stroke.x.push(point.x);this._stroke.y.push(point.y);this._lastPoint=point;var stroke=this._stroke,fn=this.addToStrokeFn,context=this.context;setTimeout(function(){fn.call(context,stroke,positionInStroke)},3);return point;}else{return null;}};this.endStroke=function(){var c=this.inStroke;this.inStroke=false;this._lastPoint=null;if(c){var stroke=this._stroke,fn=this.endStrokeFn,context=this.context,changedfn=this.changed;setTimeout(function(){fn.call(context,stroke);changedfn.call(context);},3);return true;}else{return null;}};} 5484var basicDot=function(ctx,x,y,size){var fillStyle=ctx.fillStyle;ctx.fillStyle=ctx.strokeStyle;ctx.fillRect(x+size/-2,y+size/-2,size,size);ctx.fillStyle=fillStyle;},basicLine=function(ctx,startx,starty,endx,endy){ctx.beginPath();ctx.moveTo(startx,starty);ctx.lineTo(endx,endy);ctx.closePath();ctx.stroke();},basicCurve=function(ctx,startx,starty,endx,endy,cp1x,cp1y,cp2x,cp2y){ctx.beginPath();ctx.moveTo(startx,starty);ctx.bezierCurveTo(cp1x,cp1y,cp2x,cp2y,endx,endy);ctx.closePath();ctx.stroke();},strokeStartCallback=function(stroke){basicDot(this.canvasContext,stroke.x[0],stroke.y[0],this.settings.lineWidth);}
5484,strokeAddCallback=function(stroke,positionInStroke){var Cpoint=new Point(stroke.x[positionInStroke-1],stroke.y[positionInStroke-1]),Dpoint=new Point(stroke.x[positionInStroke],stroke.y[positionInStroke]),CDvector=Cpoint.getVectorToPoint(Dpoint);if(positionInStroke>1){var Bpoint=new Point(stroke.x[positionInStroke-2],stroke.y[positionInStroke-2]),BCvector=Bpoint.getVectorToPoint(Cpoint),ABvector;if(BCvector.getLength()>this.lineCurveThreshold){if(positionInStroke>2){ABvector=(new Point(stroke.x[positionInStroke-3],stroke.y[positionInStroke-3])).getVectorToPoint(Bpoint);}else{ABvector=new Vector(0,0);} 5485var minlenfraction=0.05,maxlen=BCvector.getLength()*0.35,ABCangle=BCvector.angleTo(ABvector.reverse()),BCDangle=CDvector.angleTo(BCvector.reverse()),BCP1vector=new Vector(ABvector.x+BCvector.x,ABvector.y+BCvector.y).resizeTo(Math.max(minlenfraction,ABCangle)*maxlen),CCP2vector=(new Vector(BCvector.x+CDvector.x,BCvector.y+CDvector.y)).reverse().resizeTo(Math.max(minlenfraction,BCDangle)*maxlen);basicCurve(this.canvasContext,Bpoint.x,Bpoint.y,Cpoint.x,Cpoint.y,Bpoint.x+BCP1vector.x,Bpoint.y+BCP1vector.y,Cpoint.x+CCP2vector.x,Cpoint.y+CCP2vector.y);}} 5486if(CDvector.getLength()<=this.lineCurveThreshold){basicLine(this.canvasContext,Cpoint.x,Cpoint.y,Dpoint.x,Dpoint.y);}},strokeEndCallback=function(stroke){var positionInStroke=stroke.x.length-1;if(positionInStroke>0){var Cpoint=new Point(stroke.x[positionInStroke],stroke.y[positionInStroke]),Bpoint=new Point(stroke.x[positionInStroke-1],stroke.y[positionInStroke-1]),BCvector=Bpoint.getVectorToPoint(Cpoint),ABvector;if(BCvector.getLength()>this.lineCurveThreshold){if(positionInStroke>1){ABvector=(new Point(stroke.x[positionInStroke-2],stroke.y[positionInStroke-2])).getVectorToPoint(Bpoint);var BCP1vector=new Vector(ABvector.x+BCvector.x,ABvector.y+BCvector.y).resizeTo(BCvector.getLength()/2);basicCurve(this.canvasContext,Bpoint.x,Bpoint.y,Cpoint.x,Cpoint.y,Bpoint.x+BCP1vector.x,Bpoint.y+BCP1vector.y,Cpoint.x,Cpoint.y);}else{basicLine(this.canvasContext,Bpoint.x,Bpoint.y,Cpoint.x,Cpoint.y);}}}} 5487function conditionallyLinkCanvasResizeToWindowResize(jSignatureInstance,settingsWidth,apinamespace,globalEvents){'use strict' 5488if(settingsWidth==='ratio'||settingsWidth.split('')[settingsWidth.length-1]==='%'){this.eventTokens[apinamespace+'.parentresized']=globalEvents.subscribe(apinamespace+'.parentresized',(function(eventTokens,$parent,originalParentWidth,sizeRatio){'use strict' 5489return function(){'use strict' 5490var w=$parent.width();if(w!==originalParentWidth){for(var key in eventTokens){if(eventTokens.hasOwnProperty(key)){globalEvents.unsubscribe(eventTokens[key]);delete eventTokens[key];}} 5491var settings=jSignatureInstance.settings;jSignatureInstance.$parent.children().remove();for(var key in jSignatureInstance){if(jSignatureInstance.hasOwnProperty(key)){delete jSignatureInstance[key];}} 5492settings.data=(function(data,scale){var newData=[];var o,i,l,j,m,stroke;for(i=0,l=data.length;i<l;i++){stroke=data[i];o={'x':[],'y':[]};for(j=0,m=stroke.x.length;j<m;j++){o.x.push(stroke.x[j]*scale);o.y.push(stroke.y[j]*scale);} 5493newData.push(o);} 5494return newData;})(settings.data,w*1.0/originalParentWidth) 5495$parent[apinamespace](settings);}}})(this.eventTokens,this.$parent,this.$parent.width(),this.canvas.width*1.0/this.canvas.height))}};function jSignatureClass(parent,options,instanceExtensions){var $parent=this.$parent=$(parent),eventTokens=this.eventTokens={},events=this.events=new PubSubClass(this),globalEvents=$.fn[apinamespace]('globalEvents'),settings={'width':'ratio','height':'ratio','sizeRatio':4,'color':'#000','background-color':'#fff','decor-color':'#eee','show-stroke':true,'lineWidth':0,'minFatFingerCompensation':-10,'showUndoButton':false,'readOnly':false,'data':[]};$.extend(settings,getColors($parent));if(options){$.extend(settings,options);} 5496this.settings=settings;for(var extensionName in instanceExtensions){if(instanceExtensions.hasOwnProperty(extensionName)){instanceExtensions[extensionName].call(this,extensionName);}} 5497this.events.publish(apinamespace+'.initializing');this.$controlbarUpper=(function(){var controlbarstyle='padding:0 !important; margin:0 !important;'+'width: 100% !important; height: 0 !important; -ms-touch-action: none; touch-action: none;'+'margin-top:-1em !important; margin-bottom:1em !important;';return $('<div style="'+controlbarstyle+'"></div>').appendTo($parent);})();this.isCanvasEmulator=false;var canvas=this.canvas=this.initializeCanvas(settings),$canvas=$(canvas);this.$controlbarLower=(function(){var controlbarstyle='padding:0 !important; margin:0 !important;'+'width: 100% !important; height: 0 !important; -ms-touch-action: none; touch-action: none;'+'margin-top:-1.5em !important; margin-bottom:1.5em !important; position: relative;';return $('<div style="'+controlbarstyle+'"></div>').appendTo($parent);})();this.canvasContext=canvas.getContext("2d");$canvas.data(apinamespace+'.this',this);settings.lineWidth=(function(defaultLineWidth,canvasWidth){if(!defaultLineWidth){return Math.max(Math.round(canvasWidth/400),2);}else{return defaultLineWidth;}})(settings.lineWidth,canvas.width);this.lineCurveThreshold=settings.lineWidth*3;if(settings.cssclass&&$.trim(settings.cssclass)!=""){$canvas.addClass(settings.cssclass);} 5498this.fatFingerCompensation=0;var movementHandlers=(function(jSignatureInstance){var shiftX,shiftY,setStartValues=function(){var tos=$(jSignatureInstance.canvas).offset() 5499shiftX=tos.left*-1 5500shiftY=tos.top*-1},getPointFromEvent=function(e){var firstEvent=(e.changedTouches&&e.changedTouches.length>0?e.changedTouches[0]:e);return new Point(Math.round(firstEvent.pageX+shiftX),Math.round(firstEvent.pageY+shiftY)+jSignatureInstance.fatFingerCompensation);},timer=new KickTimerClass(750,function(){jSignatureInstance.dataEngine.endStroke();});this.drawEndHandler=function(e){if(!jSignatureInstance.settings.readOnly){try{e.preventDefault();}catch(ex){} 5501timer.clear();jSignatureInstance.dataEngine.endStroke();}};this.drawStartHandler=function(e){if(!jSignatureInstance.settings.readOnly){e.preventDefault();setStartValues();jSignatureInstance.dataEngine.startStroke(getPointFromEvent(e));timer.kick();}};this.drawMoveHandler=function(e){if(!jSignatureInstance.settings.readOnly){e.preventDefault();if(!jSignatureInstance.dataEngine.inStroke){return;} 5502jSignatureInstance.dataEngine.addToStroke(getPointFromEvent(e));timer.kick();}};return this;}).call({},this);(function(drawEndHandler,drawStartHandler,drawMoveHandler){var canvas=this.canvas,$canvas=$(canvas),undef;if(this.isCanvasEmulator){$canvas.bind('mousemove.'+apinamespace,drawMoveHandler);$canvas.bind('mouseup.'+apinamespace,drawEndHandler);$canvas.bind('mousedown.'+apinamespace,drawStartHandler);}else{canvas.addEventListener('touchstart',function(e){canvas.onmousedown=canvas.onmouseup=canvas.onmousemove=undef;this.fatFingerCompensation=(settings.minFatFingerCompensation&&settings.lineWidth*-3>settings.minFatFingerCompensation)?settings.lineWidth*-3:settings.minFatFingerCompensation;drawStartHandler(e);canvas.addEventListener('touchend',drawEndHandler);canvas.addEventListener('touchstart',drawStartHandler);canvas.addEventListener('touchmove',drawMoveHandler);});canvas.addEventListener('mousedown',function(e){canvas.ontouchstart=canvas.ontouchend=canvas.ontouchmove=undef;drawStartHandler(e);canvas.addEventListener('mousedown',drawStartHandler);canvas.addEventListener('mouseup',drawEndHandler);canvas.addEventListener('mousemove',drawMoveHandler);});if(window.navigator.msPointerEnabled){canvas.onmspointerdown=drawStartHandler;canvas.onmspointerup=drawEndHandler;canvas.onmspointermove=drawMoveHandler;}}}).call(this,movementHandlers.drawEndHandler,movementHandlers.drawStartHandler,movementHandlers.drawMoveHandler) 5503eventTokens[apinamespace+'.windowmouseup']=globalEvents.subscribe(apinamespace+'.windowmouseup',movementHandlers.drawEndHandler);this.events.publish(apinamespace+'.attachingEventHandlers');conditionallyLinkCanvasResizeToWindowResize.call(this,this,settings.width.toString(10),apinamespace,globalEvents);this.resetCanvas(settings.data);this.events.publish(apinamespace+'.initialized');return this;} 5504jSignatureClass.prototype.resetCanvas=function(data,dontClear){var canvas=this.canvas,settings=this.settings,ctx=this.canvasContext,isCanvasEmulator=this.isCanvasEmulator,cw=canvas.width,ch=canvas.height;if(!dontClear){ctx.clearRect(0,0,cw+30,ch+30);} 5505ctx.shadowColor=ctx.fillStyle=settings['background-color'] 5506if(isCanvasEmulator){ctx.fillRect(0,0,cw+30,ch+30);} 5507ctx.lineWidth=Math.ceil(parseInt(settings.lineWidth,10));ctx.lineCap=ctx.lineJoin="round";if(null!=settings['decor-color']&&settings['show-stroke']){ctx.strokeStyle=settings['decor-color'];ctx.shadowOffsetX=0;ctx.shadowOffsetY=0;var lineoffset=Math.round(ch/5);basicLine(ctx,lineoffset*1.5,ch-lineoffset,cw-(lineoffset*1.5),ch-lineoffset);} 5508ctx.strokeStyle=settings.color;if(!isCanvasEmulator){ctx.shadowColor=ctx.strokeStyle;ctx.shadowOffsetX=ctx.lineWidth*0.5;ctx.shadowOffsetY=ctx.lineWidth*-0.6;ctx.shadowBlur=0;} 5509if(!data){data=[];} 5510var dataEngine=this.dataEngine=new DataEngine(data,this,strokeStartCallback,strokeAddCallback,strokeEndCallback);settings.data=data;$(canvas).data(apinamespace+'.data',data).data(apinamespace+'.settings',settings);dataEngine.changed=(function(target,events,apinamespace){'use strict' 5511return function(){events.publish(apinamespace+'.change');target.trigger('change');}})(this.$parent,this.events,apinamespace);dataEngine.changed();return true;};function initializeCanvasEmulator(canvas){if(canvas.getContext){return false;}else{var window=canvas.ownerDocument.parentWindow;
5511var FC=window.FlashCanvas?canvas.ownerDocument.parentWindow.FlashCanvas:(typeof FlashCanvas==="undefined"?undefined:FlashCanvas);if(FC){canvas=FC.initElement(canvas);var zoom=1;if(window&&window.screen&&window.screen.deviceXDPI&&window.screen.logicalXDPI){zoom=window.screen.deviceXDPI*1.0/window.screen.logicalXDPI;} 5512if(zoom!==1){try{$(canvas).children('object').get(0).resize(Math.ceil(canvas.width*zoom),Math.ceil(canvas.height*zoom));canvas.getContext('2d').scale(zoom,zoom);}catch(ex){}} 5513return true;}else{throw new Error("Canvas element does not support 2d context. jSignature cannot proceed.");}}} 5514jSignatureClass.prototype.initializeCanvas=function(settings){var canvas=document.createElement('canvas'),$canvas=$(canvas);if(settings.width===settings.height&&settings.height==='ratio'){settings.width='100%';} 5515$canvas.css({'margin':0,'padding':0,'border':'none','height':settings.height==='ratio'||!settings.height?1:settings.height.toString(10),'width':settings.width==='ratio'||!settings.width?1:settings.width.toString(10),'-ms-touch-action':'none','touch-action':'none','background-color':settings['background-color'],});$canvas.appendTo(this.$parent);if(settings.height==='ratio'){$canvas.css('height',Math.round($canvas.width()/settings.sizeRatio));}else if(settings.width==='ratio'){$canvas.css('width',Math.round($canvas.height()*settings.sizeRatio));} 5516$canvas.addClass(apinamespace);canvas.width=$canvas.width();canvas.height=$canvas.height();this.isCanvasEmulator=initializeCanvasEmulator(canvas);canvas.onselectstart=function(e){if(e&&e.preventDefault){e.preventDefault()};if(e&&e.stopPropagation){e.stopPropagation()};return false;};return canvas;} 5517var GlobalJSignatureObjectInitializer=function(window){var globalEvents=new PubSubClass();;(function(globalEvents,apinamespace,$,window){'use strict' 5518var resizetimer,runner=function(){globalEvents.publish(apinamespace+'.parentresized')};$(window).bind('resize.'+apinamespace,function(){if(resizetimer){clearTimeout(resizetimer);} 5519resizetimer=setTimeout(runner,500);}).bind('mouseup.'+apinamespace,function(e){globalEvents.publish(apinamespace+'.windowmouseup')});})(globalEvents,apinamespace,$,window) 5520var jSignatureInstanceExtensions={};var exportplugins={'default':function(data){return this.toDataURL()},'native':function(data){return data},'image':function(data){var imagestring=this.toDataURL();if(typeof imagestring==='string'&&imagestring.length>4&&imagestring.slice(0,5)==='data:'&&imagestring.indexOf(',')!==-1){var splitterpos=imagestring.indexOf(',');return[imagestring.slice(5,splitterpos),imagestring.substr(splitterpos+1)];} 5521return[];}};function _renderImageOnCanvas(data,formattype,rerendercallable){'use strict' 5522var img=new Image(),c=this;img.onload=function(){var ctx=c.getContext("2d");var oldShadowColor=ctx.shadowColor;ctx.shadowColor="transparent";ctx.drawImage(img,0,0,(img.width<c.width)?img.width:c.width,(img.height<c.height)?img.height:c.height);ctx.shadowColor=oldShadowColor;};img.src='data:'+formattype+','+data;} 5523var importplugins={'native':function(data,formattype,rerendercallable){rerendercallable(data);},'image':_renderImageOnCanvas,'image/png;base64':_renderImageOnCanvas,'image/jpeg;base64':_renderImageOnCanvas,'image/jpg;base64':_renderImageOnCanvas};function _clearDrawingArea(data,dontClear){this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace)).data(apinamespace+'.this').resetCanvas(data,dontClear);return this;} 5524function _setDrawingData(data,formattype){var undef;if(formattype===undef&&typeof data==='string'&&data.substr(0,5)==='data:'){formattype=data.slice(5).split(',')[0];data=data.slice(6+formattype.length);if(formattype===data){return;}} 5525var $canvas=this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace));if(!importplugins.hasOwnProperty(formattype)){throw new Error(apinamespace+" is unable to find import plugin with for format '"+String(formattype)+"'");}else if($canvas.length!==0){importplugins[formattype].call($canvas[0],data,formattype,(function(jSignatureInstance){return function(){return jSignatureInstance.resetCanvas.apply(jSignatureInstance,arguments)}})($canvas.data(apinamespace+'.this')));} 5526return this;} 5527var elementIsOrphan=function(e){var topOfDOM=false;e=e.parentNode;while(e&&!topOfDOM){topOfDOM=e.body;e=e.parentNode;} 5528return!topOfDOM;}
5529var plugins={'export':exportplugins,'import':importplugins,'instance':jSignatureInstanceExtensions},methods={'init':function(options){return this.each(function(){if(!elementIsOrphan(this)){new jSignatureClass(this,options,jSignatureInstanceExtensions);}})},'getSettings':function(){return this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace)).data(apinamespace+'.this').settings;},'isModified':function(){return this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace)).data(apinamespace+'.this').dataEngine._stroke!==null;},'updateSetting':function(param,val,forFuture){var $canvas=this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace)).data(apinamespace+'.this');$canvas.settings[param]=val;$canvas.resetCanvas((forFuture?null:$canvas.settings.data),true);return $canvas.settings[param];},'clear':_clearDrawingArea,'reset':_clearDrawingArea,'addPlugin':function(pluginType,pluginName,callable){if(plugins.hasOwnProperty(pluginType)){plugins[pluginType][pluginName]=callable;} 5530return this;},'listPlugins':function(pluginType){var answer=[];if(plugins.hasOwnProperty(pluginType)){var o=plugins[pluginType];for(var k in o){if(o.hasOwnProperty(k)){answer.push(k);}}} 5531return answer;},'getData':function(formattype){var undef,$canvas=this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace));if(formattype===undef){formattype='default';} 5532if($canvas.length!==0&&exportplugins.hasOwnProperty(formattype)){return exportplugins[formattype].call($canvas.get(0),$canvas.data(apinamespace+'.data'),$canvas.data(apinamespace+'.settings'));}},'importData':_setDrawingData,'setData':_setDrawingData,'globalEvents':function(){return globalEvents},'disable':function(){this.find("input").attr("disabled",1);this.find('canvas.'+apinamespace).addClass("disabled").data(apinamespace+'.this').settings.readOnly=true;},'enable':function(){this.find("input").removeAttr("disabled");this.find('canvas.'+apinamespace).removeClass("disabled").data(apinamespace+'.this').settings.readOnly=false;},'events':function(){return this.find('canvas.'+apinamespace).add(this.filter('canvas.'+apinamespace)).data(apinamespace+'.this').events;}} 5533$.fn[apinamespace]=function(method){'use strict' 5534if(!method||typeof method==='object'){return methods.init.apply(this,arguments);}else if(typeof method==='string'&&methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else{$.error('Method '+String(method)+' does not exist on jQuery.'+apinamespace);}}} 5535GlobalJSignatureObjectInitializer(window)})();; 5536 5537/* /web/static/lib/qweb/qweb2.js */ 5538var QWeb2={expressions_cache:{},RESERVED_WORDS:'true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,typeof,eval,void,Math,RegExp,Array,Object,Date'.split(','),ACTIONS_PRECEDENCE:'foreach,if,elif,else,call,set,tag,out,esc,raw,js,debug,log'.split(','),WORD_REPLACEMENT:{'and':'&&','or':'||','gt':'>','gte':'>=','lt':'<','lte':'<='},VOID_ELEMENTS:'area,base,br,col,embed,hr,img,input,keygen,link,menuitem,meta,param,source,track,wbr'.split(','),tools:{exception:function(message,context){context=context||{};var prefix='QWeb2';if(context.template){prefix+=" - template['"+context.template+"']";} 5539throw new Error(prefix+": "+message);},warning:function(message){if(typeof(window)!=='undefined'&&window.console){window.console.warn(message);}},trim:function(s,mode){switch(mode){case"left":return s.replace(/^\s*/,"");case"right":return s.replace(/\s*$/,"");default:return s.replace(/^\s*|\s*$/g,"");}},js_escape:function(s,noquotes){return(noquotes?'':"'")+s.replace(/\r?\n/g,"\\n").replace(/'/g,"\\'")+(noquotes?'':"'");},html_escape:function(s){if(s==null){return'';} 5540return _.escape(s);},markup(s){return new _Markup(s);},gen_attribute:function(o){if(o!==null&&o!==undefined){if(o.constructor===Array){if(o[1]!==null&&o[1]!==undefined){return this.format_attribute(o[0],o[1]);}}else if(typeof o==='object'){var r='';for(var k in o){if(o.hasOwnProperty(k)){r+=this.gen_attribute([k,o[k]]);}} 5541return r;}} 5542return'';},format_attribute:function(name,value){const attrvalue=value==null?'':this.html_escape(String(value));return` ${name}="${attrvalue}"`;},extend:function(dst,src,exclude){for(var p in src){if(src.hasOwnProperty(p)&&!(exclude&&this.arrayIndexOf(exclude,p)!==-1)){dst[p]=src[p];}} 5543return dst;},arrayIndexOf:function(array,item){for(var i=0,ilen=array.length;i<ilen;i++){if(array[i]===item){return i;}} 5544return-1;},get_element_sibling:function(node,dom_attr){var sibling=node[dom_attr];while(sibling&&sibling.nodeType!==1){sibling=sibling[dom_attr];} 5545return sibling;},xml_node_to_string:function(node,childs_only){if(childs_only){var childs=node.childNodes,r=[];for(var i=0,ilen=childs.length;i<ilen;i++){r.push(this.xml_node_to_string(childs[i]));} 5546return r.join('');}else{if(node.nodeType==3){return node.data;} 5547if(typeof XMLSerializer!=='undefined'){return(new XMLSerializer()).serializeToString(node);}else{switch(node.nodeType){case 1:return node.outerHTML;case 4:return'<![CDATA['+node.data+']]>';case 8:return'<!-- '+node.data+'-->';} 5548throw new Error('Unknown node type '+node.nodeType);}}},call:function(context,template,old_dict,_import,callback){var new_dict=this.extend({},old_dict);new_dict['__caller__']=old_dict['__template__'];if(callback){new_dict[0]=this.markup(callback(context,new_dict));} 5549return this.markup(context.engine._render(template,new_dict));},foreach:function(context,enu,as,old_dict,callback){if(enu!=null){var index,jlen,cur;var new_dict=this.extend({},old_dict);new_dict[as+"_all"]=enu;var as_value=as+"_value",as_index=as+"_index",as_first=as+"_first",as_last=as+"_last",as_parity=as+"_parity";if(enu instanceof Array){var size=enu.length;new_dict[as+"_size"]=size;for(index=0,jlen=enu.length;index<jlen;index++){cur=enu[index];new_dict[as_value]=cur;new_dict[as_index]=index;new_dict[as_first]=index===0;new_dict[as_last]=index+1===size;new_dict[as_parity]=(index%2==1?'odd':'even');if(cur&&cur.constructor===Object){this.extend(new_dict,cur);} 5550new_dict[as]=cur;callback(context,new_dict);}}else if(enu.constructor==Number){var _enu=[];for(var i=0;i<enu;i++){_enu.push(i);} 5551this.foreach(context,_enu,as,old_dict,callback);}else{index=0;for(var k in enu){if(enu.hasOwnProperty(k)){cur=enu[k];new_dict[as_value]=cur;new_dict[as_index]=index;new_dict[as_first]=index===0;new_dict[as_parity]=(index%2==1?'odd':'even');new_dict[as]=k;callback(context,new_dict);index+=1;}}} 5552_.each(Object.keys(old_dict),function(z){old_dict[z]=new_dict[z];});}else{this.exception("No enumerator given to foreach",context);}}}};QWeb2.Engine=(function(){function Engine(){this.prefix='t';this.debug=false;this.templates_resources=[];this.templates={};this.compiled_templates={};this.extend_templates={};this.default_dict={};this.tools=QWeb2.tools;this.jQuery=window.jQuery;this.reserved_words=QWeb2.RESERVED_WORDS.slice(0);this.actions_precedence=QWeb2.ACTIONS_PRECEDENCE.slice(0);this.void_elements=QWeb2.VOID_ELEMENTS.slice(0);this.word_replacement=QWeb2.tools.extend({},QWeb2.WORD_REPLACEMENT);this.preprocess_node=null;for(var i=0;i<arguments.length;i++){this.add_template(arguments[i]);}} 5553QWeb2.tools.extend(Engine.prototype,{add_template:function(template,callback){var self=this;this.templates_resources.push(template);
5553if(template.constructor===String){return this.load_xml(template,function(err,xDoc){if(err){if(callback){return callback(err);}else{throw err;}} 5554self.add_template(xDoc,callback);});} 5555template=this.preprocess(template);var ec=(template.documentElement&&template.documentElement.childNodes)||template.childNodes||[];for(var i=0;i<ec.length;i++){var node=ec[i];if(node.nodeType===1){var name=node.getAttribute(this.prefix+'-name');var extend=node.getAttribute(this.prefix+'-extend');if(name&&extend){if(!this.templates[extend]){return this.tools.exception("Can't clone undefined template '"+extend+"' to create '"+name+"'");} 5556this.templates[name]=this.templates[extend].cloneNode(true);this.extend_templates[name]=(this.extend_templates[extend]||[]).slice();extend=name;name=undefined;} 5557if(name){this.templates[name]=node;this.compiled_templates[name]=null;}else if(extend){delete(this.compiled_templates[extend]);if(this.extend_templates[extend]){this.extend_templates[extend].push(node);}else{this.extend_templates[extend]=[node];}}}} 5558if(callback){callback(null,template);} 5559return true;},preprocess:function(doc){var self=this;var childs=(doc.documentElement&&doc.documentElement.childNodes)||doc.childNodes||[];for(var i=0;i<childs.length;i++){var node=childs[i];if(node.nodeType===1&&node.nodeName=='parsererror'){return this.tools.exception(node.innerText);}} 5560var tbranch=doc.querySelectorAll('[t-elif], [t-else]');for(var i=0,ilen=tbranch.length;i<ilen;i++){var node=tbranch[i];var prev_elem=self.tools.get_element_sibling(node,'previousSibling');var pattr=function(name){return prev_elem.getAttribute(name);} 5561var nattr=function(name){return+!!node.getAttribute(name);} 5562if(prev_elem&&(pattr('t-if')||pattr('t-elif'))){if(pattr('t-foreach')){return self.tools.exception("Error: t-if cannot stay at the same level as t-foreach when using t-elif or t-else");} 5563if(['t-if','t-elif','t-else'].map(nattr).reduce(function(a,b){return a+b;})>1){return self.tools.exception("Error: only one conditional branching directive is allowed per node");} 5564var text_node;while((text_node=node.previousSibling)!==prev_elem){if(text_node.nodeType!==8&&self.tools.trim(text_node.nodeValue)){return self.tools.exception("Error: text is not allowed between branching directives");} 5565text_node.parentNode.removeChild(text_node);}}else{return self.tools.exception("Error: t-elif and t-else directives must be preceded by a t-if or t-elif directive");}} 5566return doc;},load_xml:function(s,callback){var self=this;var async=!!callback;s=this.tools.trim(s);if(s.charAt(0)==='<'){var tpl=this.load_xml_string(s);if(callback){callback(null,tpl);} 5567return tpl;}else{var req=this.get_xhr();if(this.debug){s+='?debug='+(new Date()).getTime();} 5568req.open('GET',s,async);if(async){req.addEventListener("load",function(){if(req.status==200||req.status==0){callback(null,
5568self._parse_from_request(req));}else{callback(new Error("Can't load template "+s+", http status "+req.status));}});} 5569req.send(null);if(!async){return this._parse_from_request(req);}}},_parse_from_request:function(req){var xDoc=req.responseXML;if(xDoc){if(!xDoc.documentElement){throw new Error("QWeb2: This xml document has no root document : "+xDoc.responseText);} 5570if(xDoc.documentElement.nodeName=="parsererror"){throw new Error("QWeb2: Could not parse document :"+xDoc.documentElement.childNodes[0].nodeValue);} 5571return xDoc;}else{return this.load_xml_string(req.responseText);}},load_xml_string:function(s){if(window.DOMParser){var dp=new DOMParser();var r=dp.parseFromString(s,"text/xml");if(r.body&&r.body.firstChild&&r.body.firstChild.nodeName=='parsererror'){throw new Error("QWeb2: Could not parse document :"+r.body.innerText);} 5572return r;} 5573var xDoc;try{xDoc=new ActiveXObject("MSXML2.DOMDocument");}catch(e){throw new Error("Could not find a DOM Parser: "+e.message);} 5574xDoc.async=false;xDoc.preserveWhiteSpace=true;xDoc.loadXML(s);return xDoc;},has_template:function(template){return!!this.templates[template];},get_xhr:function(){if(window.XMLHttpRequest){return new window.XMLHttpRequest();} 5575try{return new ActiveXObject('MSXML2.XMLHTTP.3.0');}catch(e){throw new Error("Could not get XHR");}},compile:function(node){var e=new QWeb2.Element(this,node);var template=node.getAttribute(this.prefix+'-name');return" /* 'this' refers to Qweb2.Engine instance */\n"+" var context = { engine : this, template : "+(this.tools.js_escape(template))+" };\n"+" dict = dict || {};\n"+" dict['__template__'] = '"+template+"';\n"+" var r = [];\n"+" /* START TEMPLATE */"+ 5576(this.debug?"":" try {\n")+ 5577(e.compile())+"\n"+" /* END OF TEMPLATE */"+ 5578(this.debug?"":" } catch(error) {\n"+" if (console && console.exception) console.exception(error);\n"+" context.engine.tools.exception('Runtime Error: ' + error, context);\n")+ 5579(this.debug?"":" }\n")+" return r.join('');";},render:function(template,dict){dict=dict||{};QWeb2.tools.extend(dict,this.default_dict);var r=this._render(template,dict);return r;},_render:function(template,dict){if(this.compiled_templates[template]){return this.compiled_templates[template].apply(this,[dict||{}]);}else if(this.templates[template]){var ext;if(ext=this.extend_templates[template]){var extend_node;while(extend_node=ext.shift()){this.extend(template,extend_node);}} 5580var code=this.compile(this.templates[template]),tcompiled;try{tcompiled=new Function(['dict'],code);}catch(error){if(this.debug&&window.console){console.log(code);} 5581this.tools.exception("Error evaluating template: "+error,{template:template});} 5582if(!tcompiled){this.tools.exception("Error evaluating template: (IE?)"+error,{template:template});} 5583this.compiled_templates[template]=tcompiled;return this.render(template,dict);}else{return this.tools.exception("Template '"+template+"' not found");}},extend:function(template,extend_node){var jQuery=this.jQuery;if(!jQuery){return this.tools.exception("Can't extend template "+template+" without jQuery");} 5584var template_dest=this.templates[template];for(var i=0,ilen=extend_node.childNodes.length;i<ilen;i++){var child=extend_node.childNodes[i];if(child.nodeType===1){var jquery=child.getAttribute(this.prefix+'-jquery'),operation=child.getAttribute(this.prefix+'-operation'),target,error_msg="Error while extending template '"+template;if(jquery){target=jQuery(jquery,template_dest);if(!target.length&&window.console){console.error("Can't find '"+jquery+"' when extending template "+template);}}else{this.tools.exception(error_msg+"No expression given");} 5585error_msg+="' (expression='"+jquery+"') : ";if(operation){var allowed_operations="append,prepend,before,after,replace,inner,attributes".split(',');if(this.tools.arrayIndexOf(allowed_operations,operation)==-1){this.tools.exception(error_msg+"Invalid operation : '"+operation+"'");} 5586operation={'replace':'replaceWith','inner':'html'}[operation]||operation;if(operation==='attributes'){jQuery('attribute',child).each(function(){var attrib=jQuery(this);target.attr(attrib.attr('name'),attrib.text()||attrib.attr('value'));});}else{target[operation](child.cloneNode(true).childNodes);}}else{try{var f=new Function(['$','document'],this.tools.xml_node_to_string(child,true));}catch(error){return this.tools.exception("Parse "+error_msg+error);} 5587try{f.apply(target,[jQuery,template_dest.ownerDocument]);}catch(error){return this.tools.exception("Runtime "+error_msg+error);}}}}}});return Engine;})();QWeb2.Element=(function(){function Element(engine,node){this.engine=engine;this.node=node;this.tag=node.tagName;this.actions={tag:this.tag};this.actions_done=[];this.attributes={};this.children=[];this._top=[];this._bottom=[];this._indent=1;this.process_children=true;this.is_void_element=~QWeb2.tools.arrayIndexOf(this.engine.void_elements,this.tag);var childs=this.node.childNodes;if(childs){for(var i=0,ilen=childs.length;i<ilen;i++){this.children.push(new QWeb2.Element(this.engine,childs[i]));}} 5588var attrs=this.node.attributes;if(attrs){for(var j=0,jlen=attrs.length;j<jlen;j++){var attr=attrs[j];
5588var name=attr.name;var m=name.match(new RegExp("^"+this.engine.prefix+"-(.+)"));if(m){name=m[1];if(name==='name'){continue;} 5589if(name.match(/^attf?(-.*)?/)){this.attributes[m[0]]=attr.value;}else{this.actions[name]=attr.value;}}else{this.attributes[name]=attr.value;}}} 5590if(this.engine.preprocess_node){this.engine.preprocess_node.call(this);}} 5591QWeb2.tools.extend(Element.prototype,{compile:function(){var r=[],instring=false,lines=this._compile().split('\n');for(var i=0,ilen=lines.length;i<ilen;i++){var m,line=lines[i];if(m=line.match(/^(\s*)\/\/@string=(.*)/)){if(instring){if(this.engine.debug){r.push((m[2].indexOf("\\n")!=-1?"',\n\t"+m[1]+"'":'')+m[2]);}else{r.push(m[2]);}}else{r.push(m[1]+"r.push('"+m[2]);instring=true;}}else{if(instring){r.push("');\n");} 5592instring=false;r.push(line+'\n');}} 5593return r.join('');},_compile:function(){switch(this.node.nodeType){case 3:case 4:this.top_string(this.node.data);break;case 1:this.compile_element();} 5594var r=this._top.join('');if(this.process_children){for(var i=0,ilen=this.children.length;i<ilen;i++){var child=this.children[i];child._indent=this._indent;r+=child._compile();}} 5595r+=this._bottom.join('');return r;},format_expression:function(e){if(QWeb2.expressions_cache[e]){return QWeb2.expressions_cache[e];} 5596var chars=e.split(''),instring='',invar='',invar_pos=0,r='';chars.push(' ');for(var i=0,ilen=chars.length;i<ilen;i++){var c=chars[i];if(instring.length){if(c===instring&&chars[i-1]!=="\\"){instring='';}}else if(c==='"'||c==="'"){instring=c;}else if(c.match(/[a-zA-Z_\$]/)&&!invar.length){invar=c;invar_pos=i;continue;}else if(c.match(/\W/)&&invar.length){if(chars[invar_pos-1]!=='.'&&QWeb2.tools.arrayIndexOf(this.engine.reserved_words,invar)<0){invar=this.engine.word_replacement[invar]||("dict['"+invar+"']");} 5597r+=invar;invar='';}else if(invar.length){invar+=c;continue;} 5598r+=c;} 5599r=r.slice(0,-1);QWeb2.expressions_cache[e]=r;return r;},format_str:function(e){if(e=='0'){return'dict[0]';} 5600return this.format_expression(e);},string_interpolation:function(s){var _this=this;if(!s){return"''";} 5601function append_literal(s){s&&r.push(_this.engine.tools.js_escape(s));} 5602var re=/#{(.+?)}|{{(.+?)}}/g,start=0,r=[],m;while(m=re.exec(s)){append_literal(s.slice(start,re.lastIndex-m[0].length));r.push('('+this.format_str(m[2]||m[1])+')');start=re.lastIndex;} 5603append_literal(s.slice(start));return r.join(' + ');},indent:function(){return this._indent++;},dedent:function(){if(this._indent!==0){return this._indent--;}},get_indent:function(){return new Array(this._indent+1).join("\t");},top:function(s){return this._top.push(this.get_indent()+s+'\n');},top_string:function(s){return this._top.push(this.get_indent()+"//@string="+this.engine.tools.js_escape(s,true)+'\n');},bottom:function(s){return this._bottom.unshift(this.get_indent()+s+'\n');},bottom_string:function(s){return this._bottom.unshift(this.get_indent()+"//@string="+this.engine.tools.js_escape(s,true)+'\n');},compile_element:function(){for(var i=0,ilen=this.engine.actions_precedence.length;i<ilen;i++){var a=this.engine.actions_precedence[i];if(a in this.actions){var value=this.actions[a];var key='compile_action_'+a;if(this[key]){this[key](value);}else if(this.engine[key]){this.engine[key].call(this,value);}else{this.engine.tools.exception("No handler method for action '"+a+"'");}}}},compile_action_tag:function(){if(this.tag.toLowerCase()!==this.engine.prefix){this.top_string("<"+this.tag);for(var a in this.attributes){var v=this.attributes[a];var d=a.split('-');if(d[0]===this.engine.prefix&&d.length>1){if(d.length===2){this.top("r.push(context.engine.tools.gen_attribute("+(this.format_expression(v))+"));");}else{this.top("r.push(context.engine.tools.gen_attribute(['"+d.slice(2).join('-')+"', ("+ 5604(d[1]==='att'?this.format_expression(v):this.string_interpolation(v))+")]));");}}else{this.top_string(this.engine.tools.gen_attribute([a,v]));}} 5605if(this.actions.opentag==='true'||(!this.children.length&&this.is_void_element)){this.top_string("/>");}else{this.top_string(">");this.bottom_string("</"+this.tag+">");}}},compile_action_if:function(value){this.top("if ("+(this.format_expression(value))+") {");this.bottom("}");this.indent();},compile_action_elif:function(value){this.top("else if ("+(this.format_expression(value))+") {");this.bottom("}");this.indent();},compile_action_else:function(value){this.top("else {");this.bottom("}");this.indent();},compile_action_foreach:function(value){var as=this.actions['as']||value.replace(/[^a-zA-Z0-9]/g,'_');this.top("context.engine.tools.foreach(context, "+(this.format_expression(value))+", "+(this.engine.tools.js_escape(as))+", dict, function(context, dict) {");this.bottom("});");this.indent();},compile_action_call:function(value){if(this.children.length===0){return this.top("r.push(context.engine.tools.call(context, "+(this.string_interpolation(value))+", dict));");}else{this.top("r.push(context.engine.tools.call(context, "+(this.string_interpolation(value))+", dict, null, function(context, dict) {");this.bottom("}));");this.indent();this.top("var r = [];");return this.bottom("return context.engine.tools.markup(r.join(''));");}},compile_action_set:function(value){var variable=this.format_expression(value);if(this.actions['value']){if(this.children.length){this.engine.tools.warning("@set with @value plus node chidren found. Children are ignored.");} 5606this.top(variable+" = ("+(this.format_expression(this.actions['value']))+");");this.process_children=false;}else{if(this.children.length===0){this.top(variable+" = '';");}else if(this.children.length===1&&this.children[0].node.nodeType===3){this.top(variable+" = "+(this.engine.tools.js_escape(this.children[0].node.data))+";");this.process_children=false;}else{this.top(variable+" = (function(dict) {");this.bottom("})(dict);");this.indent();this.top("var r = [];");this.bottom("return context.engine.tools.markup(r.join(''));");}}},compile_action_esc:function(value){return this.compile_action_out(value);},compile_action_out(value){this.top("var t = "+this.format_str(value)+";");this.top("if (t != null) r.push(context.engine.tools.html_escape(t));");this.top("else {");this.bottom("}");this.indent();},compile_action_raw:function(value){let e=this.node;while(e.parentElement&&!e.getAttribute('t-name')){e=e.parentElement;} 5607console.warn("Found deprecated directive '@t-raw=\"%s\"' in " 5608+"template '%s'. Replace by @t-out, and explicitely wrap content in " 5609+"utils.Markup if necessary.",value,e.getAttribute('t-name'));this.top("var t = "+this.format_str(value)+";");this.top("if (t != null) r.push(t);");this.top("else {");this.bottom("}");this.indent();},compile_action_js:function(value){this.top("(function("+value+") {");this.bottom("})(dict);");this.indent();var lines=this.engine.tools.xml_node_to_string(this.node,true).split(/\r?\n/);for(var i=0,ilen=lines.length;i<ilen;i++){this.top(lines[i]);} 5610this.process_children=false;},compile_action_debug:function(value){this.top("debugger;");},compile_action_log:function(value){this.top("console.log("+this.format_expression(value)+");");}});return Element;})();; 5611 5612/* /web/static/src/legacy/js/assets.js */ 5613odoo.define('web.assets.qweb',function(require){"use strict";const{assets}=require('@web/core/assets');const loadXML=assets.loadXML;
5613assets.loadXML=function(xml,app){loadXML(xml,app);const doc=new DOMParser().parseFromString(xml,"text/xml");const qwebTemplates=document.createElement("templates");for(const element of doc.querySelectorAll("templates > [t-name]:not([owl]), templates > [t-extend]:not([owl])")){qwebTemplates.appendChild(element);} 5614odoo.ready('web.core').then(function(){const core=odoo.__DEBUG__.services['web.core'];core.qweb.add_template(qwebTemplates);});}});; 5615 5616/* /web/static/src/legacy/js/libs/autocomplete.js */ 5617odoo.define('web.autocomplete.extensions',function(){'use strict';var proto=$.ui.autocomplete.prototype;var initSource=proto._initSource;function filter(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value_){return matcher.test($("<div>").html(value_.label||value_.value||value_).text());});} 5618$.extend(proto,{_initSource:function(){if(this.options.html&&$.isArray(this.options.source)){this.source=function(request,response){response(filter(this.options.source,request.term));};}else{initSource.call(this);}},_renderItem:function(ul,item){return $("<li></li>").data("item.autocomplete",item).append($("<a></a>")[this.options.html?"html":"text"](item.label)).appendTo(ul).addClass(item.classname);},});});; 5619 5620/* /web/static/src/legacy/js/libs/bootstrap.js */ 5621odoo.define('@web/legacy/js/libs/bootstrap',async function(require){'use strict';let __exports={};let bsSanitizeAllowList=Tooltip.Default.allowList;bsSanitizeAllowList['*'].push('title','style',/^data-[\w-]+/);bsSanitizeAllowList.header=[];bsSanitizeAllowList.main=[];bsSanitizeAllowList.footer=[];bsSanitizeAllowList.caption=[];bsSanitizeAllowList.col=['span'];bsSanitizeAllowList.colgroup=['span'];bsSanitizeAllowList.table=[];bsSanitizeAllowList.thead=[];bsSanitizeAllowList.tbody=[];bsSanitizeAllowList.tfooter=[];bsSanitizeAllowList.tr=[];bsSanitizeAllowList.th=['colspan','rowspan'];bsSanitizeAllowList.td=['colspan','rowspan'];bsSanitizeAllowList.address=[];bsSanitizeAllowList.article=[];bsSanitizeAllowList.aside=[];bsSanitizeAllowList.blockquote=[];bsSanitizeAllowList.section=[];bsSanitizeAllowList.button=['type'];bsSanitizeAllowList.del=[];__exports.makeExtendedSanitizeWhiteList=makeExtendedSanitizeWhiteList;function makeExtendedSanitizeWhiteList(extensions){let allowList=Object.assign({},Tooltip.Default.allowList);
5621Object.keys(extensions).forEach(key=>{allowList[key]=(allowList[key]||[]).concat(extensions[key]);});return allowList;} 5622Tooltip.Default.placement='auto';Tooltip.Default.fallbackPlacement=['bottom','right','left','top'];Tooltip.Default.html=true;Tooltip.Default.trigger='hover';Tooltip.Default.container='body';Tooltip.Default.boundary='window';Tooltip.Default.delay={show:1000,hide:0};const bootstrapShowFunction=Tooltip.prototype.show;Tooltip.prototype.show=function(){$('.tooltip').remove();const errorsToIgnore=["Please use show on visible elements"];try{return bootstrapShowFunction.call(this);}catch(error){if(errorsToIgnore.includes(error.message)){return 0;} 5623throw error;}};const bootstrapSetElementContent=Tooltip.prototype.setElementContent;Tooltip.prototype.setElementContent=function(element,content){if(content&&content.jquery&&content.length){const $rootElement=$('<div/>');$rootElement.append(content);content=$rootElement[0];} 5624return bootstrapSetElementContent.call(this,element,content);};const bootstrapSpyRefreshFunction=ScrollSpy.prototype.refresh;ScrollSpy.prototype.refresh=function(){bootstrapSpyRefreshFunction.apply(this,arguments);if(this._scrollElement===window||this._config.method!=='offset'){return;} 5625const baseScrollTop=this._getScrollTop();for(let i=0;i<this._offsets.length;i++){this._offsets[i]+=baseScrollTop;}};const bootstrapSpyProcessFunction=ScrollSpy.prototype._process;ScrollSpy.prototype._process=function(){bootstrapSpyProcessFunction.apply(this,arguments);if(this._activeTarget===null&&this._config.alwaysKeepFirstActive){this._activate(this._targets[0]);}};const bootstrapSpyActivateFunction=ScrollSpy.prototype._activate;ScrollSpy.prototype._activate=function(target){const element=document.querySelector(`[href="${target}"]`);if(!element||$(element).is(':hidden')){return;} 5626bootstrapSpyActivateFunction.apply(this,arguments);};const bsAdjustDialogFunction=Modal.prototype._adjustDialog;Modal.prototype._adjustDialog=function(){const document=this._element.ownerDocument;document.body.classList.remove('modal-open');const $scrollable=$().getScrollingElement(document);if(document.body.contains($scrollable[0])){$scrollable.compensateScrollbar(true);} 5627document.body.classList.add('modal-open');return bsAdjustDialogFunction.apply(this,arguments);};const bsResetAdjustmentsFunction=Modal.prototype._resetAdjustments;Modal.prototype._resetAdjustments=function(){const document=this._element.ownerDocument;document.body.classList.remove('modal-open');const $scrollable=$().getScrollingElement(document);if(document.body.contains($scrollable[0])){$scrollable.compensateScrollbar(false);} 5628return bsResetAdjustmentsFunction.apply(this,arguments);};return __exports;});odoo.define(`web.bootstrap.extensions`,async function(require){return require('@web/legacy/js/libs/bootstrap')[Symbol.for("default")];});; 5629 5630/* /web/static/src/legacy/js/libs/content-disposition.js */ 5631odoo.define('web.contentdisposition',function(){'use strict';var HEX_ESCAPE_REPLACE_REGEXP=/%([0-9A-Fa-f]{2})/g;var NON_LATIN1_REGEXP=/[^\x20-\x7e\xa0-\xff]/g;var QESC_REGEXP=/\\([\u0000-\u007f])/g;var PARAM_REGEXP=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;var EXT_VALUE_REGEXP=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;var DISPOSITION_TYPE_REGEXP=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function decodefield(str){var match=EXT_VALUE_REGEXP.exec(str);if(!match){throw new TypeError('invalid extended field value')} 5632var charset=match[1].toLowerCase();var encoded=match[2];switch(charset){case'iso-8859-1':return encoded.replace(HEX_ESCAPE_REPLACE_REGEXP,pdecode).replace(NON_LATIN1_REGEXP,'?');case'utf-8':return decodeURIComponent(encoded);default:throw new TypeError('unsupported charset in extended field')}} 5633function parse(string){if(!string||typeof string!=='string'){throw new TypeError('argument string is required')} 5634var match=DISPOSITION_TYPE_REGEXP.exec(string);if(!match){throw new TypeError('invalid type format')} 5635var index=match[0].length;var type=match[1].toLowerCase();var key;var names=[];var params={};var value;index=PARAM_REGEXP.lastIndex=match[0].substr(-1)===';'?index-1:index;while((match=PARAM_REGEXP.exec(string))){if(match.index!==index){throw new TypeError('invalid parameter format')} 5636index+=match[0].length;key=match[1].toLowerCase();value=match[2];
5636if(names.indexOf(key)!==-1){throw new TypeError('invalid duplicate parameter')} 5637names.push(key);if(key.indexOf('*')+1===key.length){key=key.slice(0,-1);value=decodefield(value);params[key]=value;continue} 5638if(typeof params[key]==='string'){continue} 5639if(value[0]==='"'){value=value.substr(1,value.length-2).replace(QESC_REGEXP,'$1')} 5640params[key]=value} 5641if(index!==-1&&index!==string.length){throw new TypeError('invalid parameter format')} 5642return new ContentDisposition(type,params)} 5643function pdecode(str,hex){return String.fromCharCode(parseInt(hex,16))} 5644function ContentDisposition(type,parameters){this.type=type;this.parameters=parameters} 5645return{parse:parse,};});; 5646 5647/* /web/static/src/legacy/js/libs/download.js */ 5648odoo.define('web.download',function(){return function download(data,filename,mimetype){var self=window,defaultMime="application/octet-stream",mimeType=mimetype||defaultMime,payload=data,url=!filename&&!mimetype&&payload,anchor=document.createElement("a"),toString=function(a){return String(a);},myBlob=(self.Blob||self.MozBlob||self.WebKitBlob||toString),fileName=filename||"download",blob,reader;myBlob=myBlob.call?myBlob.bind(self):Blob;if(String(this)==="true"){payload=[payload,mimeType];mimeType=payload[0];payload=payload[1];} 5649if(url&&url.length<2048){fileName=url.split("/").pop().split("?")[0];anchor.href=url;if(anchor.href.indexOf(url)!==-1){var ajax=new XMLHttpRequest();ajax.open("GET",url,true);ajax.responseType='blob';ajax.onload=function(e){download(e.target.response,fileName,defaultMime);};setTimeout(function(){ajax.send();},0);return ajax;}} 5650if(/^data:[\w+\-]+\/[\w+\-]+[,;]/.test(payload)){if(payload.length>(1024*1024*1.999)&&myBlob!==toString){payload=dataUrlToBlob(payload);mimeType=payload.type||defaultMime;}else{return navigator.msSaveBlob?navigator.msSaveBlob(dataUrlToBlob(payload),fileName):saver(payload);}} 5651blob=payload instanceof myBlob?payload:new myBlob([payload],{type:mimeType});function dataUrlToBlob(strUrl){var parts=strUrl.split(/[:;,]/),type=parts[1],decoder=parts[2]==="base64"?atob:decodeURIComponent,binData=decoder(parts.pop()),mx=binData.length,i=0,uiArr=new Uint8Array(mx);for(i;i<mx;++i)uiArr[i]=binData.charCodeAt(i);return new myBlob([uiArr],{type:type});} 5652function saver(url,winMode){if('download'in anchor){anchor.href=url;anchor.setAttribute("download",fileName);anchor.className="download-js-link";anchor.innerHTML="downloading...";anchor.style.display="none";document.body.appendChild(anchor);setTimeout(function(){anchor.click();document.body.removeChild(anchor);if(winMode===true){setTimeout(function(){self.URL.revokeObjectURL(anchor.href);},250);}},66);return true;} 5653if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)){url=url.replace(/^data:([\w\/\-+]+)/,defaultMime);if(!window.open(url)){if(confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")){location.href=url;}} 5654return true;} 5655var f=document.createElement("iframe");document.body.appendChild(f);if(!winMode){url="data:"+url.replace(/^data:([\w\/\-+]+)/,defaultMime);} 5656f.src=url;setTimeout(function(){document.body.removeChild(f);},333);} 5657if(navigator.msSaveBlob){return navigator.msSaveBlob(blob,fileName);} 5658if(self.URL){saver(self.URL.createObjectURL(blob),true);}else{if(typeof blob==="string"||blob.constructor===toString){try{return saver("data:"+mimeType+";base64,"+self.btoa(blob));}catch(y){return saver("data:"+mimeType+","+encodeURIComponent(blob));}} 5659reader=new FileReader();reader.onload=function(){saver(this.result);};reader.readAsDataURL(blob);} 5660return true;};});; 5661 5662/* /web/static/src/legacy/js/libs/jquery.js */ 5663odoo.define('web.jquery.extensions',function(){'use strict';$.extend($.expr[':'],{containsLike:function(element,index,matches){return element.innerHTML.toUpperCase().indexOf(matches[3].toUpperCase())>=0;},containsTextLike:function(element,index,matches){return element.innerText.toUpperCase().indexOf(matches[3].toUpperCase())>=0;},containsExact:function(element,index,matches){return $.trim(element.innerHTML)===matches[3];},containsExactText:function(element,index,matches){return element.innerText.trim()===matches[3].trim();},containsRegex:function(element,index,matches){var regreg=/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})$/,reg=regreg.exec(matches[3]);return reg?new RegExp(reg[1],reg[2]).test($.trim(element.innerHTML)):false;},propChecked:function(element,index,matches){return $(element).prop("checked")===true;},propSelected:function(element,index,matches){return $(element).prop("selected")===true;},propValue:function(element,index,matches){return $(element).prop("value")===matches[3];},propValueContains:function(element,index,matches){return $(element).prop("value")&&$(element).prop("value").indexOf(matches[3])!==-1;},hasData:function(element){return!!_.toArray(element.dataset).length;},data:function(element,index,matches){return $(element).data(matches[3]);},hasVisibility:function(element,index,matches){var $element=$(element);if($(element).css('visibility')==='hidden'){return false;} 5664var $parent=$element.parent();if(!$parent.length||$element.is('html')){return true;} 5665return $parent.is(':hasVisibility');},hasOpacity:function(element,index,matches){var $element=$(element);if(parseFloat($(element).css('opacity'))<=0.01){return false;} 5666var $parent=$element.parent();if(!$parent.length||$element.is('html')){return true;} 5667return $parent.is(':hasOpacity');},});$.fn.extend({getAttributes:function(){var o={};if(this.length){var attrs=this[0].attributes;for(var i=0,l=attrs.length;i<l;i++){var attr=attrs.item(i);o[attr.name]=attr.value;}} 5668return o;},odooBounce:function(extraClass){for(const el of this){el.classList.add('o_catch_attention',extraClass);setTimeout(()=>el.classList.remove('o_catch_attention',extraClass),400);} 5669return this;},prependEvent:function(events,selector,data,handler){this.on.apply(this,arguments);events=events.split(' ');return this.each(function(){var el=this;_.each(events,function(evNameNamespaced){var evName=evNameNamespaced.split('.')[0];var handler=$._data(el,'events')[evName].pop();$._data(el,'events')[evName].unshift(handler);});});},closestScrollable(){const document=this.length?this[0].ownerDocument:window.document;let $el=this;while($el[0]!==document.scrollingElement){if(!$el.length||$el[0]instanceof Document){return $();} 5670if($el.isScrollable()){return $el;} 5671$el=$el.parent();} 5672return $el;},compensateScrollbar(add=true,isScrollElement=true,cssProperty='padding-right'){for(const el of this){const scrollableEl=isScrollElement?el:$(el).parent().closestScrollable()[0];const isRTL=scrollableEl.matches(".o_rtl");
5672if(isRTL){cssProperty=cssProperty.replace("right","left");} 5673el.style.removeProperty(cssProperty);if(!add){return;} 5674const style=window.getComputedStyle(el);const borderLeftWidth=Math.ceil(parseFloat(style.borderLeftWidth.replace('px','')));const borderRightWidth=Math.ceil(parseFloat(style.borderRightWidth.replace('px','')));const bordersWidth=borderLeftWidth+borderRightWidth;const newValue=parseInt(style[cssProperty])+scrollableEl.offsetWidth-scrollableEl.clientWidth-bordersWidth;el.style.setProperty(cssProperty,`${newValue}px`,'important');}},getScrollingElement(document=window.document){const $baseScrollingElement=$(document.scrollingElement);if($baseScrollingElement.isScrollable()&&$baseScrollingElement.hasScrollableContent()){return $baseScrollingElement;} 5675const bodyHeight=$(document.body).height();for(const el of document.body.children){if(bodyHeight-el.scrollHeight>1.5){continue;} 5676const $el=$(el);if($el.isScrollable()){return $el;}} 5677return $baseScrollingElement;},getScrollingTarget(contextItem=window.document){const isElement=obj=>obj&&obj.nodeType===Node.ELEMENT_NODE;const isJQuery=obj=>obj&&('jquery'in obj);const $scrollingElement=isElement(contextItem)?$(contextItem):isJQuery(contextItem)?contextItem:$().getScrollingElement(contextItem);const document=$scrollingElement[0].ownerDocument;return $scrollingElement.is(document.scrollingElement)?$(document.defaultView):$scrollingElement;},hasScrollableContent(){return this[0].scrollHeight>this[0].clientHeight;},isScrollable(){if(!this.length){return false;} 5678const overflow=this.css('overflow-y');const el=this[0];return overflow==='auto'||overflow==='scroll'||(overflow==='visible'&&el===el.ownerDocument.scrollingElement);},});const originalScrollTop=$.fn.scrollTop;$.fn.scrollTop=function(value){if(value!==undefined&&this.filter('html, body').length){const $withRealScrollable=this.not('html, body').add($().getScrollingElement(this[0].ownerDocument));originalScrollTop.apply($withRealScrollable,arguments);return this;}else if(value===undefined&&this.eq(0).is('html, body')){return originalScrollTop.apply($().getScrollingElement(this[0].ownerDocument),arguments);} 5679return originalScrollTop.apply(this,arguments);};const originalAnimate=$.fn.animate;$.fn.animate=function(properties,...rest){const props=Object.assign({},properties);if('scrollTop'in props&&this.filter('html, body').length){const $withRealScrollable=this.not('html, body').add($().getScrollingElement(this[0].ownerDocument));originalAnimate.call($withRealScrollable,{'scrollTop':props['scrollTop']},...rest);delete props['scrollTop'];} 5680if(!Object.keys(props).length){return this;} 5681return originalAnimate.call(this,props,...rest);};});; 5682 5683/* /web/static/src/legacy/js/libs/moment.js */ 5684odoo.define('web.moment.extensions',function(){'use strict';const locale=moment.locale();moment.updateLocale('ca',{preparse:function(string){return string.replace(/\b(?:dâ|de )(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/g,'$1');}});if(locale!=='ca'){moment.locale(locale);}});; 5685 5686/* /web/static/src/legacy/js/libs/underscore.js */ 5687_.cancellableThrottleRemoveMeSoon=function(func,wait,options){var timeout,context,args,result;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:_.now();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null;};var throttled=function(){var now=_.now();if(!previous&&options.leading===false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){if(timeout){clearTimeout(timeout);timeout=null;} 5688previous=now;result=func.apply(context,args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);} 5689return result;};throttled.cancel=function(){clearTimeout(timeout);previous=0;timeout=context=args=null;};return throttled;};; 5690 5691/* /web/static/src/legacy/js/libs/pdfjs.js */ 5692odoo.define('@web/legacy/js/libs/pdfjs',async function(require){'use strict';let __exports={};const config=require('web.config');__exports.hidePDFJSButtons=hidePDFJSButtons;function hidePDFJSButtons(rootElement){const cssStyle=document.createElement("style");cssStyle.rel="stylesheet";cssStyle.innerHTML=`button#secondaryOpenFile.secondaryToolbarButton, button#openFile.toolbarButton, 5693a#secondaryViewBookmark.secondaryToolbarButton, a#viewBookmark.toolbarButton { 5694display: none !important; 5695}`;if(config.device.isMobileDevice){cssStyle.innerHTML=`${cssStyle.innerHTML}
5696button#secondaryDownload.secondaryToolbarButton, button#download.toolbarButton, 5697button#secondaryPrint.secondaryToolbarButton, button#print.toolbarButton{ 5698display: none !important; 5699}`;} 5700const iframe=rootElement.tagName==='IFRAME'?rootElement:rootElement.querySelector('iframe');if(iframe){if(!iframe.dataset.hideButtons){iframe.dataset.hideButtons='true';iframe.addEventListener('load',event=>{if(iframe.contentDocument&&iframe.contentDocument.head){iframe.contentDocument.head.appendChild(cssStyle);}});}}else{console.warn('No IFRAME found');}} 5701return __exports;});; 5702 5703/* /web/static/src/legacy/js/libs/zoomodoo.js */ 5704odoo.define('web.zoomodoo',function(require){'use strict';var dw,dh,rw,rh,lx,ly;var defaults={linkTag:'a',linkAttribute:'data-zoom-image',event:'click',timer:0,preventClicks:true,disabledOnMobile:true,beforeShow:$.noop,beforeHide:$.noop,onShow:$.noop,onHide:$.noop,onMove:$.noop,beforeAttach:$.noop};function ZoomOdoo(target,options){this.$target=$(target);this.opts=$.extend({},defaults,options,this.$target.data());if(this.isOpen===undefined){this._init();}} 5705ZoomOdoo.prototype._init=function(){if(window.outerWidth>467||!this.opts.disabledOnMobile){this.$link=this.$target.find(this.opts.linkTag).length&&this.$target.find(this.opts.linkTag)||this.$target;this.$image=this.$target.find('img').length&&this.$target.find('img')||this.$target;this.$flyout=$('<div class="zoomodoo-flyout" />');var $attach=this.$target;if(this.opts.attach!==undefined&&this.$target.closest(this.opts.attach).length){$attach=this.$target.closest(this.opts.attach);} 5706$attach.parent().on('mousemove.zoomodoo touchmove.zoomodoo',$.proxy(this._onMove,this));$attach.parent().on('mouseleave.zoomodoo touchend.zoomodoo',$.proxy(this._onLeave,this));this.$target.on(this.opts.event+'.zoomodoo touchstart.zoomodoo',$.proxy(this._onEnter,this));if(this.opts.preventClicks){this.$target.on('click.zoomodoo',function(e){e.preventDefault();});}else{var self=this;this.$target.on('click.zoomodoo',function(){self.hide();self.$target.unbind();});}}};ZoomOdoo.prototype.show=function(e,testMouseOver){var w1,h1,w2,h2;var self=this;if(this.opts.beforeShow.call(this)===false)return;if(!this.isReady){return this._loadImage(this.$link.attr(this.opts.linkAttribute),function(){if(self.isMouseOver||!testMouseOver){self.show(e);}});} 5707var $attach=this.$target;if(this.opts.attach!==undefined&&this.$target.closest(this.opts.attach).length){$attach=this.$target.closest(this.opts.attach);} 5708$attach.parent().find('.zoomodoo-flyout').remove();this.$flyout.removeAttr('style');$attach.parent().append(this.$flyout);if(this.opts.attachToTarget){this.opts.beforeAttach.call(this);this.$flyout.css('position','fixed');var flyoutOffset=this.$flyout.offset();if(flyoutOffset.left>0){var flyoutLeft=parseFloat(this.$flyout.css('left').replace('px',''));this.$flyout.css('left',flyoutLeft-flyoutOffset.left+'px');} 5709if(flyoutOffset.top>0){var flyoutTop=parseFloat(this.$flyout.css('top').replace('px',''));this.$flyout.css('top',flyoutTop-flyoutOffset.top+'px');} 5710if(this.$zoom.height()<this.$flyout.height()){this.$flyout.css('height',this.$zoom.height()+'px');} 5711if(this.$zoom.width()<this.$flyout.width()){this.$flyout.css('width',this.$zoom.width()+'px');} 5712var offset=this.$target.offset();var left=offset.left-this.$flyout.width();var top=offset.top;if(left<0){if(offset.left<($(document).width()/2)){left=offset.left+this.$target.width();}else{left=0;}} 5713if(left+this.$flyout.width()>$(document).width()){this.$flyout.css('width',$(document).width()-left+'px');}else if(left===0){this.$flyout.css('width',offset.left+'px');} 5714if((top+this.$flyout.height())>$(document).height()){top=$(document).height()-this.$flyout.height();} 5715this.$flyout.css('transform','translate3d('+left+'px, '+top+'px, 0px)');}else{var rightAvailableSpace=document.body.clientWidth-this.$flyout[0].getBoundingClientRect().left;this.$flyout.css('max-width',rightAvailableSpace);} 5716w1=this.$target[0].offsetWidth;h1=this.$target[0].offsetHeight;w2=this.$flyout.width();h2=this.$flyout.height();dw=this.$zoom.width()-w2;dh=this.$zoom.height()-h2;if(dw<0)dw=0;if(dh<0)dh=0;rw=dw/w1;rh=dh/h1;this.isOpen=true;this.opts.onShow.call(this);if(e){this._move(e);}};ZoomOdoo.prototype._onEnter=function(e){var self=this;var touches=e.originalEvent.touches;e.preventDefault();this.isMouseOver=true;setTimeout(function(){if(self.isMouseOver&&(!touches||touches.length===1)){self.show(e,true);}},this.opts.timer);};ZoomOdoo.prototype._onMove=function(e){if(!this.isOpen)return;e.preventDefault();this._move(e);};ZoomOdoo.prototype._onLeave=function(){this.isMouseOver=false;if(this.isOpen){this.hide();}};ZoomOdoo.prototype._onLoad=function(e){if(!e.currentTarget.width)return;this.isReady=true;this.$flyout.html(this.$zoom);if(e.data.call){e.data();}};ZoomOdoo.prototype._loadImage=function(href,callback){var zoom=new Image();this.$zoom=$(zoom).on('load',callback,$.proxy(this._onLoad,this));zoom.style.position='absolute';zoom.src=href;};ZoomOdoo.prototype._move=function(e){if(e.type.indexOf('touch')===0){var touchlist=e.touches||e.originalEvent.touches;lx=touchlist[0].pageX;ly=touchlist[0].pageY;}else{lx=e.pageX||lx;ly=e.pageY||ly;} 5717var offset=this.$target.offset();var pt=ly-offset.top;var pl=lx-offset.left;var xt=Math.ceil(pt*rh);var xl=Math.ceil(pl*rw);if(!this.opts.attachToTarget&&(xl<0||xt<0||xl>dw||xt>dh||lx>(offset.left+this.$target.outerWidth()))){this.hide();}else{var top=xt*-1;var left=xl*-1;this.$zoom.css({top:top,left:left});this.opts.onMove.call(this,top,left);}};ZoomOdoo.prototype.hide=function(){if(!this.isOpen)return;if(this.opts.beforeHide.call(this)===false)return;this.$flyout.detach();this.isOpen=false;this.opts.onHide.call(this);};$.fn.zoomOdoo=function(options){return this.each(function(){var api=$.data(this,'zoomOdoo');if(!api){$.data(this,'zoomOdoo',new ZoomOdoo(this,options));}
5717else if(api.isOpen===undefined){api._init();}});};});; 5718 5719/* /web/static/src/legacy/js/libs/jSignatureCustom.js */ 5720function _renderImageOnCanvas(data,formattype,rerendercallable){'use strict' 5721var img=new Image(),c=this;img.onload=function(){var ctx=c.getContext("2d");var oldShadowColor=ctx.shadowColor;ctx.shadowColor="transparent";var ratio=((img.width/img.height)>(c.width/c.height))?c.width/img.width:c.height/img.height;ctx.drawImage(img,(c.width/2)-(img.width*ratio/2),(c.height/2)-(img.height*ratio/2),img.width*ratio,img.height*ratio);ctx.shadowColor=oldShadowColor;};img.src='data:'+formattype+','+data;} 5722['image','image/png;base64','image/jpeg;base64','image/jpg;base64',].forEach(imageType=>$.fn.jSignature("addPlugin","import",imageType,_renderImageOnCanvas));; 5723 5724/* /web/static/src/legacy/js/core/abstract_service.js */ 5725odoo.define('web.AbstractService',function(require){"use strict";var Class=require('web.Class');const{serviceRegistry}=require("web.core");var Mixins=require('web.mixins');var ServicesMixin=require('web.ServicesMixin');var AbstractService=Class.extend(Mixins.EventDispatcherMixin,ServicesMixin,{dependencies:[],init:function(env){Mixins.EventDispatcherMixin.init.call(this,arguments);this.env=env;},start:function(){},_trigger_up:function(ev){Mixins.EventDispatcherMixin._trigger_up.apply(this,arguments);if(ev.is_stopped()){return;} 5726const payload=ev.data;if(ev.name==='call_service'){let args=payload.args||[];if(payload.service==='ajax'&&payload.method==='rpc'){args=args.concat(ev.target);} 5727const service=this.env.services[payload.service];const result=service[payload.method].apply(service,args);payload.callback(result);}else if(ev.name==='do_action'){this.env.bus.trigger('do-action',payload);}},deployServices(env){const UndeployedServices=Object.assign({},serviceRegistry.map);function _deployServices(){let done=false;while(!done){const serviceName=Object.keys(UndeployedServices).find(serviceName=>{const Service=UndeployedServices[serviceName];
5727return Service.prototype.dependencies.every(depName=>{return env.services[depName];});});if(serviceName){const Service=UndeployedServices[serviceName];const service=new Service(env);env.services[serviceName]=service;delete UndeployedServices[serviceName];service.start();}else{done=true;}}} 5728serviceRegistry.onAdd((serviceName,Service)=>{if(serviceName in env.services||serviceName in UndeployedServices){throw new Error(`Service ${serviceName} is already loaded.`);} 5729UndeployedServices[serviceName]=Service;_deployServices();});_deployServices();}});return AbstractService;});; 5730 5731/* /web/static/src/legacy/js/core/abstract_storage_service.js */ 5732odoo.define('web.AbstractStorageService',function(require){'use strict';var AbstractService=require('web.AbstractService');var AbstractStorageService=AbstractService.extend({storage:null,destroy:function(){if((this.storage||{}).destroy){this.storage.destroy();} 5733this._super.apply(this,arguments);},clear:function(){this.storage.clear();},getItem:function(key,defaultValue){var val=this.storage.getItem(key);return val?JSON.parse(val):defaultValue;},key:function(index){return this.storage.key(index);},length:function(){return this.storage.length;},removeItem:function(key){this.storage.removeItem(key);},setItem:function(key,value){this.storage.setItem(key,JSON.stringify(value));},onStorage:function(){this.storage.on.apply(this.storage,["storage"].concat(Array.prototype.slice.call(arguments)));},});return AbstractStorageService;});; 5734 5735/* /web/static/src/legacy/js/core/ajax.js */ 5736odoo.define('web.ajax',function(require){"use strict";var config=require('web.config');var core=require('web.core');const{Markup}=require('web.utils');var time=require('web.time');var download=require('web.download');var contentdisposition=require('web.contentdisposition');const{session}=require('@web/session');var _t=core._t;var ajax={};function _genericJsonRpc(fct_name,params,settings,fct){var shadow=settings.shadow||false;delete settings.shadow;var data={jsonrpc:"2.0",method:fct_name,params:params,id:Math.floor(Math.random()*1000*1000*1000)};if(!shadow){core.bus.trigger('rpc_request',data.id);} 5737var xhr=fct(data);var result=xhr.then(function(result){core.bus.trigger('rpc:result',data,result);if(result.error!==undefined){console.debug("Server application error\n","Error code:",result.error.code,"\n","Error message:",result.error.message,"\n","Error data message:\n",result.error.data.message,"\n","Error data debug:\n",result.error.data.debug);return Promise.reject({type:"server",error:result.error});}else{return result.result;}},function(){var reason={type:'communication',error:arguments[0],textStatus:arguments[1],errorThrown:arguments[2],};return Promise.reject(reason);});var rejection;var promise=new Promise(function(resolve,reject){rejection=reject;result.then(function(result){if(!shadow){core.bus.trigger('rpc_response',data.id);} 5738resolve(result);},function(reason){var type=reason.type;var error=reason.error;var textStatus=reason.textStatus;var errorThrown=reason.errorThrown;if(type==="server"){if(!shadow){core.bus.trigger('rpc_response',data.id);} 5739if(error.code===100){core.bus.trigger('invalidate_session');} 5740reject({message:error,event:$.Event()});}else{if(!shadow){core.bus.trigger('rpc_response_failed',data.id);} 5741var nerror={code:-32098,message:"XmlHttpRequestError "+errorThrown,data:{type:"xhr"+textStatus,debug:error.responseText,objects:[error,errorThrown],arguments:[reason||textStatus]},};reject({message:nerror,event:$.Event()});}});});promise.abort=function(){rejection({message:"XmlHttpRequestError abort",event:$.Event('abort')});if(!shadow){core.bus.trigger('rpc_response');} 5742if(xhr.abort){xhr.abort();}};promise.guardedCatch(function(reason){setTimeout(function(){if(!reason.event.isDefaultPrevented()){core.bus.trigger('rpc_error',reason.message,reason.event);}},0);});return promise;};function jsonRpc(url,fct_name,params,settings){settings=settings||{};return _genericJsonRpc(fct_name,params,settings,function(data){return $.ajax(url,_.extend({},settings,{url:url,dataType:'json',type:'POST',data:JSON.stringify(data,time.date_to_utc),contentType:'application/json'}));});} 5743function rpc(url,params,settings){return jsonRpc(url,'call',params,settings);} 5744function get_file(options){var xhr=new XMLHttpRequest();var data;if(options.form){xhr.open(options.form.method,options.form.action);data=new FormData(options.form);}else{xhr.open('POST',options.url);data=new FormData();_.each(options.data||{},function(v,k){data.append(k,v);});} 5745if(core.csrf_token){data.append('csrf_token',core.csrf_token);} 5746xhr.responseType='blob';xhr.onload=function(){var mimetype=xhr.response.type;if(xhr.status===200&&mimetype!=='text/html'){var header=(xhr.getResponseHeader('Content-Disposition')||'').replace(/;$/,'');var filename=header?contentdisposition.parse(header).parameters.filename:null;download(xhr.response,filename,mimetype);if(options.success){options.success();} 5747return true;} 5748if(!options.error){return true;} 5749var decoder=new FileReader();decoder.onload=function(){var contents=decoder.result;var err;var doc=new DOMParser().parseFromString(contents,'text/html');var nodes=doc.body.children.length===0?doc.body.childNodes:doc.body.children;try{var node=nodes[1]||nodes[0];err=JSON.parse(node.textContent);}catch(_e){err={message:nodes.length>1?nodes[1].textContent:'',data:{name:String(xhr.status),title:nodes.length>0?nodes[0].textContent:'',}};} 5750options.error(err);};decoder.readAsText(xhr.response);};xhr.onerror=function(){if(options.error){options.error({message:_t("Something happened while trying to contact the server, check that the server is online and that you still have a working network connection."),data:{title:_t("Could not connect to the server")}});}};if(options.complete){xhr.onloadend=function(){options.complete();};} 5751xhr.send(data);return true;} 5752function post(controller_url,data){var postData=new FormData();$.each(data,function(i,val){postData.append(i,val);});if(core.csrf_token){postData.append('csrf_token',core.csrf_token);} 5753return new Promise(function(resolve,reject){$.ajax(controller_url,{data:postData,processData:false,contentType:false,type:'POST'}).then(resolve).fail(reject);});} 5754var loadAsset=(function(){var cache={};var load=function loadAsset(xmlId,context,tplRoute='/web/dataset/call_kw/'){if(cache[xmlId]){return cache[xmlId];} 5755context=_.extend({},session.user_context,context);const params={args:[xmlId,{debug:config.isDebug()}],kwargs:{context:context,},};if(tplRoute==='/web/dataset/call_kw/'){Object.assign(params,{model:'ir.ui.view',method:'render_public_asset',});} 5756cache[xmlId]=rpc(tplRoute,params).then(function(xml){var $xml=$(xml);return{cssLibs:$xml.filter('link[href]:not([type="image/x-icon"])').map(function(){return $(this).attr('href');}).get(),cssContents:$xml.filter('style').map(function(){return Markup($(this).html());}).get(),jsLibs:$xml.filter('script[src]').map(function(){return $(this).attr('src');}).get(),jsContents:$xml.filter('script:not([src])').map(function(){return Markup($(this).html());}).get(),};}).guardedCatch(reason=>{reason.event.preventDefault();throw`Unable to render the required templates for the assets to load: ${reason.message.message}`;});return cache[xmlId];};return load;})();_.extend(ajax,{jsonRpc:jsonRpc,rpc:rpc,loadAsset:loadAsset,get_file:get_file,post:post,});return ajax;});; 5757 5758/* /web/static/src/legacy/js/core/browser_detection.js */ 5759odoo.define('web.BrowserDetection',function(require){"use strict";var Class=require('web.Class');const{isMacOS,isBrowserChrome}=require('@web/core/browser/feature_detection');var BrowserDetection=Class.extend({init:function(){},isOsMac:isMacOS,isBrowserChrome,});return BrowserDetection;});; 5760 5761/* /web/static/src/legacy/js/core/bus.js */ 5762odoo.define('web.Bus',function(require){"use strict";var Class=require('web.Class');var mixins=require('web.mixins');return Class.extend(mixins.EventDispatcherMixin,{init:function(parent){mixins.EventDispatcherMixin.init.call(this);this.setParent(parent);},});});; 5763 5764/* /web/static/src/legacy/js/core/class.js */ 5765odoo.define('web.Class',function(){"use strict";function OdooClass(){} 5766var initializing=false;var fnTest=/xyz/.test(function(){xyz();})?/\b_super\b/:/.*/;OdooClass.extend=function(){var _super=this.prototype;var args=_.toArray(arguments);args.unshift({});var prop=_.extend.apply(_,args);initializing=true;var This=this;var prototype=new This();initializing=false;_.each(prop,function(val,name){prototype[name]=typeof prop[name]=="function"&&fnTest.test(prop[name])?(function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,prop[name]):prop[name];});function Class(){if(this.constructor!==OdooClass){throw new Error("You can only instanciate objects with the 'new' operator");} 5767this._super=null;if(!initializing&&this.init){var ret=this.init.apply(this,arguments);if(ret){return ret;}} 5768return this;} 5769Class.include=function(properties){_.each(properties,function(val,name){if(typeof properties[name]!=='function'||!fnTest.test(properties[name])){prototype[name]=properties[name];}else if(typeof prototype[name]==='function'&&prototype.hasOwnProperty(name)){prototype[name]=(function(name,fn,previous){return function(){var tmp=this._super;this._super=previous;var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,properties[name],prototype[name]);}else if(typeof _super[name]==='function'){prototype[name]=(function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,properties[name]);}});};Class.prototype=prototype;Class.constructor=Class;Class.extend=this.extend;return Class;};return OdooClass;});; 5770 5771/* /web/static/src/legacy/js/core/collections.js */ 5772odoo.define("web.collections",function(require){"use strict";var Class=require("web.Class");var Tree=Class.extend({init:function(data){this._data=data;this._children=[];},getData:function(){return this._data;},addChild:function(tree){this._children.push(tree);},});return{Tree:Tree,};});; 5773 5774/* /web/static/src/legacy/js/core/concurrency.js */ 5775odoo.define('web.concurrency',function(require){"use strict";var Class=require('web.Class');return{delay:function(wait){return new Promise(function(resolve){setTimeout(resolve,wait);});},DropMisordered:Class.extend({init:function(failMisordered){this.lsn=0;this.rsn=-1;this.failMisordered=failMisordered||false;},add:function(promise){var self=this;var seq=this.lsn++;var res=new Promise(function(resolve,reject){promise.then(function(result){if(seq>self.rsn){self.rsn=seq;resolve(result);}else if(self.failMisordered){reject();}}).guardedCatch(function(result){reject(result);});});return res;},}),DropPrevious:Class.extend({add:function(promise){if(this.currentDef){this.currentDef.reject();} 5776var rejection;var res=new Promise(function(resolve,reject){rejection=reject;
5776promise.then(resolve).catch(function(reason){reject(reason);});});this.currentDef=res;this.currentDef.reject=rejection;return res;}}),Mutex:Class.extend({init:function(){this.lock=Promise.resolve();this.queueSize=0;this.unlockedProm=undefined;this._unlock=undefined;},exec:function(action){var self=this;var currentLock=this.lock;var result;this.queueSize++;this.unlockedProm=this.unlockedProm||new Promise(function(resolve){self._unlock=resolve;});this.lock=new Promise(function(unlockCurrent){currentLock.then(function(){result=action();var always=function(returnedResult){unlockCurrent();self.queueSize--;if(self.queueSize===0){self.unlockedProm=undefined;self._unlock();} 5777return returnedResult;};Promise.resolve(result).then(always).catch(always);});});return this.lock.then(function(){return result;});},getUnlockedDef:function(){return this.unlockedProm||Promise.resolve();},}),MutexedDropPrevious:Class.extend({init:function(){this.locked=false;this.currentProm=null;this.pendingAction=null;this.pendingProm=null;},exec:function(action){var self=this;var resolution;var rejection;if(this.locked){this.pendingAction=action;var oldPendingDef=this.pendingProm;this.pendingProm=new Promise(function(resolve,reject){resolution=resolve;rejection=reject;if(oldPendingDef){oldPendingDef.reject();} 5778self.currentProm.reject();});this.pendingProm.resolve=resolution;this.pendingProm.reject=rejection;return this.pendingProm;}else{this.locked=true;this.currentProm=new Promise(function(resolve,reject){resolution=resolve;rejection=reject;function unlock(){self.locked=false;if(self.pendingAction){var action=self.pendingAction;var prom=self.pendingProm;self.pendingAction=null;self.pendingProm=null;self.exec(action).then(prom.resolve).guardedCatch(prom.reject);}} 5779Promise.resolve(action()).then(function(result){resolve(result);unlock();}).guardedCatch(function(reason){reject(reason);unlock();});});this.currentProm.resolve=resolution;this.currentProm.reject=rejection;return this.currentProm;}}}),rejectAfter:function(target_def,reference_def){return new Promise(function(resolve,reject){target_def.then(resolve).guardedCatch(reject);reference_def.then(reject).guardedCatch(reject);});}};});; 5780 5781/* /web/static/src/legacy/js/core/dialog.js */ 5782odoo.define('web.Dialog',function(require){"use strict";var core=require('web.core');var dom=require('web.dom');var Widget=require('web.Widget');const OwlDialog=require('web.OwlDialog');var QWeb=core.qweb;var _t=core._t;var Dialog=Widget.extend({tagName:'main',custom_events:_.extend({},Widget.prototype.custom_events,{focus_control_button:'_onFocusControlButton',close_dialog:'_onCloseDialog',}),events:_.extend({},Widget.prototype.events,{'keydown .modal-footer button':'_onFooterButtonKeyDown',}),init:function(parent,options){var self=this;this._super(parent);this._opened=new Promise(function(resolve){self._openedResolver=resolve;});if(this.on_attach_callback){this._opened=this.opened(this.on_attach_callback);} 5783options=_.defaults(options||{},{title:_t('Odoo'),subtitle:'',size:'large',fullscreen:false,dialogClass:'',$content:false,buttons:[{text:_t("Ok"),close:true}],technical:true,$parentNode:false||$(document.body.querySelector(".o_dialog_container")),backdrop:'static',renderHeader:true,renderFooter:true,onForceClose:false,});this.$content=options.$content;this.title=options.title;this.subtitle=options.subtitle;this.fullscreen=options.fullscreen;this.dialogClass=options.dialogClass;this.size=options.size;this.buttons=options.buttons;this.technical=options.technical;this.$parentNode=options.$parentNode;this.backdrop=options.backdrop;this.renderHeader=options.renderHeader;this.renderFooter=options.renderFooter;this.onForceClose=options.onForceClose;core.bus.on('close_dialogs',this,this.destroy.bind(this));},willStart:function(){var self=this;return this._super.apply(this,arguments).then(function(){self.$modal=$(QWeb.render('web.DialogWidget',{fullscreen:self.fullscreen,title:self.title,subtitle:self.subtitle,technical:self.technical,renderHeader:self.renderHeader,renderFooter:self.renderFooter,}));
5783switch(self.size){case'extra-large':self.$modal.find('.modal-dialog').addClass('modal-xl');break;case'large':self.$modal.find('.modal-dialog').addClass('modal-lg');break;case'small':self.$modal.find('.modal-dialog').addClass('modal-sm');break;} 5784if(self.renderFooter){self.$footer=self.$modal.find(".modal-footer");self.set_buttons(self.buttons);} 5785self.$modal.on('hidden.bs.modal',_.bind(self.destroy,self));});},renderElement:function(){this._super();if(this.$content){this.setElement(this.$content);} 5786this.$el.addClass('modal-body '+this.dialogClass);},set_buttons:function(buttons){this._setButtonsTo(this.$footer,buttons);},set_title:function(title,subtitle){this.title=title||"";if(subtitle!==undefined){this.subtitle=subtitle||"";} 5787var $title=this.$modal.find('.modal-title').first();var $subtitle=$title.find('.o_subtitle').detach();$title.html(this.title);$subtitle.html(this.subtitle).appendTo($title);return this;},opened:function(handler){return(handler)?this._opened.then(handler):this._opened;},open:function(options){$('.tooltip').remove();var self=this;this.appendTo($('<div/>')).then(function(){if(self.isDestroyed()){return;} 5788self.$modal.find(".modal-body").replaceWith(self.$el);self.$modal.attr('open',true);if(self.$parentNode){self.$modal.appendTo(self.$parentNode);} 5789const modalNode=self.$modal[0];const modal=new Modal(modalNode,{backdrop:self.backdrop,keyboard:false,});modal.show();self._openedResolver();if(options&&options.shouldFocusButtons){self._onFocusControlButton();} 5790OwlDialog.display(self);core.bus.trigger("legacy_dialog_opened",self);});return self;},close:function(){this.destroy();},destroy:function(options){if(!this.__closed){this.__closed=true;this.trigger('closed',options);} 5791if(this.isDestroyed()){return;} 5792if(this.el){OwlDialog.hide(this);core.bus.trigger("legacy_dialog_destroyed",this);} 5793if(this.onForceClose){this.onForceClose();} 5794var isFocusSet=this._focusOnClose();this._super();$('.tooltip').remove();if(this.$modal){if(this.on_detach_callback){this.on_detach_callback();} 5795this.$modal.modal('hide');this.$modal.remove();} 5796const modals=$('.modal[role="dialog"]').filter(':visible').filter(this._isBlocking);if(modals.length){if(!isFocusSet){modals.last().focus();} 5797$('body').addClass('modal-open');}},rebindButtonBehavior:function(){this.$footer.on('keydown',this._onFooterButtonKeyDown);},_focusOnClose:function(){return false;},_setButtonsTo($target,buttons){var self=this;$target.empty();_.each(buttons,function(buttonData){var $button=dom.renderButton({attrs:{class:buttonData.classes||(buttons.length>1?'btn-secondary':'btn-primary'),disabled:buttonData.disabled,'data-hotkey':buttonData.hotkey,},icon:buttonData.icon,text:buttonData.text,});$button.on('click',function(e){var def;if(buttonData.click){def=buttonData.click.call(self,e);} 5798if(buttonData.close){self.onForceClose=false;Promise.resolve(def).then(self.close.bind(self));}});if(self.technical){$target.append($button);}else{$target.prepend($button);}});},_isBlocking(index,el){return true;},_onCloseDialog:function(ev){ev.stopPropagation();this.close();},_onFocusControlButton:function(e){if(this.$footer){if(e){e.stopPropagation();} 5799this.$footer.find('.btn-primary:visible:first()').focus();}},_onFooterButtonKeyDown:function(e){switch(e.which){case $.ui.keyCode.TAB:if(!e.shiftKey&&e.target.classList.contains("btn-primary")){e.preventDefault();var $primaryButton=$(e.target);$primaryButton.tooltip({delay:{show:200,hide:0},title:function(){return QWeb.render('FormButton.tooltip',{title:$primaryButton.text().toUpperCase()});},trigger:'manual',});$primaryButton.tooltip('show');} 5800break;}}});Dialog.alert=function(owner,message,options){var buttons=[{text:_t("Ok"),close:true,click:options&&options.confirm_callback,}];return new Dialog(owner,_.extend({size:'medium',buttons:buttons,$content:$('<main/>',{role:'alert',text:message,}),title:_t("Alert"),onForceClose:options&&(options.onForceClose||options.confirm_callback),},options)).open({shouldFocusButtons:true});};Dialog.confirm=function(owner,message,options){let isBlocked=false;function makeCallback(key){const callback=options&&options[key];return function(){if(isBlocked){return Promise.reject();} 5801isBlocked=true;const callbackRes=callback&&callback.apply(this,arguments);Promise.resolve(callbackRes).guardedCatch(()=>{isBlocked=false;});return callbackRes;};} 5802var buttons=[{text:_t("Ok"),classes:'btn-primary',close:true,click:makeCallback('confirm_callback'),}
5802,{text:_t("Cancel"),close:true,click:makeCallback('cancel_callback'),}];return new Dialog(owner,_.extend({size:'medium',buttons:buttons,$content:$('<main/>',{role:'alert',text:message,}),title:_t("Confirmation"),onForceClose:options&&(options.onForceClose||options.cancel_callback),},options)).open({shouldFocusButtons:true});};Dialog.safeConfirm=function(owner,message,options){var $checkbox=dom.renderCheckbox({text:options&&options.securityMessage||_t("I am sure about this."),}).addClass('mb0');var $securityCheck=$('<div/>',{class:'alert alert-'+(options&&options.securityLevel||'warning')+' mt8 mb0',}).prepend($checkbox);var $content;if(options&&options.$content){$content=options.$content;delete options.$content;}else{$content=$('<div>',{text:message,});} 5803$content=$('<main/>',{role:'alert'}).append($content,$securityCheck);var buttons=[{text:_t("Ok"),classes:'btn-primary o_safe_confirm_button',close:true,click:options&&options.confirm_callback,disabled:true,},{text:_t("Cancel"),close:true,click:options&&options.cancel_callback}];var dialog=new Dialog(owner,_.extend({size:'medium',buttons:buttons,$content:$content,title:_t("Confirmation"),onForceClose:options&&(options.onForceClose||options.cancel_callback),},options));dialog.opened(function(){var $button=dialog.$footer.find('.o_safe_confirm_button');$securityCheck.on('click','input[type="checkbox"]',function(ev){$button.prop('disabled',!$(ev.currentTarget).prop('checked'));});});return dialog.open();};return Dialog;});; 5804 5805/* /web/static/src/legacy/js/core/owl_dialog.js */ 5806odoo.define('web.OwlDialog',function(require){"use strict";const{useRef,onMounted,onWillUnmount}=owl;const SIZE_CLASSES={'extra-large':'modal-xl','large':'modal-lg','small':'modal-sm',};const{renderToString}=require('@web/core/utils/render');const{LegacyComponent}=require("@web/legacy/legacy_component");class Dialog extends LegacyComponent{setup(){this.modalRef=useRef('modal');this.dialogRef=useRef('dialog');this.footerRef=useRef('modal-footer');if(this.props.dialogAPI){this.props.dialogAPI.close=this._close.bind(this);} 5807onMounted(()=>{this.constructor.display(this);this.env.bus.on('close_dialogs',this,this._close);if(this.props.renderFooter){let mainButton=this.footerRef.el.querySelector('.btn.btn-primary');if(!mainButton){mainButton=this.footerRef.el.querySelector('.btn');} 5808if(!mainButton){mainButton=this.footerRef.el.querySelector('button');} 5809if(mainButton){this.mainButton=mainButton;this.mainButton.addEventListener('keydown',this._onMainButtonKeydown.bind(this));this.mainButton.focus();}} 5810this._removeTooltips();this.env.bus.trigger("owl_dialog_mounted",this);});onWillUnmount(()=>{this.env.bus.trigger("owl_dialog_willunmount",this);this.env.bus.off('close_dialogs',this,this._close);this._removeTooltips();this.constructor.hide(this);});} 5811get size(){return SIZE_CLASSES[this.props.size];} 5812_close(){if(this.props.onClosed){this.props.onClosed();} 5813this.trigger('dialog-closed');} 5814_removeTooltips(){for(const tooltip of document.querySelectorAll('.tooltip')){tooltip.remove();}} 5815_onBackdropClick(ev){if(!this.props.backdrop||ev.target!==ev.currentTarget){return;} 5816if(this.props.backdrop==='static'){if(this.mainButton){this.mainButton.focus();}}else{this._close();}} 5817_onClick(ev){if(this.props.stopClicks){ev.stopPropagation();}} 5818_onDialogClosed(){if(this.props.onClosed){this.props.onClosed();}} 5819_onFocus(){if(this.mainButton){this.mainButton.focus();}} 5820_onMainButtonKeydown(ev){if(ev.key==='Tab'&&!ev.shiftKey){ev.preventDefault();$(this.mainButton).tooltip({delay:{show:200,hide:0},title:()=>renderToString('web.DialogButton.tooltip',{title:this.mainButton.innerText.toUpperCase(),}),trigger:'manual',}).tooltip('show');}} 5821static display(dialog){const activeDialog=this.displayed[this.displayed.length-1];if(activeDialog){const activeDialogEl=activeDialog.modalRef?activeDialog.modalRef.el:activeDialog.$modal[0];activeDialogEl.classList.add('o_inactive_modal');activeDialogEl.removeAttribute("tabindex");} 5822this.displayed.push(dialog);document.body.classList.add('modal-open');} 5823static hide(dialog){this.displayed.splice(this.displayed.indexOf(dialog),1);const lastDialog=this.displayed[this.displayed.length-1];let modalEl;if(lastDialog){if(lastDialog.el){lastDialog.el.focus();modalEl=lastDialog.$modal[0];}else if(lastDialog.modalRef){lastDialog.modalRef.el.focus();modalEl=lastDialog.modalRef.el;}else{lastDialog.dialogRef.el.focus();modalEl=lastDialog.dialogRef.el;} 5824modalEl.classList.remove('o_inactive_modal');modalEl.setAttribute("tabindex","-1");}else{document.body.classList.remove('modal-open');}}} 5825Dialog.displayed=[];Dialog.defaultProps={backdrop:'static',renderFooter:true,renderHeader:true,size:'large',stopClicks:true,technical:true,title:"Odoo",};Dialog.props={backdrop:{validate:b=>['static',true,false].includes(b),optional:true},contentClass:{type:String,optional:1},fullscreen:{type:Boolean,optional:1},onClosed:{type:Function,optional:1},renderFooter:{type:Boolean,optional:true},renderHeader:{type:Boolean,optional:true},size:{validate:s=>['extra-large','large','medium','small'].includes(s),optional:true},stopClicks:{type:Boolean,optional:true},subtitle:{type:String,optional:1},technical:{type:Boolean,optional:true},title:{type:String,optional:true},dialogAPI:{type:Object,optional:1},slots:{type:Object,optional:1,shape:{default:{optional:1},buttons:{optional:1},},},};Dialog.template='web.OwlDialog';return Dialog;});; 5826 5827/* /web/static/src/legacy/js/core/popover.js */ 5828odoo.define('web.Popover',function(require){'use strict';const{LegacyComponent}=require("@web/legacy/legacy_component");const{status,onWillUnmount,useEffect,useRef,useState}=owl;class Popover extends LegacyComponent{setup(){this.popoverRef=useRef('popover');this.orderedPositions=['top','bottom','left','right'];this.state=useState({displayed:false,});this._onClickDocument=this._onClickDocument.bind(this);this._onScrollDocument=this._onScrollDocument.bind(this);this._onResizeWindow=this._onResizeWindow.bind(this);this._onScrollDocument=_.throttle(this._onScrollDocument,50);this._onResizeWindow=_.debounce(this._onResizeWindow,250);this._hasGlobalEventListeners=false;useEffect(()=>this._compute());onWillUnmount(()=>{if(this._hasGlobalEventListeners){this._removeGlobalEventListeners();}});} 5829_addGlobalEventListeners(){document.addEventListener('click',this._onClickDocument,{capture:true,});document.addEventListener('scroll',this._onScrollDocument,{capture:true,});window.addEventListener('resize',this._onResizeWindow);this._hasGlobalEventListeners=true;} 5830_close(){this.state.displayed=false;if(this.props.onClosed){this.props.onClosed();}} 5831_compute(){if(!this._hasGlobalEventListeners&&this.state.displayed){this._addGlobalEventListeners();} 5832if(this._hasGlobalEventListeners&&!this.state.displayed){this._removeGlobalEventListeners();} 5833if(!this.state.displayed){return;} 5834const possiblePositions=[...this.orderedPositions];
5834const positionIndex=possiblePositions.indexOf(this.props.position);const positioningData=this.constructor.computePositioningData(this.popoverRef.el,this.el);const position=possiblePositions.slice(positionIndex).concat(possiblePositions.slice(0,positionIndex)).map((pos)=>positioningData[pos]).find((pos)=>{this.popoverRef.el.style.top=`${pos.top}px`;this.popoverRef.el.style.left=`${pos.left}px`;const rect=this.popoverRef.el.getBoundingClientRect();const html=document.documentElement;return(rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||html.clientHeight)&&rect.right<=(window.innerWidth||html.clientWidth));});possiblePositions.forEach((pos)=>{this.popoverRef.el.classList.remove(`o_popover--${pos}`);});if(position){this.popoverRef.el.classList.add(`o_popover--${position.name}`);}else{this.popoverRef.el.style.top=`${positioningData[this.props.position].top}px`;this.popoverRef.el.style.left=`${positioningData[this.props.position].left}px`;this.popoverRef.el.classList.add(`o_popover--${this.props.position}`);}} 5835_removeGlobalEventListeners(){document.removeEventListener('click',this._onClickDocument,true);document.removeEventListener('scroll',this._onScrollDocument,true);window.removeEventListener('resize',this._onResizeWindow);this._hasGlobalEventListeners=false;} 5836_onClick(ev){const props=this.props;this.state.displayed=!this.state.displayed;if(this.state.displayed){if(props.onOpened){props.onOpened();}}else{if(props.onClosed){props.onClosed();}} 5837if(!props.propagateClick){ev.stopPropagation();}} 5838_onClickDocument(ev){if(this.el.contains(ev.target)){return;} 5839if(this.popoverRef.el&&this.popoverRef.el.contains(ev.target)){return;} 5840this._close();} 5841_onPopoverClose(){this._close();} 5842_onPopoverCompute(ev){this._compute();} 5843_onResizeWindow(ev){if(status(this)==="destroyed"){return;} 5844this._compute();} 5845_onScrollDocument(ev){if(status(this)==="destroyed"){return;} 5846this._compute();} 5847static computePositioningData(popoverElement,targetElement,margin=16){const boundingRectangle=targetElement.getBoundingClientRect();const targetTop=boundingRectangle.top;const targetLeft=boundingRectangle.left;const targetHeight=targetElement.offsetHeight;const targetWidth=targetElement.offsetWidth;const popoverHeight=popoverElement.offsetHeight;const popoverWidth=popoverElement.offsetWidth;const windowWidth=window.innerWidth||document.documentElement.clientWidth;const windowHeight=window.innerHeight||document.documentElement.clientHeight;const leftOffsetForVertical=Math.max(margin,Math.min(Math.round(targetLeft-(popoverWidth-targetWidth)/2),windowWidth-popoverWidth-margin,),);const topOffsetForHorizontal=Math.max(margin,Math.min(Math.round(targetTop-(popoverHeight-targetHeight)/2),windowHeight-popoverHeight-margin,),);return{top:{name:'top',top:Math.round(targetTop-popoverHeight),left:leftOffsetForVertical,},right:{name:'right',top:topOffsetForHorizontal,left:Math.round(targetLeft+targetWidth),},bottom:{name:'bottom',top:Math.round(targetTop+targetHeight),left:leftOffsetForVertical,},left:{name:'left',top:topOffsetForHorizontal,left:Math.round(targetLeft-popoverWidth),},};}} 5848Popover.template='Popover';Popover.defaultProps={position:'bottom',propagateClick:true,};Popover.props={propagateClick:{type:Boolean,optional:true,},class:{type:String,optional:true,},onClosed:{type:Function,optional:true,},onOpened:{type:Function,optional:true,},popoverClass:{type:String,optional:true,},position:{type:String,validate:(p)=>['top','bottom','left','right'].includes(p),optional:true,},title:{type:String,optional:true},titleAttribute:{type:String,optional:true},slots:{type:Object,optional:true,shape:{default:{optional:true},opened:{optional:true},},},};return Popover;});; 5849 5850/* /web/static/src/legacy/js/core/dom.js */ 5851odoo.define('web.dom_ready',function(require){'use strict';return new Promise(function(resolve,reject){$(resolve);});});odoo.define('web.dom',function(require){"use strict";var core=require('web.core');const minimalDom=require('@web/legacy/js/core/minimal_dom');var _t=core._t;function _notify(content,callbacks){callbacks.forEach(function(c){if(c.widget&&c.widget.on_attach_callback){c.widget.on_attach_callback(c.callback_args);}});core.bus.trigger('DOM_updated',content);} 5852const dom=Object.assign({},minimalDom,{append:function($target,content,options){$target.append(content);if(options&&options.in_DOM){_notify(content,options.callbacks);}},areColliding(el1,el2){const el1Rect=el1.getBoundingClientRect();const el2Rect=el2.getBoundingClientRect();return el1Rect.bottom>el2Rect.top&&el1Rect.top<el2Rect.bottom&&el1Rect.right>el2Rect.left&&el1Rect.left<el2Rect.right;},autoresize:function($textarea,options){if($textarea.data("auto_resize")){return;} 5853var $fixedTextarea;var minHeight;function resize(){$fixedTextarea.insertAfter($textarea);var heightOffset=0;var style=window.getComputedStyle($textarea[0],null);if(style.boxSizing==='border-box'){var paddingHeight=parseFloat(style.paddingTop)+parseFloat(style.paddingBottom);var borderHeight=parseFloat(style.borderTopWidth)+parseFloat(style.borderBottomWidth);heightOffset=borderHeight+paddingHeight;} 5854$fixedTextarea.width($textarea.width());$fixedTextarea.val($textarea.val());var height=$fixedTextarea[0].scrollHeight;$textarea.css({height:Math.max(height+heightOffset,minHeight)});} 5855function removeVerticalResize(){var style=window.getComputedStyle($textarea[0],null);if(style.resize==='vertical'){$textarea[0].style.resize='none';}else if(style.resize==='both'){$textarea[0].style.resize='horizontal';}} 5856options=options||{};minHeight='min_height'in options?options.min_height:50;$fixedTextarea=$('<textarea disabled>',{class:$textarea[0].className,});var direction=_t.database.parameters.direction==='rtl'?'right':'left';$fixedTextarea.css({position:'absolute',opacity:0,height:10,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:'hidden',to
5856p:-10000,}).css(direction,-10000);$fixedTextarea.data("auto_resize",true);$textarea.css({'overflow-y':'hidden'});resize();removeVerticalResize();$textarea.data("auto_resize",true);$textarea.on('input focus change',resize);if(options.parent){core.bus.on('DOM_updated',options.parent,function(){resize();removeVerticalResize();});}},closestScrollable(el){return $(el).closestScrollable()[0]||null;},compensateScrollbar(el,...rest){$(el).compensateScrollbar(...rest);},cssFind:function($from,selector,addBack){var $results;var multiParts=selector.indexOf(' ')>=0;if(multiParts){$results=$from.closest('body').find(selector).filter((i,$el)=>$from.has($el).length);}else{$results=$from.find(selector);} 5857if(addBack&&$from.is(selector)){$results=$results.add($from);} 5858return $results;},detach:function(to_detach,options){to_detach.forEach(function(d){if(d.widget.on_detach_callback){d.widget.on_detach_callback(d.callback_args);}});var $to_detach=options&&options.$to_detach;if(!$to_detach){$to_detach=$(to_detach.map(function(d){return d.widget.el;}));} 5859return $to_detach.detach();},getSelectionRange:function(node){return{start:node.selectionStart,end:node.selectionEnd,};},getPosition:function(e){var position={left:0,top:0};while(e){position.left+=e.offsetLeft;position.top+=e.offsetTop;e=e.offsetParent;} 5860return position;},getScrollingElement(){return $().getScrollingElement(...arguments)[0];},getScrollingTarget(){return $().getScrollingTarget(...arguments)[0];},hasScrollableContent(el){return $(el).hasScrollableContent();},isScrollable(el){return $(el).isScrollable();},prepend:function($target,content,options){$target.prepend(content);if(options&&options.in_DOM){_notify(content,options.callbacks);}},renderButton:function(options){var jQueryParams=_.extend({type:'button',},options.attrs||{});var extraClasses=jQueryParams.class;if(extraClasses){extraClasses=extraClasses.replace(/\boe_highlight\b/g,'btn-primary').replace(/\boe_link\b/g,'btn-link');} 5861jQueryParams.class='btn';if(options.size){jQueryParams.class+=(' btn-'+options.size);} 5862jQueryParams.class+=(' '+(extraClasses||'btn-secondary'));var $button=$('<button/>',jQueryParams);if(options.icon){if(options.icon.substr(0,3)==='fa-'){$button.append($('<i/>',{class:'fa fa-fw o_button_icon '+options.icon,}));}else{$button.append($('<img/>',{src:options.icon,}));}} 5863if(options.text){$button.append($('<span/>',{text:options.text,}));} 5864return $button;},renderCheckbox:function(options){var id=_.uniqueId('checkbox-');var $container=$('<div/>',{class:'form-check',});var $input=$('<input/>',{type:'checkbox',id:id,class:'form-check-input',});var $label=$('<label/>',{for:id,class:'form-check-label',text:options&&options.text||'',});if(!options||!options.text){$label.html('​');} 5865if(options&&options.prop){$input.prop(options.prop);} 5866if(options&&options.role){$input.attr('role',options.role);} 5867return $container.append($input,$label);},setSelectionRange:function(node,range){if(node.setSelectionRange){node.setSelectionRange(range.start,range.end);}else if(node.createTextRange){node.createTextRange().collapse(true).moveEnd('character',range.start).moveStart('character',range.end).select();}},scrollFixedOffset(document=window.document){let size=0;for(const el of document.querySelectorAll('.o_top_fixed_element')){size+=$(el).outerHeight();} 5868return size;},scrollTo(el,options={}){if(!el){throw new Error("The scrollTo function was called without any given element");} 5869const $el=$(el);if(typeof(el)==='string'&&$el[0]){el=$el[0];} 5870const isTopOrBottomHidden=(el==='#top'||el==='#bottom');const $scrollable=isTopOrBottomHidden?$().getScrollingElement():(options.$scrollable||$el.parent().closestScrollable());const scrollDocument=$scrollable[0].ownerDocument;const isInOneDocument=isTopOrBottomHidden||scrollDocument===$el[0].ownerDocument;const $iframe=!isInOneDocument&&$scrollable.find('iframe').filter((i,node)=>$(node).contents().has($el));const $topLevelScrollable=$().getScrollingElement(scrollDocument);const isTopScroll=$scrollable.is($topLevelScrollable);function _computeScrollTop(){if(el==='#top'||el.id==='top'){return 0;} 5871if(el==='#bottom'||el.id==='bottom'){return $scrollable[0].scrollHeight-$scrollable[0].clientHeight;} 5872let offsetTop=$el.offset().top;if(el.classList.contains('d-none')){el.classList.remove('d-none');offsetTop=$el.offset().top;el.classList.add('d-none');} 5873const isDocScrollingEl=$scrollable.is(el.ownerDocument.scrollingElement);let elPosition=offsetTop 5874-($scrollable.offset().top-(isDocScrollingEl?0:$scrollable[0].scrollTop));if(!isInOneDocument&&$iframe.length){elPosition+=$iframe.offset().top;} 5875let offset=options.forcedOffset;if(offset===undefined){offset=(isTopScroll?dom.scrollFixedOffset(scrollDocument):0)+(options.extraOffset||0);} 5876return Math.max(0,elPosition-offset);} 5877const originalScrollTop=_computeScrollTop();return new Promise(resolve=>{const clonedOptions=Object.assign({},options);clonedOptions.progress=function(a,b,remainingMs){if(options.progress){options.progress.apply(this,...arguments);} 5878const newScrollTop=_computeScrollTop();
5878if(Math.abs(newScrollTop-originalScrollTop)<=1.0&&(isTopOrBottomHidden||!(el.classList.contains('o_transitioning')))){return;} 5879$scrollable.stop();dom.scrollTo(el,Object.assign({},options,{duration:remainingMs,easing:'linear',})).then(()=>resolve());};clonedOptions.complete=function(){if(options.complete){options.complete.apply(this,...arguments);} 5880resolve();};$scrollable.animate({scrollTop:originalScrollTop},clonedOptions);});},});return dom;});; 5881 5882/* /web/static/src/legacy/js/core/local_storage.js */ 5883odoo.define('web.local_storage',function(require){'use strict';var RamStorage=require('web.RamStorage');var mixins=require('web.mixins');var storage;let localStorage;try{localStorage=window.localStorage;var uid=new Date();localStorage.setItem(uid,uid);localStorage.removeItem(uid);storage=(function(){var storage=Object.create(_.extend({getItem:localStorage.getItem.bind(localStorage),setItem:localStorage.setItem.bind(localStorage),removeItem:localStorage.removeItem.bind(localStorage),clear:localStorage.clear.bind(localStorage),},mixins.EventDispatcherMixin));storage.init();$(window).on('storage',function(e){var key=e.originalEvent.key;var newValue=e.originalEvent.newValue;try{JSON.parse(newValue);storage.trigger('storage',{key:key,newValue:newValue,});}catch(_error){}});return storage;})();}catch(_exception){console.warn('Fail to load localStorage');storage=new RamStorage();} 5884return storage;});; 5885 5886/* /web/static/src/legacy/js/core/mixins.js */ 5887odoo.define('web.mixins',function(require){"use strict";var Class=require('web.Class');var utils=require('web.utils');var ParentedMixin={__parentedMixin:true,init:function(){this.__parentedDestroyed=false;this.__parentedChildren=[];this.__parentedParent=null;},setParent:function(parent){if(this.getParent()){if(this.getParent().__parentedMixin){this.getParent().__parentedChildren=_.without(this.getParent().getChildren(),this);}} 5888this.__parentedParent=parent;if(parent&&parent.__parentedMixin){parent.__parentedChildren.push(this);}},getParent:function(){return this.__parentedParent;},getChildren:function(){return _.clone(this.__parentedChildren);},isDestroyed:function(){return this.__parentedDestroyed;},alive:function(promise,shouldReject){var self=this;return new Promise(function(resolve,reject){promise.then(function(result){if(!self.isDestroyed()){resolve(result);}else if(shouldReject){reject();}}).guardedCatch(function(reason){if(!self.isDestroyed()){reject(reason);}else if(shouldReject){reject();}});});}
5888,destroy:function(){this.getChildren().forEach(function(child){child.destroy();});this.setParent(undefined);this.__parentedDestroyed=true;},findAncestor:function(predicate){var ancestor=this;while(ancestor&&!(predicate(ancestor))&&ancestor.getParent){ancestor=ancestor.getParent();} 5889return ancestor;},};function OdooEvent(target,name,data){this.target=target;this.name=name;this.data=Object.create(null);_.extend(this.data,data);this.stopped=false;} 5890OdooEvent.prototype.stopPropagation=function(){this.stopped=true;};OdooEvent.prototype.is_stopped=function(){return this.stopped;};var Events=Class.extend({on:function(events,callback,context){var ev;events=events.split(/\s+/);var calls=this._callbacks||(this._callbacks={});while((ev=events.shift())){var list=calls[ev]||(calls[ev]={});var tail=list.tail||(list.tail=list.next={});tail.callback=callback;tail.context=context;list.tail=tail.next={};} 5891return this;},off:function(events,callback,context){var ev,calls,node;if(!events){delete this._callbacks;}else if((calls=this._callbacks)){events=events.split(/\s+/);while((ev=events.shift())){node=calls[ev];delete calls[ev];if(!callback||!node) 5892continue;while((node=node.next)&&node.next){if(node.callback===callback&&(!context||node.context===context)) 5893continue;this.on(ev,node.callback,node.context);}}} 5894return this;},callbackList:function(){var lst=[];_.each(this._callbacks||{},function(el,eventName){var node=el;while((node=node.next)&&node.next){lst.push([eventName,node.callback,node.context]);}});return lst;},trigger:function(events){var event,node,calls,tail,args,all,rest;if(!(calls=this._callbacks)) 5895return this;all=calls.all;(events=events.split(/\s+/)).push(null);while((event=events.shift())){if(all) 5896events.push({next:all.next,tail:all.tail,event:event});if(!(node=calls[event])) 5897continue;events.push({next:node.next,tail:node.tail});} 5898rest=Array.prototype.slice.call(arguments,1);while((node=events.pop())){tail=node.tail;args=node.event?[node.event].concat(rest):rest;while((node=node.next)!==tail){node.callback.apply(node.context||this,args);}} 5899return this;}});var EventDispatcherMixin=_.extend({},ParentedMixin,{__eventDispatcherMixin:true,custom_events:{},init:function(){ParentedMixin.init.call(this);this.__edispatcherEvents=new Events();this.__edispatcherRegisteredEvents=[];this._delegateCustomEvents();},proxy:function(method){var self=this;return function(){var fn=(typeof method==='string')?self[method]:method;if(fn===void 0){throw new Error("Couldn't find method '"+method+"' in widget "+self);} 5900return fn.apply(self,arguments);};},_delegateCustomEvents:function(){if(_.isEmpty(this.custom_events)){return;} 5901for(var key in this.custom_events){if(!this.custom_events.hasOwnProperty(key)){continue;} 5902var method=this.proxy(this.custom_events[key]);this.on(key,this,method);}},on:function(events,dest,func){var self=this;if(typeof func!=="function"){throw new Error("Event handler must be a function.");} 5903events=events.split(/\s+/);_.each(events,function(eventName){self.__edispatcherEvents.on(eventName,func,dest);if(dest&&dest.__eventDispatcherMixin){dest.__edispatcherRegisteredEvents.push({name:eventName,func:func,source:self});}});return this;},off:function(events,dest,func){var self=this;events=events.split(/\s+/);_.each(events,function(eventName){self.__edispatcherEvents.off(eventName,func,dest);if(dest&&dest.__eventDispatcherMixin){dest.__edispatcherRegisteredEvents=_.filter(dest.__edispatcherRegisteredEvents,function(el){return!(el.name===eventName&&el.func===func&&el.source===self);});}});return this;},once:function(events,dest,func){var self=this;if(typeof func!=="function"){throw new Error("Event handler must be a function.");} 5904self.on(events,dest,function what(){func.apply(this,arguments);self.off(events,dest,what);});},trigger:function(){this.__edispatcherEvents.trigger.apply(this.__edispatcherEvents,arguments);return this;},trigger_up:function(name,info){var event=new OdooEvent(this,name,info);this._trigger_up(event);return event;},_trigger_up:function(event){var parent;this.__edispatcherEvents.trigger(event.name,event);if(!event.is_stopped()&&(parent=this.getParent())){parent._trigger_up(event);}},destroy:function(){var self=this;_.each(this.__edispatcherRegisteredEvents,function(event){event.source.__edispatcherEvents.off(event.name,event.func,self);});this.__edispatcherRegisteredEvents=[];_.each(this.__edispatcherEvents.callbackList(),function(cal){this.off(cal[0],cal[2],cal[1]);},this);this.__edispatcherEvents.off();ParentedMixin.destroy.call(this);}});var PropertiesMixin=_.extend({},EventDispatcherMixin,{init:function(){EventDispatcherMixin.init.call(this);this.__getterSetterInternalMap={};},set:function(arg1,arg2,arg3){var map;var options;
5904if(typeof arg1==="string"){map={};map[arg1]=arg2;options=arg3||{};}else{map=arg1;options=arg2||{};} 5905var self=this;var changed=false;_.each(map,function(val,key){var tmp=self.__getterSetterInternalMap[key];if(tmp===val) 5906return;if(key==='value'&&self.field&&self.field.type==='float'&&tmp&&val){var digits=self.field.digits;if(_.isArray(digits)){if(utils.float_is_zero(tmp-val,digits[1])){return;}}} 5907changed=true;self.__getterSetterInternalMap[key]=val;if(!options.silent) 5908self.trigger("change:"+key,self,{oldValue:tmp,newValue:val});});if(changed) 5909self.trigger("change",self);},get:function(key){return this.__getterSetterInternalMap[key];}});return{ParentedMixin:ParentedMixin,EventDispatcherMixin:EventDispatcherMixin,PropertiesMixin:PropertiesMixin,};});; 5910 5911/* /web/static/src/legacy/js/core/qweb.js */ 5912odoo.define('web.QWeb',function(require){"use strict";var translation=require('web.translation');var _t=translation._t;function QWeb(debug,default_dict,enableTranslation){if(enableTranslation===undefined){enableTranslation=true;} 5913var qweb=new QWeb2.Engine();qweb.default_dict=_.extend({},default_dict||{},{'_':_,'JSON':JSON,'_t':translation._t,'__debug__':debug,'moment':function(date){return new moment(date);},'csrf_token':odoo.csrf_token,});qweb.debug=debug;qweb.preprocess_node=enableTranslation?preprocess_node:function(){};return qweb;} 5914function preprocess_node(){switch(this.node.nodeType){case Node.TEXT_NODE:case Node.CDATA_SECTION_NODE:var translation=this.node.parentNode.attributes['t-translation'];if(translation&&translation.value==='off'){return;} 5915var match=/^(\s*)([\s\S]+?)(\s*)$/.exec(this.node.data);if(match){this.node.data=match[1]+_t(match[2])+match[3];} 5916break;case Node.ELEMENT_NODE:var attr,attrs=['label','title','alt','placeholder','aria-label'];while((attr=attrs.pop())){if(this.attributes[attr]){this.attributes[attr]=_t(this.attributes[attr]);}}}} 5917return QWeb;});; 5918 5919/* /web/static/src/legacy/js/core/ram_storage.js */ 5920odoo.define('web.RamStorage',function(require){'use strict';var Class=require('web.Class');var mixins=require('web.mixins');var RamStorage=Class.extend(mixins.EventDispatcherMixin,{init:function(){mixins.EventDispatcherMixin.init.call(this);if(!this.storage){this.clear();}},clear:function(){this.storage=Object.create(null);this.length=0;},getItem:function(key){return this.storage[key];},key:function(index){return _.keys(this.storage)[index];},removeItem:function(key){if(key in this.storage){this.length--;} 5921delete this.storage[key];this.trigger('storage',{key:key,newValue:null});},setItem:function(key,value){if(!(key in this.storage)){this.length++;} 5922this.storage[key]=value;this.trigger('storage',{key:key,newValue:value});},});return RamStorage;});; 5923 5924/* /web/static/src/legacy/js/core/registry.js */ 5925odoo.define("web.Registry",function(require){"use strict";const{sortBy}=require("web.utils");class Registry{constructor(mapping,predicate=()=>true){this.map=Object.create(mapping||null);this._scoreMapping=Object.create(null);this._sortedKeys=null;this.listeners=[];this.predicate=predicate;} 5926add(key,value,score){if(!this.predicate(value)){throw new Error(`Value of key "${key}" does not pass the addition predicate.`);} 5927this._scoreMapping[key]=score===undefined?key:score;this._sortedKeys=null;this.map[key]=value;for(const callback of this.listeners){callback(key,value);} 5928return this;} 5929contains(key){return key in this.map;} 5930entries(){const entries={};const keys=this.keys();for(const key of keys){entries[key]=this.map[key];} 5931return entries;} 5932get(key){return this.map[key];} 5933getAny(keys){for(const key of keys){if(key in this.map){return this.map[key];}} 5934return null;} 5935keys(){if(!this._sortedKeys){const keys=[];for(const key in this.map){keys.push(key);} 5936this._sortedKeys=sortBy(keys,key=>this._scoreMapping[key]||0);} 5937return this._sortedKeys;} 5938onAdd(callback){this.listeners.push(callback);} 5939values(){return this.keys().map((key)=>this.map[key]);}} 5940return Registry;});; 5941 5942/* /web/static/src/legacy/js/core/rpc.js */ 5943odoo.define('web.rpc',function(require){"use strict";var ajax=require('web.ajax');const rpc={query:function(params,options){var query=rpc.buildQuery(params);return ajax.rpc(query.route,query.params,options);},buildQuery:function(options){var route;var params=options.params||{};var orderBy;if(options.route){route=options.route;}else if(options.model&&options.method){route='/web/dataset/call_kw/'+options.model+'/'+options.method;} 5944if(options.method){params.args=options.args||[];params.model=options.model;params.method=options.method;params.kwargs=_.extend(params.kwargs||{},options.kwargs);params.kwargs.context=options.context||params.context||params.kwargs.context;} 5945if(options.method==='read_group'||options.method==='web_read_group'){if(!(params.args&¶ms.args[0]!==undefined)){params.kwargs.domain=options.domain||params.domain||params.kwargs.domain||[];} 5946if(!(params.args&¶ms.args[1]!==undefined)){params.kwargs.fields=options.fields||params.fields||params.kwargs.fields||[];} 5947if(!(params.args&¶ms.args[2]!==undefined)){params.kwargs.groupby=options.groupBy||params.groupBy||params.kwargs.groupby||[];} 5948params.kwargs.offset=options.offset||params.offset||params.kwargs.offset;params.kwargs.limit=options.limit||params.limit||params.kwargs.limit;orderBy=options.orderBy||params.orderBy||params.kwargs.orderby;params.kwargs.orderby=orderBy?rpc._serializeSort(orderBy):orderBy;params.kwargs.lazy='lazy'in options?options.lazy:params.lazy;if(options.method==='web_read_group'){params.kwargs.expand=options.expand||params.expand||params.kwargs.expand;params.kwargs.expand_limit=options.expand_limit||params.expand_limit||params.kwargs.expand_limit;var expandOrderBy=options.expand_orderby||params.expand_orderby||params.kwargs.expand_orderby;params.kwargs.expand_orderby=expandOrderBy?rpc._serializeSort(expandOrderBy):expandOrderBy;}} 5949if(options.method==='search_read'){params.kwargs.domain=options.domain||params.domain||params.kwargs.domain;params.kwargs.fields=options.fields||params.fields||params.kwargs.fields;params.kwargs.offset=options.offset||params.offset||params.kwargs.offset;params.kwargs.limit=options.limit||params.limit||params.kwargs.limit;orderBy=options.orderBy||params.orderBy||params.kwargs.order;params.kwargs.order=orderBy?rpc._serializeSort(orderBy):orderBy;} 5950if(options.route==='/web/dataset/search_read'){params.model=options.model||params.model;params.domain=options.domain||params.domain;params.fields=options.fields||params.fields;params.limit=options.limit||params.limit;params.offset=options.offset||params.offset;orderBy=options.orderBy||params.orderBy;params.sort=orderBy?rpc._serializeSort(orderBy):orderBy;params.context=options.context||params.context||{};} 5951return{route:route,params:JSON.parse(JSON.stringify(params)),};},_serializeSort:function(orderBy){return _.map(orderBy,function(order){return order.name+(order.asc!==false?' ASC':' DESC');}).join(', ');},};return rpc;});; 5952 5953/* /web/static/src/legacy/js/core/service_mixins.js */ 5954odoo.define('web.ServiceProviderMixin',function(require){"use strict";var core=require('web.core');var ServiceProviderMixin={services:{},UndeployedServices:{},init:function(parent){var self=this;this.on('call_service',this,this._call_service.bind(this));_.each(core.serviceRegistry.map,function(Service,serviceName){if(serviceName in self.UndeployedServices){throw new Error('Service "'+serviceName+'" is already loaded.');} 5955self.UndeployedServices[serviceName]=Service;});this._deployServices();core.serviceRegistry.onAdd(function(serviceName,Service){if(serviceName in self.services||serviceName in self.UndeployedServices){throw new Error('Service "'+serviceName+'" is already loaded.');} 5956self.UndeployedServices[serviceName]=Service;self._deployServices();});},_deployServices:function(){var self=this;var done=false;while(!done){var serviceName=_.findKey(this.UndeployedServices,function(Service){return!_.some(Service.prototype.depen
5956dencies,function(depName){return!self.services[depName];});});if(serviceName){var service=new this.UndeployedServices[serviceName](this);this.services[serviceName]=service;delete this.UndeployedServices[serviceName];service.start();}else{done=true;}}},_call_service:function(event){var args=event.data.args||[];if(event.data.service==='ajax'&&event.data.method==='rpc'){args=args.concat(event.target);} 5957var service=this.services[event.data.service];var result=service[event.data.method].apply(service,args);event.data.callback(result);},};return ServiceProviderMixin;});odoo.define('web.ServicesMixin',function(require){"use strict";var rpc=require('web.rpc');var ServicesMixin={call:function(service,method){var args=Array.prototype.slice.call(arguments,2);var result;this.trigger_up('call_service',{service:service,method:method,args:args,callback:function(r){result=r;},});return result;},_rpc:function(params,options){var query=rpc.buildQuery(params);var prom=this.call('ajax','rpc',query.route,query.params,options,this);if(!prom){prom=new Promise(function(){});prom.abort=function(){};} 5958var abort=prom.abort?prom.abort:prom.reject;if(abort){prom.abort=abort.bind(prom);} 5959return prom;},loadFieldView:function(modelName,context,view_id,view_type,options){return this.loadViews(modelName,context,[[view_id,view_type]],options).then(function(result){return result[view_type];});},loadViews:function(modelName,context,views,options){var self=this;return new Promise(function(resolve){self.trigger_up('load_views',{modelName:modelName,context:context,views:views,options:options,on_success:resolve,});});},loadFilters:function(modelName,actionId,context){var self=this;return new Promise(function(resolve,reject){self.trigger_up('load_filters',{modelName:modelName,actionId:actionId,context:context,on_success:resolve,});});},createFilter:function(filter){var self=this;return new Promise(function(resolve,reject){self.trigger_up('create_filter',{filter:filter,on_success:resolve,});});},deleteFilter:function(filterId){var self=this;return new Promise(function(resolve,reject){self.trigger_up('delete_filter',{filterId:filterId,on_success:resolve,});});},getSession:function(){var session;this.trigger_up('get_session',{callback:function(result){session=result;}});return session;},do_action:function(action,options){var self=this;return new Promise(function(resolve,reject){self.trigger_up('do_action',{action:action,options:options,on_success:resolve,on_fail:(reason)=>{reject(reason);return"alreadyThrown"},});});},displayNotification:function(options){return this.call('notification','notify',options);},};return ServicesMixin;});; 5960 5961/* /web/static/src/legacy/js/core/session.js */ 5962odoo.define('web.Session',function(require){"use strict";var ajax=require('web.ajax');var core=require('web.core');var mixins=require('web.mixins');const{setCookie}=require('web.utils.cookies');const{session}=require('@web/session');const{loadJS}=require('@web/core/assets');var _t=core._t;var qweb=core.qweb;var Session=core.Class.extend(mixins.EventDispatcherMixin,{init:function(parent,origin,options){mixins.EventDispatcherMixin.init.call(this);this.setParent(parent);options=options||{};this.server=null;this.avoid_recursion=false;this.use_cors=options.use_cors||false;this.setup(origin);this.name="instance0";this.currencies={};this._groups_def={};core.bus.on('invalidate_session',this,this._onInvalidateSession);},setup:function(origin,options){var window_origin=location.protocol+"//"+location.host;origin=origin?origin.replace(/\/+$/,''):window_origin;if(!_.isUndefined(this.origin)&&this.origin!==origin) 5963throw new Error('Session already bound to '+this.origin);else 5964this.origin=origin;this.prefix=this.origin;this.server=this.origin;options=options||{};if('use_cors'in options){this.use_cors=options.use_cors;}},session_bind:function(origin){this.setup(origin);qweb.default_dict._s=this.origin;this.uid=null;this.username=null;this.user_context={};this.db=null;this.active_id=null;return this.session_init();},session_init:function(){var self=this;var prom=this.session_reload();if(this.is_frontend||this.is_report){return prom.then(function(){return self.load_translations();});} 5965return prom.then(function(){var promise=self.load_qweb();if(self.session_is_valid()){return promise.then(function(){return self.load_modules();});} 5966return Promise.all([promise,self.rpc('/web/webclient/bootstrap_translations').then(function(trans){_t.database.set_bundle(trans);})]);});},session_is_valid:function(){var db=$.deparam.querystring().db;if(db&&this.db!==db){return false;} 5967return!!this.uid;},session_authenticate:function(){var self=this;return Promise.resolve(this._session_authenticate.apply(this,arguments)).then(function(){return self.load_modules();});},_session_authenticate:function(db,login,password){var self=this;var params={db:db,login:login,password:password};
5967return this.rpc("/web/session/authenticate",params).then(function(result){if(!result.uid){return Promise.reject();} 5968_.extend(self,result);});},session_logout:function(){$.bbq.removeState();return this.rpc("/web/session/destroy",{});},user_has_group:function(group){if(!this.uid&&!this.user_id){return Promise.resolve(false);} 5969var def=this._groups_def[group];if(!def){def=this._groups_def[group]=this.rpc('/web/dataset/call_kw/res.users/has_group',{"model":"res.users","method":"has_group","args":[group],"kwargs":{}});} 5970return def;},get_cookie:function(name){if(!this.name){return null;} 5971var nameEQ=this.name+'|'+name+'=';var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;++i){var cookie=cookies[i].replace(/^\s*/,'');if(cookie.indexOf(nameEQ)===0){try{return JSON.parse(decodeURIComponent(cookie.substring(nameEQ.length)));}catch(_err){this.set_cookie(name,'',-1);}}} 5972return null;},set_cookie(name,value,ttl,type='required'){if(!this.name){return;} 5973ttl=ttl||24*60*60*365;setCookie(this.name+'|'+name,value,ttl,type);},load_modules:function(){var self=this;var loaded=Promise.resolve(self.load_translations());var locale="/web/webclient/locale/"+self.user_context.lang||'en_US';var file_list=[locale];return loaded.then(function(){return self.load_js(file_list);}).then(function(){self._configureLocale();});},load_translations:function(modules=null){var lang=this.user_context.lang 5974var html=document.documentElement,htmlLang=html.getAttribute('lang');if(!this.user_context.lang&&htmlLang){lang=htmlLang.replace('-','_');} 5975return _t.database.load_translations(this,modules,lang,this.translationURL);},load_js:function(files){var self=this;return new Promise(function(resolve,reject){if(files.length!==0){var file=files.shift();var url=self.url(file,null);loadJS(url).then(resolve);}else{resolve();}});},load_qweb:async function(){await odoo.ready(/\.bundle\.xml$/);},get_currency:function(currency_id){return this.currencies[currency_id];},get_file:function(options){options.session=this;return ajax.get_file(options);},session_reload:function(){var result=_.extend({},session);_.extend(this,result);return Promise.resolve();},rpc:function(url,params,options){var self=this;options=_.clone(options||{});options.headers=_.extend({},options.headers);if(params&¶ms.kwargs){params.kwargs.context=_.extend(params.kwargs.context||{},this.user_context);} 5976if(!_.isString(url)){_.extend(options,url);url=url.url;} 5977if(self.use_cors){url=self.url(url,null);} 5978return ajax.jsonRpc(url,"call",params,options);},url:function(path,params){params=_.extend(params||{});var qs=$.param(params);if(qs.length>0) 5979qs="?"+qs;var prefix=_.any(['http://','https://','//'],function(el){return path.length>=el.length&&path.slice(0,el.length)===el;})?'':this.prefix;return prefix+path+qs;},getTZOffset:function(date){return-new Date(new Date(date).toISOString().replace('Z','')).getTimezoneOffset();},invalidateCacheKey:function(key){if(this.cache_hashes&&this.cache_hashes[key]){this.cache_hashes[key]=Date.now();}},reloadCurrencies:function(){var self=this;
5979return this.rpc('/web/session/get_session_info').then(function(result){self.currencies=result.currencies;});},setCompanies:function(main_company_id,company_ids){var hash=$.bbq.getState();hash.cids=company_ids.sort(function(a,b){if(a===main_company_id){return-1;}else if(b===main_company_id){return 1;}else{return a-b;}}).join(',');setCookie('cids',hash.cids||String(main_company_id),24*60*60*365,'required');$.bbq.pushState({'cids':hash.cids},0);location.reload();},_configureLocale:function(){const dow=(_t.database.parameters.week_start||0)%7;moment.updateLocale(moment.locale(),{week:{dow:dow,doy:7+dow-4},});},_onInvalidateSession:function(){this.uid=false;},});return Session;});; 5980 5981/* /web/static/src/legacy/js/core/session_storage.js */ 5982odoo.define('web.sessionStorage',function(require){'use strict';var RamStorage=require('web.RamStorage');var mixins=require('web.mixins');var storage;let sessionStorage;try{sessionStorage=window.sessionStorage;var uid=new Date();sessionStorage.setItem(uid,uid);sessionStorage.removeItem(uid);storage=(function(){var storage=Object.create(_.extend({getItem:sessionStorage.getItem.bind(sessionStorage),setItem:sessionStorage.setItem.bind(sessionStorage),removeItem:sessionStorage.removeItem.bind(sessionStorage),clear:sessionStorage.clear.bind(sessionStorage),},mixins.EventDispatcherMixin));storage.init();$(window).on('storage',function(e){var key=e.originalEvent.key;var newValue=e.originalEvent.newValue;try{JSON.parse(newValue);if(sessionStorage.getItem(key)===newValue){storage.trigger('storage',{key:key,newValue:newValue,});}}catch(_error){}});return storage;})();}catch(_exception){console.warn('Fail to load sessionStorage');storage=new RamStorage();} 5983return storage;});; 5984 5985/* /web/static/src/legacy/js/core/time.js */ 5986odoo.define('web.time',function(require){"use strict";var translation=require('web.translation');var utils=require('web.utils');var lpad=utils.lpad;var rpad=utils.rpad;var _t=translation._t;function date_to_utc(k,v){var value=this[k];if(!(value instanceof Date)){return v;} 5987return datetime_to_str(value);} 5988function str_to_datetime(str){if(!str){return str;} 5989var regex=/^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d(?:\.(\d+))?)$/;var res=regex.exec(str);if(!res){throw new Error("'"+str+"' is not a valid datetime");} 5990var tmp=new Date(2000,0,1);tmp.setUTCMonth(1970);tmp.setUTCMonth(0);tmp.setUTCDate(1);tmp.setUTCFullYear(parseFloat(res[1]));tmp.setUTCMonth(parseFloat(res[2])-1);tmp.setUTCDate(parseFloat(res[3]));tmp.setUTCHours(parseFloat(res[4]));tmp.setUTCMinutes(parseFloat(res[5]));tmp.setUTCSeconds(parseFloat(res[6]));tmp.setUTCSeconds(parseFloat(res[6]));tmp.setUTCMilliseconds(parseFloat(utils.rpad((res[7]||"").slice(0,3),3)));return tmp;} 5991function str_to_date(str){if(!str){return str;} 5992var regex=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;var res=regex.exec(str);if(!res){throw new Error("'"+str+"' is not a valid date");} 5993var tmp=new Date(2000,0,1);tmp.setFullYear(parseFloat(res[1]));tmp.setMonth(parseFloat(res[2])-1);tmp.setDate(parseFloat(res[3]));tmp.setHours(0);tmp.setMinutes(0);tmp.setSeconds(0);return tmp;} 5994function str_to_time(str){if(!str){return str;} 5995var regex=/^(\d\d):(\d\d):(\d\d(?:\.(\d+))?)$/;var res=regex.exec(str);if(!res){throw new Error("'"+str+"' is not a valid time");} 5996var tmp=new Date();tmp.setFullYear(1970);tmp.setMonth(0);tmp.setDate(1);tmp.setHours(parseFloat(res[1]));tmp.setMinutes(parseFloat(res[2]));tmp.setSeconds(parseFloat(res[3]));tmp.setMilliseconds(parseFloat(rpad((res[4]||"").slice(0,3),3)));return tmp;} 5997function datetime_to_str(obj){if(!obj){return false;} 5998return lpad(obj.getUTCFullYear(),4)+"-"+lpad(obj.getUTCMonth()+1,2)+"-" 5999+lpad(obj.getUTCDate(),2)+" "+lpad(obj.getUTCHours(),2)+":" 6000+lpad(obj.getUTCMinutes(),2)+":"+lpad(obj.getUTCSeconds(),2);} 6001function date_to_str(obj){if(!obj){return false;} 6002return lpad(obj.getFullYear(),4)+"-"+lpad(obj.getMonth()+1,2)+"-" 6003+lpad(obj.getDate(),2);} 6004function time_to_str(obj){if(!obj){return false;} 6005return lpad(obj.getHours(),2)+":"+lpad(obj.getMinutes(),2)+":" 6006+lpad(obj.getSeconds(),2);} 6007function auto_str_to_date(value){try{return str_to_datetime(value);}catch(_e){} 6008try{return str_to_date(value);}catch(_e){} 6009try{return str_to_time(value);}catch(_e){} 6010throw new Error(_.str.sprintf(_t("'%s' is not a correct date, datetime nor time"),value));} 6011function auto_date_to_str(value,type){switch(type){case'datetime':return datetime_to_str(value);case'date':return date_to_str(value);case'time':return time_to_str(value);default:throw new Error(_.str.sprintf(_t("'%s' is not convertible to date, datetime nor time"),type));}} 6012function strftime_to_moment_format(value){if(_normalize_format_cache[value]===undefined){var isletter=/[a-zA-Z]/,output=[],inToken=false;for(var index=0;
6012index<value.length;++index){var character=value[index];if(character==='%'&&!inToken){inToken=true;continue;} 6013if(isletter.test(character)){if(inToken&&normalize_format_table[character]!==undefined){character=normalize_format_table[character];}else{character='['+character+']';}} 6014output.push(character);inToken=false;} 6015_normalize_format_cache[value]=output.join('');} 6016return _normalize_format_cache[value];} 6017function moment_to_strftime_format(value){var regex=/(MMMM|DDDD|dddd|YYYY|MMM|ddd|mm|ss|ww|WW|MM|YY|hh|HH|DD|A|d)/g;return value.replace(regex,function(val){return'%'+inverse_normalize_format_table[val];});} 6018var _normalize_format_cache={};var normalize_format_table={'a':'ddd','A':'dddd','b':'MMM','B':'MMMM','d':'DD','H':'HH','I':'hh','j':'DDDD','m':'MM','M':'mm','p':'A','S':'ss','U':'ww','W':'WW','w':'d','y':'YY','Y':'YYYY','c':'ddd MMM D HH:mm:ss YYYY','x':'MM/DD/YY','X':'HH:mm:ss'};var inverse_normalize_format_table=_.invert(normalize_format_table);function getLangDateFormat(){return strftime_to_moment_format(_t.database.parameters.date_format);} 6019function getLangTimeFormat(){return strftime_to_moment_format(_t.database.parameters.time_format);} 6020function getLangDatetimeFormat(){return strftime_to_moment_format(_t.database.parameters.date_format+" "+_t.database.parameters.time_format);} 6021const dateFormatWoZeroCache={};function getLangDateFormatWoZero(){const dateFormat=getLangDateFormat();if(!(dateFormat in dateFormatWoZeroCache)){dateFormatWoZeroCache[dateFormat]=dateFormat.replace('MM','M').replace('DD','D');} 6022return dateFormatWoZeroCache[dateFormat];} 6023const timeFormatWoZeroCache={};function getLangTimeFormatWoZero(){const timeFormat=getLangTimeFormat();if(!(timeFormat in timeFormatWoZeroCache)){timeFormatWoZeroCache[timeFormat]=timeFormat.replace('HH','H').replace('mm','m').replace('ss','s');} 6024return timeFormatWoZeroCache[timeFormat];} 6025return{date_to_utc:date_to_utc,str_to_datetime:str_to_datetime,str_to_date:str_to_date,str_to_time:str_to_time,datetime_to_str:datetime_to_str,date_to_str:date_to_str,time_to_str:time_to_str,auto_str_to_date:auto_str_to_date,auto_date_to_str:auto_date_to_str,strftime_to_moment_format:strftime_to_moment_format,moment_to_strftime_format:moment_to_strftime_format,getLangDateFormat:getLangDateFormat,getLangTimeFormat:getLangTimeFormat,getLangDateFormatWoZero:getLangDateFormatWoZero,getLangTimeFormatWoZero:getLangTimeFormatWoZero,getLangDatetimeFormat:getLangDatetimeFormat,};});; 6026 6027/* /web/static/src/legacy/js/core/translation.js */ 6028odoo.define('web.translation',function(require){"use strict";var Class=require('web.Class');const{_lt}=require("@web/core/l10n/translation");var TranslationDataBase=Class.extend({init:function(){this.db={};this.multi_lang=false 6029this.parameters={"direction":'ltr',"date_format":'%m/%d/%Y',"time_format":'%H:%M:%S',"grouping":[],"decimal_point":".","thousands_sep":",","code":"en_US"};},set_bundle:function(translation_bundle){var self=this;this.multi_lang=translation_bundle.multi_lang 6030var modules=_.keys(translation_bundle.modules);modules.sort();if(_.include(modules,"web")){modules=["web"].concat(_.without(modules,"web"));} 6031_.each(modules,function(name){self.add_module_translation(translation_bundle.modules[name]);});if(translation_bundle.lang_parameters){this.parameters=translation_bundle.lang_parameters;this.parameters.grouping=JSON.parse(this.parameters.grouping);}},add_module_translation:function(mod){var self=this;_.each(mod.messages,function(message){self.db[message.id]=message.string;});},build_translation_function:function(){var self=this;var fcnt=function(str){var tmp=self.get(str);return tmp===undefined?str:tmp;};fcnt.database=this;return fcnt;},get:function(key){return this.db[key];},load_translations:function(session,modules,lang,url){var self=this;var cacheId=session.cache_hashes&&session.cache_hashes.translations;url=url||new URL("/web/webclient/translations",session.origin||location.origin).href;url+='/'+(cacheId?cacheId:Date.now());const paramsGet={};if(modules){paramsGet.mods=modules.join(',');} 6032if(lang){paramsGet.lang=lang;}else if(session.is_frontend&&session.lang_url_code){paramsGet.unique=session.lang_url_code;} 6033return $.get(url,paramsGet).then(function(trans){self.set_bundle(trans);});}});var _t=new TranslationDataBase().build_translation_function();{_t('less than a minute ago');_t('about a minute ago');_t('%d minutes ago');_t('about an hour ago');_t('%d hours ago');_t('a day ago');_t('%d days ago');_t('about a month ago');_t('%d months ago');_t('about a year ago');_t('%d years ago');} 6034return{_t:_t,_lt:_lt,TranslationDataBase:TranslationDataBase,};});; 6035 6036/* /web/static/src/legacy/js/core/utils.js */ 6037odoo.define('web.utils',function(require){"use strict";var translation=require('web.translation');const{Component}=require("@odoo/owl");var _t=translation._t;var id=-1;var diacriticsMap={'\u0041':'A','\u24B6':'A','\uFF21':'A','\u00C0':'A','\u00C1':'A','\u00C2':'A','\u1EA6':'A','\u1EA4':'A','\u1EAA':'A','\u1EA8':'A','\u00C3':'A','\u0100':'A','\u0102':'A','\u1EB0':'A','\u1EAE':'A','\u1EB4':'A','\u1EB2':'A','\u0226':'A','\u01E0':'A','\u00C4':'A','\u01DE':'A','\u1EA2':'A','\u00C5':'A','\u01FA':'A','\u01CD':'A','\u0200':'A','\u0202':'A','\u1EA0':'A','\u1EAC':'A','\u1EB6':'A','\u1E00':'A','\u0104':'A','\u023A':'A','\u2C6F':'A','\uA732':'AA','\u00C6':'AE','\u01FC':'AE','\u01E2':'AE','\uA734':'AO','\uA736':'AU','\uA738':'AV','\uA73A':'AV','\uA73C':'AY','\u0042':'B','\u24B7':'B','\uFF22':'B','\u1E02':'B','\u1E04':'B','\u1E06':'B','\u0243':'B','\u0182':'B','\u0181':'B','\u0043':'C','\u24B8':'C','\uFF23':'C','\u0106':'C','\u0108':'C','\u010A':'C','\u010C':'C','\u00C7':'C','\u1E08':'C','\u0187':'C','\u023B':'C','\uA73E':'C','\u0044':'D','\u24B9':'D','\uFF24':'D','\u1E0A':'D','\u010E':'D','\u1E0C':'D','\u1E10':'D','\u1E12':'D','\u1E0E':'D','\u0110':'D','\u018B':'D','\u018A':'D','\u0189':'D','\uA779':'D','\u01F1':'DZ','\u01C4':'DZ','\u01F2':'Dz','\u01C5':'Dz','\u0045':'E','\u24BA':'E','\uFF25':'E','\u00C8':'E','\u00C9':'E','\u00CA':'E','\u1EC0':'E','\u1EBE':'E','\u1EC4':'E','\u1EC2':'E','\u1EBC':'E','\u0112':'E','\u1E14':'E','\u1E16':'E','\u0114':'E','\u0116':'E','\u00CB':'E','\u1EBA':'E','\u011A':'E','\u0204':'E','\u0206':'E','\u1EB8':'E','\u1EC6':'E','\u0228':'E','\u1E1C':'E','\u0118':'E','\u1E18':'E','\u1E1A':'E','\u0190':'E','\u018E':'E','\u0046':'F','\u24BB':'F','\uFF26':'F','\u1E1E':'F','\u0191':'F','\uA77B':'F','\u0047':'G','\u24BC':'G','\uFF27':'G','\u01F4':'G','\u011C':'G','\u1E20':'G','\u011E':'G','\u0120':'G','\u01E6':'G','\u0122':'G','\u01E4':'G','\u0193':'G','\uA7A0':'G','\uA77D':'G','\uA77E':'G','\u0048':'H','\u24BD':'H','\uFF28':'H','\u0124':'H','\u1E22':'H','\u1E26':'H','\u021E':'H','\u1E24':'H','\u1E28':'H','\u1E2A':'H','\u0126':'H','\u2C67':'H','\u2C75':'H','\uA78D':'H','\u0049':'I','\u24BE':'I','\uFF29':'I','\u00CC':'I','\u00CD':'I','\u00CE':'I','\u0128':'I','\u012A':'I','\u012C':'I','\u0130':'I','\u00CF':'I','\u1E2E':'I','\u1EC8':'I','\u01CF':'I','\u0208':'I','\u020A':'I','\u1ECA':'I','\u012E':'I','\u1E2C':'I','\u0197':'I','\u004A':'J','\u24BF':'J','\uFF2A':'J','\u0134':'J','\u0248':'J','\u004B':'K','\u24C0':'K','\uFF2B':'K','\u1E30':'K','\u01E8':'K','\u1E32':'K','\u0136':'K','\u1E34':'K','\u0198':'K','\u2C69':'K','\uA740':'K','\uA742':'K','\uA744':'K','\uA7A2':'K','\u004C':'L','\u24C1':'L','\uFF2C':'L','\u013F':'L','\u0139':'L','\u013D':'L','\u1E36':'L','\u1E38':'L','\u013B':'L','\u1E3C':'L','\u1E3A':'L','\u0141':'L','\u023D':'L','\u2C62':'L','\u2C60':'L','\uA748':'L','\uA746':'L','\uA780':'L','\u01C7':'LJ','\u01C8':'Lj','\u004D':'M','\u24C2':'M','\uFF2D':'M','\u1E3E':'M','\u1E40':'M','\u1E42':'M','\u2C6E':'M','\u019C':'M','\u004E':'N','\u24C3':'N','\uFF2E':'N','\u01F8':'N','\u0143':'N','\u00D1':'N','\u1E44':'N','\u0147':'N','\u1E46':'N','\u0145':'N','\u1E4A':'N','\u1E48':'N','\u0220':'N','\u019D':'N','\uA790':'N','\uA7A4':'N','\u01CA':'NJ','\u01CB':'Nj','\u004F':'O','\u24C4':'O','\uFF2F':'O','\u00D2':'O','\u00D3':'O','\u00D4':'O','\u1ED2':'O','\u1ED0':'O','\u1ED6':'O','\u1ED4':'O','\u00D5':'O','\u1E4C':'O','\u022C':'O','\u1E4E':'O','\u014C':'O','\u1E50':'O','\u1E52':'O','\u014E':'O','\u022E':'O','\u0230':'O','\u00D6':'O','\u022A':'O','\u1ECE':'O','\u0150':'O','\u01D1':'O','\u020C':'O','\u020E':'O','\u01A0':'O','\u1EDC':'O','\u1EDA':'O','\u1EE0':'O','\u1EDE':'O','\u1EE2':'O','\u1ECC':'O','\u1ED8':'O','\u01EA':'O','\u01EC':'O','\u00D8':'O','\u01FE':'O','\u0186':'O','\u019F':'O','\uA74A':'O','\uA74C':'O','\u01A2':'OI','\uA74E':'OO','\u0222':'OU','\u0050':'P','\u24C5':'P','\uFF30':'P','\u1E54':'P','\u1E56':'P','\u01A4':'P','\u2C63':'P','\uA750':'P','\uA752':'P','\uA754':'P','\u0051':'Q','\u24C6':'Q','\uFF31':'Q','\uA756':'Q','\uA758':'Q','\u024A':'Q','\u0052':'R','\u24C7':'R','\uFF32':'R','\u0154':'R','\u1E58':'R','\u0158':'R','\u0210':'R','\u0212':'R','\u1E5A':'R','\u1E5C':'R','\u0156':'R','\u1E5E':'R','\u024C':'R','\u2C64':'R','\uA75A':'R','\uA7A6':'R','\uA782':'R','\u0053':'S','\u24C8':'S','\uFF33':'S','\u1E9E':'S','\u015A':'S','\u1E64':'S','\u015C':'S','\u1E60':'S','\u0160':'S','\u1E66':'S','\u1E62':'S','\u1E68':'S','\u0218':'S','\u015E':'S','\u2C7E':'S','\uA7A8':'S','\uA784':'S','\u0054':'T','\u24C9':'T','\uFF34':'T','\u1E6A':'T','\u0164':'T','\u1E6C':'T','\u021A':'T','\u0162':'T','\u1E70':'T','\u1E6E':'T','\u0166':'T','\u01AC':'T','\u01AE':'T','\u023E':'T','\uA786':'T','\uA728':'TZ','\u0055':'U','\u24CA':'U','\uFF35':'U','\u00D9':'U','\u00DA':'U','\u00DB':'U','\u0168':'U','\u1E78':'U','\u016A':'U','\u1E7A':'U','\u016C':'U','\u00DC':'U','\u01DB':'U','\u01D7':'U','\u01D5':'U','\u01D9':'U','\u1EE6':'U','\u016E':'U','\u0170':'U','\u01D3':'U','\u0214':'U','\u0216':'U','\u01AF':'U','\u1EEA':'U','\u1EE8':'U','\u1EEE':'U','\u1EEC':'U','\u1EF0':'U','\u1EE4':'U','\u1E72':'U','\u0172':'U','\u1E76':'U','\u1E74':'U','\u0244':'U','\u0056':'V','\u24CB':'V','\uFF36':'V','\u1E7C':'V','\u1E7E':'V','\u01B2':'V','\uA75E':'V','\u0245':'V','\uA760':'VY','\u0057':'W','\u24CC':'W','\uFF37':'W','\u1E80':'W','\u1E82':'W','\u0174':'W','\u1E86':'W','\u1E84':'W','\u1E88':'W','\u2C72':'W','\u0058':'
6037X','\u24CD':'X','\uFF38':'X','\u1E8A':'X','\u1E8C':'X','\u0059':'Y','\u24CE':'Y','\uFF39':'Y','\u1EF2':'Y','\u00DD':'Y','\u0176':'Y','\u1EF8':'Y','\u0232':'Y','\u1E8E':'Y','\u0178':'Y','\u1EF6':'Y','\u1EF4':'Y','\u01B3':'Y','\u024E':'Y','\u1EFE':'Y','\u005A':'Z','\u24CF':'Z','\uFF3A':'Z','\u0179':'Z','\u1E90':'Z','\u017B':'Z','\u017D':'Z','\u1E92':'Z','\u1E94':'Z','\u01B5':'Z','\u0224':'Z','\u2C7F':'Z','\u2C6B':'Z','\uA762':'Z','\u0061':'a','\u24D0':'a','\uFF41':'a','\u1E9A':'a','\u00E0':'a','\u00E1':'a','\u00E2':'a','\u1EA7':'a','\u1EA5':'a','\u1EAB':'a','\u1EA9':'a','\u00E3':'a','\u0101':'a','\u0103':'a','\u1EB1':'a','\u1EAF':'a','\u1EB5':'a','\u1EB3':'a','\u0227':'a','\u01E1':'a','\u00E4':'a','\u01DF':'a','\u1EA3':'a','\u00E5':'a','\u01FB':'a','\u01CE':'a','\u0201':'a','\u0203':'a','\u1EA1':'a','\u1EAD':'a','\u1EB7':'a','\u1E01':'a','\u0105':'a','\u2C65':'a','\u0250':'a','\uA733':'aa','\u00E6':'ae','\u01FD':'ae','\u01E3':'ae','\uA735':'ao','\uA737':'au','\uA739':'av','\uA73B':'av','\uA73D':'ay','\u0062':'b','\u24D1':'b','\uFF42':'b','\u1E03':'b','\u1E05':'b','\u1E07':'b','\u0180':'b','\u0183':'b','\u0253':'b','\u0063':'c','\u24D2':'c','\uFF43':'c','\u0107':'c','\u0109':'c','\u010B':'c','\u010D':'c','\u00E7':'c','\u1E09':'c','\u0188':'c','\u023C':'c','\uA73F':'c','\u2184':'c','\u0064':'d','\u24D3':'d','\uFF44':'d','\u1E0B':'d','\u010F':'d','\u1E0D':'d','\u1E11':'d','\u1E13':'d','\u1E0F':'d','\u0111':'d','\u018C':'d','\u0256':'d','\u0257':'d','\uA77A':'d','\u01F3':'dz','\u01C6':'dz','\u0065':'e','\u24D4':'e','\uFF45':'e','\u00E8':'e','\u00E9':'e','\u00EA':'e','\u1EC1':'e','\u1EBF':'e','\u1EC5':'e','\u1EC3':'e','\u1EBD':'e','\u0113':'e','\u1E15':'e','\u1E17':'e','\u0115':'e','\u0117':'e','\u00EB':'e','\u1EBB':'e','\u011B':'e','\u0205':'e','\u0207':'e','\u1EB9':'e','\u1EC7':'e','\u0229':'e','\u1E1D':'e','\u0119':'e','\u1E19':'e','\u1E1B':'e','\u0247':'e','\u025B':'e','\u01DD':'e','\u0066':'f','\u24D5':'f','\uFF46':'f','\u1E1F':'f','\u0192':'f','\uA77C':'f','\u0067':'g','\u24D6':'g','\uFF47':'g','\u01F5':'g','\u011D':'g','\u1E21':'g','\u011F':'g','\u0121':'g','\u01E7':'g','\u0123':'g','\u01E5':'g','\u0260':'g','\uA7A1':'g','\u1D79':'g','\uA77F':'g','\u0068':'h','\u24D7':'h','\uFF48':'h','\u0125':'h','\u1E23':'h','\u1E27':'h','\u021F':'h','\u1E25':'h','\u1E29':'h','\u1E2B':'h','\u1E96':'h','\u0127':'h','\u2C68':'h','\u2C76':'h','\u0265':'h','\u0195':'hv','\u0069':'i','\u24D8':'i','\uFF49':'i','\u00EC':'i','\u00ED':'i','\u00EE':'i','\u0129':'i','\u012B':'i','\u012D':'i','\u00EF':'i','\u1E2F':'i','\u1EC9':'i','\u01D0':'i','\u0209':'i','\u020B':'i','\u1ECB':'i','\u012F':'i','\u1E2D':'i','\u0268':'i','\u0131':'i','\u006A':'j','\u24D9':'j','\uFF4A':'j','\u0135':'j','\u01F0':'j','\u0249':'j','\u006B':'k','\u24DA':'k','\uFF4B':'k','\u1E31':'k','\u01E9':'k','\u1E33':'k','\u0137':'k','\u1E35':'k','\u0199':'k','\u2C6A':'k','\uA741':'k','\uA743':'k','\uA745':'k','\uA7A3':'k','\u006C':'l','\u24DB':'l','\uFF4C':'l','\u0140':'l','\u013A':'l','\u013E':'l','\u1E37':'l','\u1E39':'l','\u013C':'l','\u1E3D':'l','\u1E3B':'l','\u017F':'l','\u0142':'l','\u019A':'l','\u026B':'l','\u2C61':'l','\uA749':'l','\uA781':'l','\uA747':'l','\u01C9':'lj','\u006D':'m','\u24DC':'m','\uFF4D':'m','\u1E3F':'m','\u1E41':'m','\u1E43':'m','\u0271':'m','\u026F':'m','\u006E':'n','\u24DD':'n','\uFF4E':'n','\u01F9':'n','\u0144':'n','\u00F1':'n','\u1E45':'n','\u0148':'n','\u1E47':'n','\u0146':'n','\u1E4B':'n','\u1E49':'n','\u019E':'n','\u0272':'n','\u0149':'n','\uA791':'n','\uA7A5':'n','\u01CC':'nj','\u006F':'o','\u24DE':'o','\uFF4F':'o','\u00F2':'o','\u00F3':'o','\u00F4':'o','\u1ED3':'o','\u1ED1':'o','\u1ED7':'o','\u1ED5':'o','\u00F5':'o','\u1E4D':'o','\u022D':'o','\u1E4F':'o','\u014D':'o','\u1E51':'o','\u1E53':'o','\u014F':'o','\u022F':'o','\u0231':'o','\u00F6':'o','\u022B':'o','\u1ECF':'o','\u0151':'o','\u01D2':'o','\u020D':'o','\u020F':'o','\u01A1':'o','\u1EDD':'o','\u1EDB':'o','\u1EE1':'o','\u1EDF':'o','\u1EE3':'o','\u1ECD':'o','\u1ED9':'o','\u01EB':'o','\u01ED':'o','\u00F8':'o','\u01FF':'o','\u0254':'o','\uA74B':'o','\uA74D':'o','\u0275':'o','\u01A3':'oi','\u0223':'ou','\uA74F':'oo','\u0070':'p','\u24DF':'p','\uFF50':'p','\u1E55':'p','\u1E57':'p','\u01A5':'p','\u1D7D':'p','\uA751':'p','\uA753':'p','\uA755':'p','\u0071':'q','\u24E0':'q','\uFF51':'q','\u024B':'q','\uA757':'q','\uA759':'q','\u0072':'r','\u24E1':'r','\uFF52':'r','\u0155':'r','\u1E59':'r','\u0159':'r','\u0211':'r','\u0213':'r','\u1E5B':'r','\u1E5D':'r','\u0157':'r','\u1E5F':'r','\u024D':'r','\u027D':'r','\uA75B':'r','\uA7A7':'r','\uA783':'r','\u0073':'s','\u24E2':'s','\uFF53':'s','\u00DF':'s','\u015B':'s','\u1E65':'s','\u015D':'s','\u1E61':'s','\u0161':'s','\u1E67':'s','\u1E63':'s','\u1E69':'s','\u0219':'s','\u015F':'s','\u023F':'s','\uA7A9':'s','\uA785':'s','\u1E9B':'s','\u0074':'t','\u24E3':'t','\uFF54':'t','\u1E6B':'t','\u1E97':'t','\u016
60375':'t','\u1E6D':'t','\u021B':'t','\u0163':'t','\u1E71':'t','\u1E6F':'t','\u0167':'t','\u01AD':'t','\u0288':'t','\u2C66':'t','\uA787':'t','\uA729':'tz','\u0075':'u','\u24E4':'u','\uFF55':'u','\u00F9':'u','\u00FA':'u','\u00FB':'u','\u0169':'u','\u1E79':'u','\u016B':'u','\u1E7B':'u','\u016D':'u','\u00FC':'u','\u01DC':'u','\u01D8':'u','\u01D6':'u','\u01DA':'u','\u1EE7':'u','\u016F':'u','\u0171':'u','\u01D4':'u','\u0215':'u','\u0217':'u','\u01B0':'u','\u1EEB':'u','\u1EE9':'u','\u1EEF':'u','\u1EED':'u','\u1EF1':'u','\u1EE5':'u','\u1E73':'u','\u0173':'u','\u1E77':'u','\u1E75':'u','\u0289':'u','\u0076':'v','\u24E5':'v','\uFF56':'v','\u1E7D':'v','\u1E7F':'v','\u028B':'v','\uA75F':'v','\u028C':'v','\uA761':'vy','\u0077':'w','\u24E6':'w','\uFF57':'w','\u1E81':'w','\u1E83':'w','\u0175':'w','\u1E87':'w','\u1E85':'w','\u1E98':'w','\u1E89':'w','\u2C73':'w','\u0078':'x','\u24E7':'x','\uFF58':'x','\u1E8B':'x','\u1E8D':'x','\u0079':'y','\u24E8':'y','\uFF59':'y','\u1EF3':'y','\u00FD':'y','\u0177':'y','\u1EF9':'y','\u0233':'y','\u1E8F':'y','\u00FF':'y','\u1EF7':'y','\u1E99':'y','\u1EF5':'y','\u01B4':'y','\u024F':'y','\u1EFF':'y','\u007A':'z','\u24E9':'z','\uFF5A':'z','\u017A':'z','\u1E91':'z','\u017C':'z','\u017E':'z','\u1E93':'z','\u1E95':'z','\u01B6':'z','\u0225':'z','\u0240':'z','\u2C6C':'z','\uA763':'z',};const patchMap=new WeakMap();function _getExtractorFrom(criterion){if(criterion){switch(typeof criterion){case'string':return element=>element[criterion];case'function':return criterion;default:throw new Error(`Expected criterion of type 'string' or 'function' and got '${typeof criterion}'`);}}else{return element=>element;}} 6038class AlreadyDefinedPatchError extends Error{constructor(){super(...arguments);this.name='AlreadyDefinedPatchError';}} 6039class UnknownPatchError extends Error{constructor(){super(...arguments);this.name='UnknownPatchError';}} 6040const __escape=_.escape;_.escapeMethod=Symbol('html') 6041_.escape=function escape(s){return s[_.escapeMethod]?s[_.escapeMethod]():__escape(s);} 6042const _Markup=owl.markup('').constructor;_Markup.prototype[_.escapeMethod]=function(){return this;} 6043window._Markup=_Markup;function Markup(v,...exprs){if(!(v instanceof Array)){return v?new _Markup(v):'';} 6044const elements=[];let i=0;for(;i<exprs.length;++i){elements.push(v[i],_.escape(exprs[i]));} 6045elements.push(v[i]);const s=elements.join('');if(!s){return''} 6046return new _Markup(s);} 6047const utils={AlreadyDefinedPatchError,UnknownPatchError,Markup,assert:function(bool){if(!bool){throw new Error("AssertionError");}},binaryToBinsize:function(value){if(!this.is_bin_size(value)){return this.human_size(value.length/1.37);} 6048return value;},confine:function(val,min,max){return Math.max(min,Math.min(max,val));},findWhere:function(list,props){if(!Array.isArray(list)||!props){return;} 6049return list.filter((item)=>item!==undefined).find((item)=>{return Object.keys(props).every((key)=>{return item[key]===props[key];})});},float_is_zero:function(value,decimals){var epsilon=Math.pow(10,-decimals);return Math.abs(utils.round_precision(value,epsilon))<epsilon;},generateID:function(){return++id;},getDataURLFromFile:function(file){if(!file){return Promise.reject();} 6050return new Promise(function(resolve,reject){var reader=new FileReader();reader.addEventListener('load',function(){if(reader.result==="data:"){resolve(`data:${file.type};base64,`);}else{resolve(reader.result);}});reader.addEventListener('abort',reject);reader.addEventListener('error',reject);reader.readAsDataURL(file);});},groupBy:function(list,criterion){const extract=_getExtractorFrom(criterion);const groups={};for(const element of list){const group=String(extract(element));if(!(group in groups)){groups[group]=[];} 6051groups[group].push(element);} 6052return groups;},human_number:function(number,decimals,minDigits,formatterCallback){number=Math.round(number);decimals=decimals|0;minDigits=minDigits||1;formatterCallback=formatterCallback||utils.insert_thousand_seps;var d2=Math.pow(10,decimals);var val=_t('kMGTPE');var symbol='';var numberMagnitude=number.toExponential().split('e')[1];if(numberMagnitude>=21){number=Math.round(number*Math.pow(10,decimals-numberMagnitude))/d2;return number+'e'+numberMagnitude;} 6053var sign=Math.sign(number);number=Math.abs(number);for(var i=val.length;i>0;i--){var s=Math.pow(10,i*3);
6053if(s<=number/Math.pow(10,minDigits-1)){number=Math.round(number*d2/s)/d2;symbol=val[i-1];break;}} 6054number=sign*number;return formatterCallback(''+number)+symbol;},human_size:function(size){var units=_t("Bytes|Kb|Mb|Gb|Tb|Pb|Eb|Zb|Yb").split('|');var i=0;while(size>=1024){size/=1024;++i;} 6055return size.toFixed(2)+' '+units[i].trim();},insert_thousand_seps:function(num){var negative=num[0]==='-';num=(negative?num.slice(1):num);return(negative?'-':'')+utils.intersperse(num,_t.database.parameters.grouping,_t.database.parameters.thousands_sep);},intersperse:function(str,indices,separator){separator=separator||'';var result=[],last=str.length;for(var i=0;i<indices.length;++i){var section=indices[i];if(section===-1||last<=0){break;}else if(section===0&&i===0){break;}else if(section===0){section=indices[--i];} 6056result.push(str.substring(last-section,last));last-=section;} 6057var s=str.substring(0,last);if(s){result.push(s);} 6058return result.reverse().join(separator);},into:function(object,path){if(!_(path).isArray()){path=path.split('.');} 6059for(var i=0;i<path.length;i++){object=object[path[i]];} 6060return object;},is_bin_size:function(v){return(/^\d+(\.\d*)? [^0-9]+$/).test(v);},isComponent:function(value){return value.prototype instanceof Component;},isNumpadDecimalSeparatorKey(ev){return['.',','].includes(ev.key)&&ev.code==='NumpadDecimal';},isValidAnchor:function(anchor){return/^#[\w-]+$/.test(anchor);},json_node_to_xml:function(node,human_readable,indent){indent=indent||0;var sindent=(human_readable?(new Array(indent+1).join('\t')):''),r=sindent+'<'+node.tag,cr=human_readable?'\n':'';if(typeof(node)==='string'){return sindent+node.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');}else if(typeof(node.tag)!=='string'||node.children&&!(node.children instanceof Array)||node.attrs&&!(node.attrs instanceof Object)){throw new Error(_.str.sprintf(_t("Node [%s] is not a JSONified XML node"),JSON.stringify(node)));} 6061for(var attr in node.attrs){var vattr=node.attrs[attr];if(typeof(vattr)!=='string'){vattr=JSON.stringify(vattr);} 6062vattr=vattr.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');if(human_readable){vattr=vattr.replace(/"/g,"'");} 6063r+=' '+attr+'="'+vattr+'"';} 6064if(node.children&&node.children.length){r+='>'+cr;var childs=[];for(var i=0,ii=node.children.length;i<ii;i++){childs.push(utils.json_node_to_xml(node.children[i],human_readable,indent+1));} 6065r+=childs.join(cr);r+=cr+sindent+'</'+node.tag+'>';return r;}else{return r+'/>';}},lpad:function(str,size){str=""+str;return new Array(size-str.length+1).join('0')+str;},partitionBy(arr,fn){let lastGroup=false;let lastValue;return arr.reduce((acc,cur)=>{let curVal=fn(cur);if(lastGroup){if(curVal===lastValue){lastGroup.push(cur);}else{lastGroup=false;}} 6066if(!lastGroup){lastGroup=[cur];acc.push(lastGroup);} 6067lastValue=curVal;return acc;},[]);},patch:function(obj,patchName,patch){if(!patchMap.has(obj)){patchMap.set(obj,{original:{},patches:[],});} 6068const objDesc=patchMap.get(obj);if(objDesc.patches.some(p=>p.name===patchName)){throw new AlreadyDefinedPatchError(`Patch ${patchName} is already defined`);} 6069objDesc.patches.push({name:patchName,patch,});for(const k in patch){let prevDesc=null;let proto=obj;do{prevDesc=Object.getOwnPropertyDescriptor(proto,k);proto=Object.getPrototypeOf(proto);}while(!prevDesc&&proto);const newDesc=Object.getOwnPropertyDescriptor(patch,k);if(!objDesc.original.hasOwnProperty(k)){objDesc.original[k]=Object.getOwnPropertyDescriptor(obj,k);} 6070if(prevDesc){const patchedFnName=`${k} (patch ${patchName})`;if(prevDesc.value&&typeof newDesc.value==="function"){makeIntermediateFunction("value",prevDesc,newDesc,patchedFnName);} 6071if(prevDesc.get||prevDesc.set){newDesc.get=newDesc.get||prevDesc.get;newDesc.set=newDesc.set||prevDesc.set;if(prevDesc.get&&typeof newDesc.get==="function"){makeIntermediateFunction("get",prevDesc,newDesc,patchedFnName);} 6072if(prevDesc.set&&typeof newDesc.set==="function"){makeIntermediateFunction("set",prevDesc,newDesc,patchedFnName);}}} 6073Object.defineProperty(obj,k,newDesc);} 6074function makeIntermediateFunction(key,prevDesc,newDesc,patchedFnName){const _superFn=prevDesc[key];const patchFn=newDesc[key];newDesc[key]={[patchedFnName](...args){const prevSuper=this._super;this._super=_superFn.bind(this);const result=patchFn.call(this,...args);this._super=prevSuper;return result;}}[patchedFnName];}},round_decimals:function(value,decimals){return utils.round_precision(value,parseFloat('1e'+-decimals));},round_precision:function(value,precision){if(!value){return 0;}else if(!precision||precision<0){precision=1;} 6075var normalized_value=value/precision;var epsilon_magnitude=Math.log(Math.abs(normalized_value))/Math.log(2);var epsilon=Math.pow(2,epsilon_magnitude-52);normalized_value+=normalized_value>=0?epsilon:-epsilon;var sign=normalized_value<0?-1.0:1.0;var rounded_value=sign*Math.round(Math.abs(normalized_value));return rounded_value*precision;},rpad:function(str,size){str=""+str;return str+new Array(size-str.length+1).join('0');},sortBy:function(array,criterion,order='asc'){const extract=_getExtractorFrom(criterion);return array.slice().sort((elA,elB)=>{const a=extract(elA);const b=extract(elB);let result;if(isNaN(a)&&isNaN(b)){result=a>b?1:a<b?-1:0;}else{result=a-b;} 6076return order==='asc'?result:-result;});},sprintf(string,...values){let finalizer,mapper;finalizer=mapper=a=>a;if(string instanceof _Markup){string=String(string);finalizer=Markup;mapper=_.escape;} 6077if(values.length===1&&typeof values[0]==='object'){const valuesDict=values[0];string=string.replace(/%\((\w+)\)s/g,(_,group)=>mapper(valuesDict[group]));}else{let i=0;string=string.replace(/%s/g,()=>mapper(values[i++]));} 6078return finalizer(string);},stableSort:function(array,iteratee){var stable=array.slice();return array.sort(function stableCompare(a,b){var order=iteratee(a,b);if(order!==0){return order;}else{return stable.indexOf(a)-stable.indexOf(b);}});},swap:function(array,elem1,elem2){var i1=array.indexOf(elem1);var i2=array.indexOf(elem2);array[i2]=elem1;array[i1]=elem2;},is_email:function(value,allow_mailto){var re;if(allow_mailto){re=/^(mailto:)?(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;}else{re=/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;} 6079return re.test(value);},toBoolElse:function(str,elseValues,trueValues,falseValues){var ret=_.str.toBool(str,trueValues,falseValues);if(_.isUndefined(ret)){return elseValues;} 6080return ret;},traverse_records:function(data,f){if(data.type==='record'){f(data);}else if(data.data){for(var i=0;i<data.data.length;i++){utils.traverse_records(data.data[i],f);}}}
6080,unaccent:function(str,casesensetive){str=str.replace(/[^\u0000-\u007E]/g,function(accented){return diacriticsMap[accented]||accented;});return casesensetive?str:str.toLowerCase();},unpatch:function(obj,patchName){const objDesc=patchMap.get(obj);if(!objDesc||!objDesc.patches.some(p=>p.name===patchName)){throw new UnknownPatchError(`Could not find patch ${patchName}`);} 6081patchMap.delete(obj);for(const k in objDesc.original){if(objDesc.original[k]===undefined){delete obj[k];}else{Object.defineProperty(obj,k,objDesc.original[k]);}} 6082let removedPatch;for(const patchDesc of objDesc.patches){if(patchDesc.name!==patchName){utils.patch(obj,patchDesc.name,patchDesc.patch);}else{removedPatch=patchDesc.patch;}} 6083return removedPatch;},xml_to_json:function(node,strip_whitespace){switch(node.nodeType){case 9:return utils.xml_to_json(node.documentElement,strip_whitespace);case 3:case 4:return(strip_whitespace&&node.data.trim()==='')?undefined:node.data;case 1:var attrs=$(node).getAttributes();return{tag:node.tagName.toLowerCase(),attrs:attrs,children:_.compact(_.map(node.childNodes,function(node){return utils.xml_to_json(node,strip_whitespace);})),};}},xml_to_str:function(node){var str="";if(window.XMLSerializer){str=(new XMLSerializer()).serializeToString(node);}else if(window.ActiveXObject){str=node.xml;}else{throw new Error(_t("Could not serialize XML"));} 6084var void_elements='area base br col command embed hr img input keygen link meta param source track wbr'.split(' ');str=str.replace(/<([a-z]+)([^<>]*)\s*\/\s*>/g,function(match,tag,attrs){if(void_elements.indexOf(tag)<0){return"<"+tag+attrs+"></"+tag+">";}else{return match;}});return str;},traverse:function(tree,f){if(f(tree)){_.each(tree.children,function(c){utils.traverse(c,f);});}},traversePath:function(tree,f,path){path=path||[];f(tree,path);_.each(tree.children,function(node){utils.traversePath(node,f,path.concat(tree));});},deepFreeze:function(obj){var propNames=Object.getOwnPropertyNames(obj);propNames.forEach(function(name){var prop=obj[name];if(typeof prop=='object'&&prop!==null) 6085utils.deepFreeze(prop);});return Object.freeze(obj);},closestNumber:function(num,arr){var curr=arr[0];var diff=Math.abs(num-curr);for(var val=0;val<arr.length;val++){var newdiff=Math.abs(num-arr[val]);if(newdiff<diff){diff=newdiff;curr=arr[val];}} 6086return curr;},};return utils;});; 6087 6088/* /web/static/src/legacy/js/core/widget.js */ 6089odoo.define('web.Widget',function(require){"use strict";var core=require('web.core');var mixins=require('web.mixins');var ServicesMixin=require('web.ServicesMixin');const{loadBundle}=require("@web/core/assets");var Widget=core.Class.extend(mixins.PropertiesMixin,ServicesMixin,{tagName:'div',id:null,className:null,attributes:{},events:{},template:null,cssLibs:null,jsLibs:null,assetLibs:null,init:function(parent){mixins.PropertiesMixin.init.call(this);this.setParent(parent);for(var name in this){if(typeof(this[name])==="function"){if((/^on_|^do_/).test(name)){this[name]=this[name].bind(this);}}}},willStart:function(){var proms=[];if(this.jsLibs||this.cssLibs||this.assetLibs){proms.push(loadBundle(this));} 6090return Promise.all(proms);},start:function(){return Promise.resolve();},destroy:function(){mixins.PropertiesMixin.destroy.call(this);if(this.$el){this.$el.remove();}},appendTo:function(target){var self=this;return this._widgetRenderAndInsert(function(t){self.$el.appendTo(t);},target);},attachTo:function(target){var self=this;this.setElement(target.$el||target);return this.willStart().then(function(){if(self.__parentedDestroyed){return;} 6091return self.start();});},do_hide:function(){if(this.$el){this.$el.addClass('o_hidden');}},do_show:function(){if(this.$el){this.$el.removeClass('o_hidden');}},do_toggle:function(display){if(_.isBoolean(display)){display?this.do_show():this.do_hide();}else if(this.$el){this.$el.hasClass('o_hidden')?this.do_show():this.do_hide();}},insertAfter:function(target){var self=this;return this._widgetRenderAndInsert(function(t){self.$el.insertAfter(t);},target);},insertBefore:function(target){var self=this;return this._widgetRenderAndInsert(function(t){self.$el.insertBefore(t);},target);},prependTo:function(target){var self=this;return this._widgetRenderAndInsert(function(t){self.$el.prependTo(t);},target);},renderElement:function(){var $el;if(this.template){$el=$(core.qweb.render(this.template,{widget:this}).trim());}else{$el=this._makeDescriptive();} 6092this._replaceElement($el);},replace:function(target){return this._widgetRenderAndInsert(_.bind(function(t){this.$el.replaceAll(t);},this),target);},setElement:function(element){if(this.$el){this._undelegateEvents();} 6093this.$el=(element instanceof $)?element:$(element);this.el=this.$el[0];this._delegateEvents();return this;},$:function(selector){if(selector===undefined){return this.$el;} 6094return this.$el.find(selector);},_delegateEvents:function(){var events=this.events;if(_.isEmpty(events)){return;} 6095for(var key in events){if(!events.hasOwnProperty(key)){continue;} 6096var method=this.proxy(events[key]);var match=/^(\S+)(\s+(.*))?$/.exec(key);var event=match[1];var selector=match[3];event+='.widget_events';if(!selector){this.$el.on(event,method);}else{this.$el.on(event,selector,method);}}},_makeDescriptive:function(){var attrs=_.extend({},this.attributes||{});
6096if(this.id){attrs.id=this.id;} 6097if(this.className){attrs['class']=this.className;} 6098var $el=$(document.createElement(this.tagName));if(!_.isEmpty(attrs)){$el.attr(attrs);} 6099return $el;},_replaceElement:function($el){var $oldel=this.$el;this.setElement($el);if($oldel&&!$oldel.is(this.$el)){if($oldel.length>1){$oldel.wrapAll('<div/>');$oldel.parent().replaceWith(this.$el);}else{$oldel.replaceWith(this.$el);}} 6100return this;},_undelegateEvents:function(){this.$el.off('.widget_events');},_widgetRenderAndInsert:function(insertion,target){var self=this;return this.willStart().then(function(){if(self.__parentedDestroyed){return;} 6101self.renderElement();insertion(target);return self.start();});},});return Widget;});; 6102 6103/* /web/static/src/legacy/js/services/ajax_service.js */ 6104odoo.define('web.AjaxService',function(require){"use strict";var AbstractService=require('web.AbstractService');var core=require('web.core');var session=require('web.session');var AjaxService=AbstractService.extend({rpc:function(route,args,options,target){var rpcPromise;var promise=new Promise(function(resolve,reject){rpcPromise=session.rpc(route,args,options);rpcPromise.then(function(result){if(!target.isDestroyed()){resolve(result);}}).guardedCatch(function(reason){if(!target.isDestroyed()){reject(reason);}});});promise.abort=rpcPromise.abort.bind(rpcPromise);return promise;},});core.serviceRegistry.add('ajax',AjaxService);return AjaxService;});; 6105 6106/* /web/static/src/legacy/js/services/config.js */ 6107odoo.define('web.config',function(require){"use strict";const Bus=require('web.Bus');const{hasTouch,isAndroid,isIOS,isMobileOS}=require('@web/core/browser/feature_detection');const{getMediaQueryLists}=require('@web/core/ui/ui_service');const bus=new Bus();var config={device:{bus:bus,touch:hasTouch(),size_class:null,isAndroid:isAndroid(),isIOS:isIOS(),isMobile:null,isMobileDevice:isMobileOS(),SIZES:{XS:0,VSM:1,SM:2,MD:3,LG:4,XL:5,XXL:6},},isDebug:function(debugMode){if(debugMode){return odoo.debug&&odoo.debug.indexOf(debugMode)!==-1;} 6108return odoo.debug;},};const medias=getMediaQueryLists();function _getSizeClass(){for(var i=0;i<medias.length;i++){if(medias[i].matches){return i;}}} 6109function _updateSizeProps(){var sc=_getSizeClass();if(sc!==config.device.size_class){config.device.size_class=sc;config.device.isMobile=config.device.size_class<=config.device.SIZES.SM;config.device.bus.trigger('size_changed',config.device.size_class);}} 6110_.invoke(medias,'addListener',_updateSizeProps);_updateSizeProps();return config;});; 6111 6112/* /web/static/src/legacy/js/services/core.js */ 6113odoo.define('web.core',function(require){"use strict";var Bus=require('web.Bus');var config=require('web.config');var Class=require('web.Class');var QWeb=require('web.QWeb');var Registry=require('web.Registry');var translation=require('web.translation');var bus=new Bus();_.each('click,dblclick,keydown,keypress,keyup'.split(','),function(evtype){$('html').on(evtype,function(ev){bus.trigger(evtype,ev);});});_.each('resize,scroll'.split(','),function(evtype){$(window).on(evtype,function(ev){bus.trigger(evtype,ev);});});return{qweb:new QWeb(config.isDebug()),Class:Class,bus:bus,main_bus:new Bus(),_t:translation._t,_lt:translation._lt,action_registry:new Registry(),crash_registry:new Registry(),serviceRegistry:new Registry(),csrf_token:odoo.csrf_token,};});; 6114 6115/* /web/static/src/legacy/js/services/local_storage_service.js */ 6116odoo.define('web.LocalStorageService',function(require){'use strict';var AbstractStorageService=require('web.AbstractStorageService');var core=require('web.core');var localStorage=require('web.local_storage');var LocalStorageService=AbstractStorageService.extend({storage:localStorage,});core.serviceRegistry.add('local_storage',LocalStorageService);return LocalStorageService;});; 6117 6118/* /web/static/src/legacy/js/services/session_storage_service.js */ 6119odoo.define('web.SessionStorageService',function(require){'use strict';var AbstractStorageService=require('web.AbstractStorageService');var core=require('web.core');var sessionStorage=require('web.sessionStorage');var SessionStorageService=AbstractStorageService.extend({storage:sessionStorage,});core.serviceRegistry.add('session_storage',SessionStorageService);return SessionStorageService;});; 6120 6121/* /web/static/src/legacy/js/common_env.js */ 6122odoo.define("web.commonEnv",function(require){"use strict";const{jsonRpc}=require("web.ajax");const{device,isDebug}=require("web.config");const{bus}=require("web.core");const rpc=require("web.rpc");const session=require("web.session");const{_t}=require("web.translation");const{getCookie,setCookie}=require('web.utils.cookies');const browser={clearInterval:window.clearInterval.bind(window),clearTimeout:window.clearTimeout.bind(window),Date:window.Date,fetch:(window.fetch||(()=>{})).bind(window),Notification:window.Notification,requestAnimationFrame:window.requestAnimationFrame.bind(window),setInterval:window.setInterval.bind(window),setTimeout:window.setTimeout.bind(window),};
6122Object.defineProperty(browser,'innerHeight',{get:()=>window.innerHeight,});Object.defineProperty(browser,'innerWidth',{get:()=>window.innerWidth,});const env={_t,browser,bus,device,isDebug,services:{ajaxJsonRPC(){return jsonRpc(...arguments);},getCookie(){return getCookie(...arguments);},httpRequest(route,params={},readMethod='json'){const info={method:params.method||'POST',};if(params.method!=='GET'){const formData=new FormData();for(const key in params){if(key==='method'){continue;} 6123const value=params[key];if(Array.isArray(value)&&value.length){for(const val of value){formData.append(key,val);}}else{formData.append(key,value);}} 6124info.body=formData;} 6125return fetch(route,info).then(response=>response[readMethod]());},navigate(url,params){window.location=$.param.querystring(url,params);},reloadPage(){window.location.reload();},rpc(params,options){const query=rpc.buildQuery(params);return session.rpc(query.route,query.params,options);},setCookie(){setCookie(...arguments);},},session,};return env;});; 6126 6127/* /web/static/src/legacy/js/widgets/name_and_signature.js */ 6128odoo.define('web.name_and_signature',function(require){'use strict';var core=require('web.core');var config=require('web.config');var utils=require('web.utils');var Widget=require('web.Widget');var NameAndSignature=Widget.extend({template:'web.sign_name_and_signature',events:{'input .o_web_sign_name_input':'_onInputSignName','click .o_web_sign_signature':'_onClickSignature','change .o_web_sign_signature':'_onChangeSignature','click .o_web_sign_draw_button':'_onClickSignDrawButton','click .o_web_sign_draw_clear a':'_onClickSignDrawClear','click .o_web_sign_auto_button':'_onClickSignAutoButton','click .o_web_sign_auto_select_style a':'_onClickSignAutoSelectStyle','click .o_web_sign_auto_font_selection a':'_onClickSignAutoFontSelection','mouseover .o_web_sign_auto_font_selection a':'_onMouseOverSignAutoFontSelection','touchmove .o_web_sign_auto_font_selection a':'_onTouchStartSignAutoFontSelection','click .o_web_sign_load_button':'_onClickSignLoadButton','change .o_web_sign_load_file input':'_onChangeSignLoadInput',},init:function(parent,options){this._super.apply(this,arguments);options=options||{};this.htmlId=_.uniqueId();this.defaultName=options.defaultName||'';this.defaultFont=options.defaultFont||'';this.fontColor=options.fontColor||'DarkBlue';this.displaySignatureRatio=options.displaySignatureRatio||3.0;this.signatureType=options.signatureType||'signature';this.signMode=options.mode||(options.noInputName&&!this.defaultName?'draw':'auto');this.noInputName=options.noInputName||false;this.currentFont=0;this.drawTimeout=null;this.drawPreviewTimeout=null;this.signatureAreaHidden=false;},willStart:function(){if(this.fonts&&this.fonts.length>0){return this._super.apply(this,arguments);} 6129return Promise.all([this._super.apply(this,arguments),this._rpc({route:'/web/sign/get_fonts/'+this.defaultFont}).then(data=>{this.fonts=data;})]);},start:function(){var self=this;this.$signatureGroup=this.$('.o_web_sign_signature_group');this.$signatureField=this.$('.o_web_sign_signature');this.$nameInput=this.$('.o_web_sign_name_input');this.$nameInputGroup=this.$('.o_web_sign_name_group');this.$drawButton=this.$('a.o_web_sign_draw_button');this.$autoButton=this.$('a.o_web_sign_auto_button');this.$loadButton=this.$('a.o_web_sign_load_button');this.$drawClear=this.$('.o_web_sign_draw_clear');this.$autoSelectStyle=this.$('.o_web_sign_auto_select_style');this.$autoFontSelection=this.$('.o_web_sign_auto_font_selection');this.$autoFontList=this.$('.o_web_sign_auto_font_list');for(var i in this.fonts){var $img=$('<img/>').addClass('img-fluid');var $a=$('<a/>').addClass('btn p-0').append($img).data('fontNb',i);this.$autoFontList.append($a);} 6130this.$loadFile=this.$('.o_web_sign_load_file');this.$loadInvalid=this.$('.o_web_sign_load_invalid');if(this.fonts&&this.fonts.length<2){this.$autoSelectStyle.hide();} 6131if(this.noInputName){if(this.defaultName===""){this.$autoButton.hide();} 6132this.$nameInputGroup.hide();}else if(this.defaultName===""){this._hideSignatureArea();} 6133$(window).on('resize.o_web_sign_name_and_signature',_.debounce(function(){if(self.isDestroyed()){return;} 6134self.resizeSignature();},250));return this._super.apply(this,arguments);},destroy:function(){this._super.apply(this,arguments);$(window).off('resize.o_web_sign_name_and_signature');},focusName:function(){if(!config.device.isMobile){this.$nameInput.focus();}},getName:function(){return this.$nameInput.val();}
6134,getSignatureImage:function(){return this.$signatureField.jSignature('getData','image');},getSignatureImageSrc:function(){return this.$signatureField.jSignature('getData');},isSignatureEmpty:function(){var signature=this.$signatureField.jSignature('getData');return signature&&this.emptySignature?this.emptySignature===signature:true;},resizeSignature:function(){if(!this.$signatureField){return;} 6135this.$signatureField.css({width:'unset'});const width=this.$signatureField.width();const height=parseInt(width/this.displaySignatureRatio);this.$signatureField.css({width:width,height:height,});this.$signatureField.find('canvas').css({width:width,height:height,});return{width,height};},resetSignature:function(){if(!this.$signatureField){return Promise.reject();} 6136const{width,height}=this.resizeSignature();this.$signatureField.empty().jSignature({'decor-color':'#D1D0CE','background-color':'rgba(255,255,255,0)','show-stroke':false,'color':this.fontColor,'lineWidth':2,'width':width,'height':height,});this.emptySignature=this.$signatureField.jSignature('getData');this.setMode(this.signMode,true);this.focusName();return Promise.resolve();},setMode:function(mode,reset){if(reset!==true&&mode===this.signMode){return;} 6137this.signMode=mode;this.$drawClear.toggleClass('d-none',this.signMode!=='draw');this.$autoSelectStyle.toggleClass('d-none',this.signMode!=='auto');this.$loadFile.toggleClass('d-none',this.signMode!=='load');this.$drawButton.toggleClass('active',this.signMode==='draw');this.$autoButton.toggleClass('active',this.signMode==='auto');this.$loadButton.toggleClass('active',this.signMode==='load');this.$signatureField.jSignature(this.signMode==='draw'?'enable':'disable');this.$signatureField.jSignature('reset');if(this.signMode==='auto'){this._drawCurrentName();}else{this.$autoFontSelection.addClass('d-none');} 6138if(this.signMode!=='load'){this.$loadInvalid.addClass('d-none');}},validateSignature:function(){var name=this.getName();var isSignatureEmpty=this.isSignatureEmpty();this.$nameInput.parent().toggleClass('o_has_error',!name).find('.form-control, .form-select').toggleClass('is-invalid',!name);this.$signatureGroup.toggleClass('border-danger',isSignatureEmpty);return name&&!isSignatureEmpty;},_drawCurrentName:function(){var font=this.fonts[this.currentFont];var text=this._getCleanedName();var canvas=this.$signatureField.find('canvas')[0];var img=this._getSVGText(font,text,canvas.width,canvas.height);return this._printImage(img);},_getCleanedName:function(){var text=this.getName();if(this.signatureType==='initial'&&text){return(text.split(' ').map(function(w){return w[0];}).join('.')+'.');} 6139return text;},_getSVGText:function(font,text,width,height){var $svg=$(core.qweb.render('web.legacy.sign_svg_text',{width:width,height:height,font:font,text:text,type:this.signatureType,color:this.fontColor,}));$svg.attr({'xmlns':"http://www.w3.org/2000/svg",'xmlns:xlink':"http://www.w3.org/1999/xlink",});return"data:image/svg+xml,"+encodeURI($svg[0].outerHTML);},_printImage:function(imgSrc){var self=this;var image=new Image;image.onload=function(){clearTimeout(self.drawTimeout);self.drawTimeout=setTimeout(function(){var width=0;var height=0;var ratio=image.width/image.height;var $canvas=self.$signatureField.find('canvas');var context=$canvas[0].getContext('2d');if(image.width/$canvas[0].width>image.height/$canvas[0].height){width=$canvas[0].width;height=parseInt(width/ratio);}else{height=$canvas[0].height;width=parseInt(height*ratio);} 6140self.$signatureField.jSignature('reset');var ignoredContext=_.pick(context,['shadowOffsetX','shadowOffsetY']);_.extend(context,{shadowOffsetX:0,shadowOffsetY:0});context.drawImage(image,0,0,image.width,image.height,($canvas[0].width-width)/2,($canvas[0].height-height)/2,width,height);_.extend(context,ignoredContext);self.trigger_up('signature_changed');},0);};image.src=imgSrc;},_setFont:function(index){if(index!==this.currentFont){this.currentFont=index;this._drawCurrentName();}},_updatePreviewButtons:function(){var self=this;clearTimeout(this.drawPreviewTimeout);this.drawPreviewTimeout=setTimeout(function(){var height=100;var width=parseInt(height*self.displaySignatureRatio);var $existingButtons=self.$autoFontList.find('a');for(var i=0;i<self.fonts.length;i++){var imgSrc=self._getSVGText(self.fonts[i],self._getCleanedName(),width,height);$existingButtons.eq(i).find('img').attr('src',imgSrc);}},0);},_waitForSignatureNotEmpty:function(def){def=def||$.Deferred();if(!this.isSignatureEmpty()){this.trigger_up('signature_changed');def.resolve();}else{setTimeout(this._waitForSignatureNotEmpty.bind(this,def),10);} 6141return def;},_hideSignatureArea:function(){this.$signatureField.hide();this.$signatureGroup.hide();this.signatureAreaHidden=true;},_showSignatureArea:function(){this.$signatureField.show();this.$signatureGroup.show();this.signatureAreaHidden=false;this.resetSignature();},_onClickSignature:function(ev){this.$autoFontSelection.addClass('d-none');},_onClickSignAutoButton:function(ev){ev.preventDefault();this.setMode('auto');},_onClickSignAutoFontSelection:function(ev){this.$autoFontSelection.addClass('d-none').removeClass('d-flex').css('width',0);this._setFont(parseInt($(ev.currentTarget).data('font-nb')));},_onClickSignAutoSelectStyle:function(ev){var self=this;var width=Math.min(self.$autoFontSelection.find('a').first().height()*self.displaySignatureRatio*1.25,this.$signatureField.width());ev.preventDefault();self._updatePreviewButtons();this.$autoFontSelection.removeClass('d-none').addClass('d-flex');this.$autoFontSelection.show().animate({'width':width},500,function(){});},_onClickSignDrawButton:function(ev){ev.preventDefault();this.$signatureField.jSignature('reset');this.setMode('draw');},_onClickSignDrawClear:function(ev){ev.preventDefault();this.$signatureField.jSignature('reset');},_onClickSignLoadButton:function(ev){ev.preventDefault();this.$loadFile.find('input').click();this.setMode('load');},_onChangeSignature:function(ev){this.trigger_up('signature_changed');},_onChangeSignLoadInput:function(ev){var self=this;var f=ev.target.files[0];if(f===undefined){return false;} 6142if(f.type.substr(0,5)!=='image'){this.$signatureField.jSignature('reset');this.$loadInvalid.removeClass('d-none');return false;} 6143this.$loadInvalid.addClass('d-none');utils.getDataURLFromFile(f).then(function(result){self._printImage(result);});},_onInputSignName:function(ev){if(this.signatureAreaHidden&&this._getCleanedName()){this._showSignatureArea();} 6144if(this.signMode!=='auto'){return;} 6145this._drawCurrentName();if(!this.$autoFontSelection.hasClass('d-none')){this._updatePreviewButtons();}},_onMouseOverSignAutoFontSelection:function(ev){this._setFont(parseInt($(ev.currentTarget).data('font-nb')));},_onTouchStartSignAutoFontSelection:function(ev){this._setFont(parseInt($(ev.currentTarget).data('font-nb')));},});return{NameAndSignature:NameAndSignature,};});; 6146 6147/* /web/static/src/legacy/js/core/smooth_scroll_on_drag.js */ 6148odoo.define('web/static/src/js/core/smooth_scroll_on_drag.js',function(require){"use strict";const Class=require('web.Class');const mixins=require('web.mixins');const OffsetElementsHelper=Class.extend({init:function(offsetElements){this.offsetElements=offsetElements;},top:function(){if(!this.offsetElements.$top||!this.offsetElements.$top.length){return 0;} 6149return this.offsetElements.$top.get(0).getBoundingClientRect().bottom;},right:function(){if(!this.offsetElements.$right||!this.offsetElements.$right.length){return 0;} 6150return this.offsetElements.$right.get(0).getBoundingClientRect().left;},bottom:function(){if(!this.offsetElements.$bottom||!this.offsetElements.$bottom.length){return 0;} 6151return this.offsetElements.$bottom.get(0).getBoundingClientRect().top;},left:function(){if(!this.offsetElements.$left||!this.offsetElements.$left.length){return 0;} 6152return this.offsetElements.$left.get(0).getBoundingClientRect().right;},});const SmoothScrollOnDrag=Class.extend(mixins.ParentedMixin,{init(parent,$element,$scrollTarget,options={}){mixins.ParentedMixin.init.call(this);this.setParent(parent);this.$element=$element;this.$scrollTarget=$scrollTarget;this.options=options;this.targetWindow=this.$element[0].ownerDocument.defaultView;const insideIframe=this.targetWindow!==window.top;this.options.jQueryDraggableOptions=this.options.jQueryDraggableOptions||{};if(!this.options.jQueryDraggableOptions.cursorAt){this.$element.on('mousedown.smooth_scroll',this._onElementMouseDown.bind(this));} 6153this.options.scrollOffsetThreshold=this.options.scrollOffsetThreshold||150;this.options.scrollStep=this.options.scrollStep||20;this.options.scrollTimerInterval=this.options.scrollTimerInterval||5;this.options.offsetElements=this.options.offsetElements||{};this.options.offsetElementsManager=new OffsetElementsHelper(this.options.offsetElements);this.options.scrollBoundaries=Object.assign({top:true,right:true,bottom:true,left:true},this.options.scrollBoundaries);this.autoScrollHandler=null;this.scrollStepDirectionEnum={up:-1,right:1,down:1,left:-1,};this.options.jQueryDraggableOptions.scroll=false;this.options.disableHorizontalScroll=this.options.disableHorizontalScroll||false;const draggableOptions=Object.assign({},this.options.jQueryDraggableOptions,{start:(ev,ui)=>{this._onSmoothDragStart(ev,ui,this.options.jQueryDraggableOptions.start);if(insideIframe){this.onParentWindowMouseup=this._onParentWindowMouseup.bind(this);window.top.addEventListener('mouseup',this.onParentWindowMouseup,{once:true});}},drag:(ev,ui)=>this._onSmoothDrag(ev,ui,this.options.jQueryDraggableOptions.drag),stop:(ev,ui)=>{if(insideIframe){window.top.removeEventListener('mouseup',this.onParentWindowMouseup,{once:true});} 6154this._onSmoothDragStop(ev,ui,this.options.jQueryDraggableOptions.stop);}});this.$element.draggable(draggableOptions);},destroy:function(){mixins.ParentedMixin.destroy.call(this);this.$element.off('.smooth_scroll');this._stopSmoothScroll();},_startSmoothScroll(ui){this._stopSmoothScroll();this._initialScrollBehavior=this.$scrollTarget[0].style.scrollBehavior;this.$scrollTarget[0].style.scrollBehavior='auto';this.autoScrollHandler=setInterval(()=>{this.verticalDelta=Math.min(Math.max(0,this.$scrollTarget.get(0).scrollHeight
6155-(this.$scrollTarget.scrollTop()+this.$scrollTarget.innerHeight())),Math.max(this.verticalDelta,-this.$scrollTarget.scrollTop()));this.horizontalDelta=Math.min(Math.max(0,this.$scrollTarget.get(0).scrollWidth 6156-(this.$scrollTarget.scrollLeft()+this.$scrollTarget.innerWidth())),Math.max(this.horizontalDelta,-this.$scrollTarget.scrollLeft()));if(this.scrollTargetIsParent){const offset=ui.helper.offset();ui.helper.offset({top:offset.top+this.verticalDelta,left:offset.left+this.horizontalDelta});} 6157this.$scrollTarget.scrollTop(this.$scrollTarget.scrollTop()+ 6158this.verticalDelta);if(!this.options.disableHorizontalScroll){this.$scrollTarget.scrollLeft(this.$scrollTarget.scrollLeft()+ 6159this.horizontalDelta);}},this.options.scrollTimerInterval);},_stopSmoothScroll(){clearInterval(this.autoScrollHandler);this.$scrollTarget[0].style.scrollBehavior=this._initialScrollBehavior||'';},_updatePositionOptions(ui){const draggableHelperOffset=ui.offset;const scrollTargetOffset=this.$scrollTarget.offset();let visibleOffset={top:draggableHelperOffset.top 6160-scrollTargetOffset.top 6161+this.options.jQueryDraggableOptions.cursorAt.top 6162-this.options.offsetElementsManager.top(),right:scrollTargetOffset.left+this.$scrollTarget.outerWidth() 6163-draggableHelperOffset.left 6164-this.options.jQueryDraggableOptions.cursorAt.left 6165-this.options.offsetElementsManager.right(),bottom:scrollTargetOffset.top+this.$scrollTarget.outerHeight() 6166-draggableHelperOffset.top 6167-this.options.jQueryDraggableOptions.cursorAt.top 6168-this.options.offsetElementsManager.bottom(),left:draggableHelperOffset.left 6169-scrollTargetOffset.left 6170+this.options.jQueryDraggableOptions.cursorAt.left 6171-this.options.offsetElementsManager.left(),};if(this.iframeOffset){const{x,y}=this.iframeOffset;visibleOffset.left-=x;visibleOffset.top-=y;visibleOffset.bottom+=y;visibleOffset.right+=x;} 6172if(this.scrollTargetIsDocument&&!this.iframeOffset){const scrollTargetScrollTop=this.$scrollTarget.scrollTop();const scrollTargetScrollLeft=this.$scrollTarget.scrollLeft();visibleOffset.top-=scrollTargetScrollTop;visibleOffset.right+=scrollTargetScrollLeft;visibleOffset.bottom+=scrollTargetScrollTop;visibleOffset.left-=scrollTargetScrollLeft;} 6173const scrollDecelerator={vertical:0,horizontal:0,};const scrollStepDirection={vertical:this.scrollStepDirectionEnum.down,horizontal:this.scrollStepDirectionEnum.right,};if((!this.options.scrollBoundaries.top&&visibleOffset.top<0)||(!this.options.scrollBoundaries.right&&visibleOffset.right<0)||(!this.options.scrollBoundaries.bottom&&visibleOffset.bottom<0)||(!this.options.scrollBoundaries.left&&visibleOffset.left<0)){scrollDecelerator.horizontal=1;scrollDecelerator.vertical=1;}else{if(visibleOffset.bottom<=this.options.scrollOffsetThreshold){scrollDecelerator.vertical=Math.max(0,visibleOffset.bottom)/this.options.scrollOffsetThreshold;}else if(visibleOffset.top<=this.options.scrollOffsetThreshold){scrollDecelerator.vertical=Math.max(0,visibleOffset.top)/this.options.scrollOffsetThreshold;scrollStepDirection.vertical=this.scrollStepDirectionEnum.up;}else{scrollDecelerator.vertical=1;} 6174if(visibleOffset.right<=this.options.scrollOffsetThreshold){scrollDecelerator.horizontal=Math.max(0,visibleOffset.right)/this.options.scrollOffsetThreshold;}else if(visibleOffset.left<=this.options.scrollOffsetThreshold){scrollDecelerator.horizontal=Math.max(0,visibleOffset.left)/this.options.scrollOffsetThreshold;scrollStepDirection.horizontal=this.scrollStepDirectionEnum.left;}else{scrollDecelerator.horizontal=1;}} 6175this.verticalDelta=Math.ceil(scrollStepDirection.vertical*this.options.scrollStep*(1-Math.sqrt(scrollDecelerator.vertical)));this.horizontalDelta=Math.ceil(scrollStepDirection.horizontal*this.options.scrollStep*(1-Math.sqrt(scrollDecelerator.horizontal)));},_onElementMouseDown(ev){const elementOffset=$(ev.target).offset();this.options.jQueryDraggableOptions.cursorAt={top:ev.pageY-elementOffset.top,left:ev.pageX-elementOffset.left,};},_onSmoothDrag(ev,ui,onDragCallback){this._updatePositionOptions(ui);if(typeof onDragCallback==='function'){onDragCallback.call(ui.helper,ev,ui);}},_onSmoothDragStart(ev,ui,onDragStartCallBack){this.scrollTargetIsDocument=this.$scrollTarget.is('html');this.iframeOffset=false;const iframeEl=this.$scrollTarget[0].ownerDocument.defaultView.frameElement;if(iframeEl&&!iframeEl.contentDocument.contains(this.$element[0])){this.iframeOffset=iframeEl.getBoundingClientRect();} 6176this.scrollTargetIsParent=this.$scrollTarget.get(0).contains(this.$element.get(0));this._updatePositionOptions(ui);this._startSmoothScroll(ui);if(typeof onDragStartCallBack==='function'){onDragStartCallBack.call(ui.helper,ev,ui);}},_onSmoothDragStop(ev,ui,onDragEndCallBack){this._stopSmoothScroll();if(typeof onDragEndCallBack==='function'){onDragEndCallBack.call(ui.helper,ev,ui);}},_onParentWindowMouseup(){this.targetWindow.document.dispatchEvent(new Event('mouseup'));},});return SmoothScrollOnDrag;});; 6177 6178/* /web/static/src/legacy/js/widgets/colorpicker.js */ 6179odoo.define('web.Colorpicker',function(require){'use strict';var core=require('web.core');var utils=require('web.utils');var Dialog=require('web.Dialog');var Widget=require('web.Widget');var timingUtils=require('@web/core/utils/timing');var debounce=timingUtils.debounce;var _t=core._t;var ColorpickerWidget=Widget.extend({template:'Colorpicker',events:{'click':'_onClick','keypress':'_onKeypress','mousedown .o_color_pick_area':'_onMouseDownPicker','mousedown .o_color_slider':'_onMouseDownSlider','mousedown .o_opacity_slider':'_onMouseDownOpacitySlider','change .o_color_picker_inputs':'_onChangeInputs',},init:function(parent,options){this._super(...arguments);options=options||{};this.pickerFlag=false;this.sliderFlag=false;this.opacitySliderFlag=false;this.colorComponents={};this.uniqueId=_.uniqueId('colorpicker');this.selectedHexValue='';this.$documents=$([window.top,...Array.from(window.top.frames).filter(frame=>{try{const document=frame.document;return!!document;}catch{return false;}})].map(w=>w.document));this.$documents.on(`mousemove.${this.uniqueId}`,_.throttle((ev)=>{this._onMouseMovePicker(ev);this._onMouseMoveSlider(ev);this._onMouseMoveOpacitySlider(ev);},50));this.$documents.on(`mouseup.${this.uniqueId}`,_.throttle((ev)=>{if(this.pickerFlag||this.sliderFlag||this.opacitySliderFlag){this._colorSelected();} 6180this.pickerFlag=false;this.sliderFlag=false;this.opacitySliderFlag=false;},10));this.options=_.clone(options);},start:function(){this.$colorpickerArea=this.$('.o_color_pick_area');this.$colorpickerPointer=this.$('.o_picker_pointer');this.$colorSlider=this.$('.o_color_slider');this.$colorSliderPointer=this.$('.o_slider_pointer');this.$opacitySlider=this.$('.o_opacity_slider');this.$opacitySliderPointer=this.$('.o_opacity_pointer');var defaultColor=this.options.defaultColor||'#FF0000';var rgba=ColorpickerWidget.convertCSSColorToRgba(defaultColor);if(rgba){this._updateRgba(rgba.red,rgba.green,rgba.blue,rgba.opacity);}
6181Object.entries(this.colorComponents).forEach(([component,value])=>{const input=this.el.querySelector(`.o_${component}_input`);if(input){input.value=value;}});const resizeObserver=new window.ResizeObserver(()=>{this._updateUI();});resizeObserver.observe(this.el);this.previewActive=true;return this._super.apply(this,arguments);},destroy:function(){this._super.apply(this,arguments);this.$documents.off(`.${this.uniqueId}`);},setSelectedColor:function(color){var rgba=ColorpickerWidget.convertCSSColorToRgba(color);if(rgba){const oldPreviewActive=this.previewActive;this.previewActive=false;this._updateRgba(rgba.red,rgba.green,rgba.blue,rgba.opacity);this.previewActive=oldPreviewActive;this._updateUI();}},_updateUI:function(){var self=this;_.each(this.colorComponents,function(value,color){self.$(_.str.sprintf('.o_%s_input',color)).val(value);});this.$('.o_color_preview').css('background-color',this.colorComponents.cssColor);this.$colorpickerArea.css('background-color',_.str.sprintf('hsl(%s, 100%%, 50%%)',this.colorComponents.hue));var top=(100-this.colorComponents.lightness)*this.$colorpickerArea.height()/100;var left=this.colorComponents.saturation*this.$colorpickerArea.width()/100;this.$colorpickerPointer.css({top:(top-5)+'px',left:(left-5)+'px',});var height=this.$colorSlider.height();var y=this.colorComponents.hue*height/360;this.$colorSliderPointer.css('top',Math.round(y-2));if(!this.options.noTransparency){var heightOpacity=this.$opacitySlider.height();var z=heightOpacity*(1-this.colorComponents.opacity/100.0);this.$opacitySliderPointer.css('top',Math.round(z-2));this.$opacitySlider.css('background','linear-gradient('+this.colorComponents.hex+' 0%, transparent 100%)');}},_updateHex:function(hex){var rgb=ColorpickerWidget.convertCSSColorToRgba(hex);if(!rgb){return;} 6182_.extend(this.colorComponents,{hex:hex},rgb,ColorpickerWidget.convertRgbToHsl(rgb.red,rgb.green,rgb.blue));this._updateCssColor();},_updateRgba:function(r,g,b,a){const opacity=a||this.colorComponents.opacity;if(opacity<0.1&&(r>0.1||g>0.1||b>0.1)){a=100;} 6183var hex=ColorpickerWidget.convertRgbaToCSSColor(r,g,b);if(!hex){return;} 6184_.extend(this.colorComponents,{red:r,green:g,blue:b},a===undefined?{}:{opacity:a},{hex:hex},ColorpickerWidget.convertRgbToHsl(r,g,b));this._updateCssColor();},_updateHsl:function(h,s,l){let a=this.colorComponents.opacity;if(a<0.1&&l>0.1){a=100;} 6185var rgb=ColorpickerWidget.convertHslToRgb(h,s,l);if(!rgb){return;} 6186const hex=ColorpickerWidget.convertRgbaToCSSColor(rgb.red,rgb.green,rgb.blue);_.extend(this.colorComponents,{hue:h,saturation:s,lightness:l},rgb,{hex:hex},{opacity:a},);this._updateCssColor();},_updateOpacity:function(a){if(a<0||a>100){return;} 6187_.extend(this.colorComponents,{opacity:a});this._updateCssColor();},_colorSelected:function(){this.trigger_up('colorpicker_select',this.colorComponents);},_updateCssColor:function(){const r=this.colorComponents.red;const g=this.colorComponents.green;const b=this.colorComponents.blue;const a=this.colorComponents.opacity;_.extend(this.colorComponents,{cssColor:ColorpickerWidget.convertRgbaToCSSColor(r,g,b,a)});if(this.previewActive){this.trigger_up('colorpicker_preview',this.colorComponents);}},_onKeypress:function(ev){if(ev.charCode===$.ui.keyCode.ENTER){if(ev.target.tagName==='INPUT'){this._onChangeInputs(ev);} 6188ev.preventDefault();this.trigger_up('enter_key_color_colorpicker');}},_onClick:function(ev){if(this.options.stopClickPropagation){ev.stopPropagation();} 6189ev.originalEvent.__isColorpickerClick=true;$(ev.target).find('> .o_opacity_pointer, > .o_slider_pointer, > .o_picker_pointer').addBack('.o_opacity_pointer, .o_slider_pointer, .o_picker_pointer').focus();if(ev.target.dataset.colorMethod==='hex'&&!this.selectedHexValue){ev.target.select();this.selectedHexValue=ev.target.value;return;} 6190this.selectedHexValue='';},_onMouseDownPicker:function(ev){this.pickerFlag=true;ev.preventDefault();this._onMouseMovePicker(ev);},_onMouseMovePicker:function(ev){if(!this.pickerFlag){return;} 6191var offset=this.$colorpickerArea.offset();var top=ev.pageY-offset.top;var left=ev.pageX-offset.left;var saturation=Math.round(100*left/this.$colorpickerArea.width());var lightness=Math.round(100*(this.$colorpickerArea.height()-top)/this.$colorpickerArea.height());saturation=utils.confine(saturation,0,100);lightness=utils.confine(lightness,0,100);this._updateHsl(this.colorComponents.hue,saturation,lightness);this._updateUI();},_onMouseDownSlider:function(ev){this.sliderFlag=true;ev.preventDefault();this._onMouseMoveSlider(ev);},_onMouseMoveSlider:function(ev){if(!this.sliderFlag){return;} 6192var y=ev.pageY-this.$colorSlider.offset().top;var hue=Math.round(360*y/this.$colorSlider.height());hue=utils.confine(hue,0,360);this._updateHsl(hue,this.colorComponents.saturation,this.colorComponents.lightness);this._updateUI();},_onMouseDownOpacitySlider:function(ev){this.opacitySliderFlag=true;ev.preventDefault();this._onMouseMoveOpacitySlider(ev);},_onMouseMoveOpacitySlider:function(ev){if(!this.opacitySliderFlag||this.options.noTransparency){return;} 6193var y=ev.pageY-this.$opacitySlider.offset().top;var opacity=Math.round(100*(1-y/this.$opacitySlider.height()));opacity=utils.confine(opacity,0,100);this._updateOpacity(opacity);this._updateUI();},_onChangeInputs:debounce(function(ev){switch($(ev.target).data('colorMethod')){case'hex':this._updateHex(this.$('.o_hex_input').val());break;case'rgb':this._updateRgba(parseInt(this.$('.o_red_input').val()),parseInt(this.$('.o_green_input').val()),parseInt(this.$('.o_blue_input').val()));break;case'hsl':this._updateHsl(parseInt(this.$('.o_hue_input').val()),parseInt(this.$('.o_saturation_input').val()),parseInt(this.$('.o_lightness_input').val()));break;case'opacity':this._updateOpacity(parseInt(this.$('.o_opacity_input').val()));break;} 6194this._updateUI();this._colorSelected();},10,true),});ColorpickerWidget.convertRgbToHsl=function(r,g,b){if(typeof(r)!=='number'||isNaN(r)||r<0||r>255||typeof(g)!=='number'||isNaN(g)||g<0||g>255||typeof(b)!=='number'||isNaN(b)||b<0||b>255){return false;} 6195var red=r/255;var green=g/255;var blue=b/255;var maxColor=Math.max(red,green,blue);var minColor=Math.min(red,green,blue);var delta=maxColor-minColor;var hue=0;var saturation=0;var lightness=(maxColor+minColor)/2;if(delta){if(maxColor===red){hue=(green-blue)/delta;} 6196if(maxColor===green){hue=2+(blue-red)/delta;} 6197if(maxColor===blue){hue=4+(red-green)/delta;} 6198if(maxColor){saturation=delta/(1-Math.abs(2*lightness-1));}} 6199hue=60*hue;return{hue:hue<0?hue+360:hue,saturation:saturation*100,lightness:lightness*100,};};ColorpickerWidget.convertHslToRgb=function(h,s,l){if(typeof(h)!=='number'||isNaN(h)||h<0||h>360||typeof(s)!=='number'||isNaN(s)||s<0||s>100||typeof(l)!=='number'||isNaN(l)||l<0||l>100){return false;} 6200var huePrime=h/60;var saturation=s/100;var lightness=l/100;var chroma=saturation*(1-Math.abs(2*lightness-1));var secondComponent=chroma*(1-Math.abs(huePrime%2-1));var lightnessAdjustment=lightness-chroma/2;var precision=255;chroma=Math.round((chroma+lightnessAdjustment)*precision);secondComponent=Math.round((secondComponent+lightnessAdjustment)*precision);lightnessAdjustment=Math.round((lightnessAdjustment)*precision);if(huePrime>=0&&huePrime<1){return{red:chroma,green:secondComponent,blue:lightnessAdjustment,};} 6201if(huePrime>=1&&huePrime<2){return{red:secondComponent,green:chroma,blue:lightnessAdjustment,};} 6202if(huePrime>=2&&huePrime<3){return{red:lightnessAdjustment,green:chroma,blue:secondComponent,};} 6203if(huePrime>=3&&huePrime<4){return{red:lightnessAdjustment,green:secondComponent,blue:chroma,};} 6204if(huePrime>=4&&huePrime<5){return{red:secondComponent,green:lightnessAdjustment,blue:chroma,};} 6205if(huePrime>=5&&huePrime<=6){return{red:chroma,green:lightnessAdjustment,blue:secondComponent,};} 6206return false;};ColorpickerWidget.convertRgbaToCSSColor=function(r,g,b,a){if(typeof(r)!=='number'||isNaN(r)||r<0||r>255||typeof(g)!=='number'||isNaN(g)||g<0||g>255||typeof(b)!=='number'||isNaN(b)||b<0||b>255){return false;} 6207if(typeof(a)!=='number'||isNaN(a)||a<0||Math.abs(a-100)<Number.EPSILON){const rr=r<16?'0'+r.toString(16):r.toString(16);const gg=g<16?'0'+g.toString(16):g.toString(16);const bb=b<16?'0'+b.toString(16):b.toString(16);return(`#${rr}${gg}${bb}`).toUpperCase();} 6208return`rgba(${r}, ${g}, ${b}, ${parseFloat((a / 100.0).toFixed(3))})`;};ColorpickerWidget.convertCSSColorToRgba=function(cssColor){const rgba=cssColor.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(rgba){if(rgba[4]===undefined){rgba[4]=1;} 6209return{red:parseInt(rgba[1]),green:parseInt(rgba[2]),blue:parseInt(rgba[3]),opacity:Math.round(parseFloat(rgba[4])*100),};} 6210if(/^#([0-9A-F]{6}|[0-9A-F]{8})$/i.test(cssColor)){return{red:parseInt(cssColor.substr(1,2),16),green:parseInt(cssColor.substr(3,2),16),blue:parseInt(cssColor.substr(5,2),16),opacity:(cssColor.length===9?(parseInt(cssColor.substr(7,2),16)/255):1)*100,};} 6211return false;};ColorpickerWidget.normalizeCSSColor=function(cssColor){const rgba=ColorpickerWidget.convertCSSColorToRgba(cssColor);if(!rgba){return cssColor;} 6212return ColorpickerWidget.convertRgbaToCSSColor(rgba.red,rgba.green,rgba.blue,rgba.opacity);};ColorpickerWidget.isCSSColor=function(cssColor){return ColorpickerWidget.convertCSSColorToRgba(cssColor)!==false;};ColorpickerWidget.mixCssColors=function(cssColor1,cssColor2,weight){const rgba1=ColorpickerWidget.convertCSSColorToRgba(cssColor1);const rgba2=ColorpickerWidget.convertCSSColorToRgba(cssColor2);const rgb1=[rgba1.red,rgba1.green,rgba1.blue];const rgb2=[rgba2.red,rgba2.green,rgba2.blue];const[r,g,b]=rgb1.map((_,idx)=>Math.round(rgb2[idx]+(rgb1[idx]-rgb2[idx])*weight));return ColorpickerWidget.convertRgbaToCSSColor(r,g,b);};const ColorpickerDialog=Dialog.extend({init:function(parent,options){this.options=options||{};this._super(parent,_.extend({size:'small',title:_t('Pick a color'),buttons:[{text:_t('Choose'),classes:'btn-primary',close:true,click:this._onFinalPick.bind(this)},{text:_t('Discard'),close:true},],},this.options));},start:function(){const proms=[this._super(...arguments)];this.colorPicker=new ColorpickerWidget(this,_.extend({colorPreview:true,},this.options));proms.push(this.colorPicker.appendTo(this.$el));return Promise.all(proms);},_onFinalPick:function(){this.trigger_up('colorpicker:saved',this.colorPicker.colorComponents);},});return{ColorpickerDialog:ColorpickerDialog,ColorpickerWidget:ColorpickerWidget,};});; 6213 6214/* /web/static/src/legacy/js/widgets/translation_dialog.js */ 6215odoo.define('web.TranslationDialog',function(require){'use strict';var core=require('web.core');var Dialog=require('web.Dialog');var session=require('web.session');var _t=core._t;var TranslationDialog=Dialog.extend({template:'web.TranslationDialogWidget',init:function(parent,options){options=options||{};this.fieldName=options.fieldName;this.resId=options.resId;this.userLanguageValue=options.userLanguageValue;this.dataPointModel=options.dataPointModel;this.dataPointID=options.dataPointID;this.isComingFromTranslationAlert=options.isComingFromTranslationAlert;this.currentInterfaceLanguage=session.user_context.lang;this.context=options.context;this._super(parent,_.extend({size:'large',title:_.str.sprintf(_t('Translate: %s'),this.fieldName),buttons:[{text:_t('Save'),classes:'btn-primary',close:true,click:this._onSave.bind(this)},{text:_t('Discard'),close:true},],},options));},willStart:function(){return Promise.all([this._super(),this._loadLanguages().then((l)=>{this.languages=l;return this._loadTranslations().then((t)=>{[this.translations,this.context]=t;let id=1;this.translations.forEach((t)=>t['id']=id++);this.isText=this.context.translation_type==='text';this.showSource=this.context.translation_show_source;});}),]).then(()=>{this.data=this.translations.map((term)=>{let relatedLanguage=this.languages.find((language)=>language[0]===term.lang);return{id:term.id,lang:term.lang,langName:relatedLanguage[1],source:term.source,value:(term.lang===this.currentInterfaceLanguage&&!this.showSource&&!this.isComingFromTranslationAlert)?this.userLanguageValue:term.value||''};});this.data.sort((left,right)=>left.langName.localeCompare(right.langName));});},_loadTranslations:function(){return this._rpc({model:this.dataPointModel,method:'get_field_translations',args:[[this.resId],this.fieldName],context:this.context,});},_loadLanguages:function(){if(TranslationDialog.prototype.installedLanguagesCache) 6216return Promise.resolve(TranslationDialog.prototype.installedLanguagesCache);return this._rpc({model:'res.lang',method:'get_installed',fields:['code','name','iso_code'],}).then((installedLanguages)=>{TranslationDialog.prototype.installedLanguagesCache=installedLanguages;return TranslationDialog.prototype.installedLanguagesCache});},_onSave:function(){var updatedTerm={};var updateFormViewField;this.el.querySelectorAll('input[type=text],textarea').forEach((t)=>{var initialValue=this.data.find((d)=>d.id==t.dataset.id);if(initialValue.value!==t.value){updatedTerm[t.dataset.id]={lang:initialValue.lang,source:initialValue.source,value:t.value,initialValue:initialValue.value};if(initialValue.lang===this.currentInterfaceLanguage&&!this.showSource){var changes={};changes[this.fieldName]=t.value;updateFormViewField={dataPointID:this.dataPointID,changes:changes,doNotSetDirty:false,};}}});const translations={};if(this.showSource){Object.entries(updatedTerm).forEach(([id,term])=>{if(!translations[term.lang]){translations[term.lang]={};} 6217const source=term.initialValue?term.initialValue:term.source;translations[term.lang][source]=term.value;});} 6218else{Object.entries(updatedTerm).forEach(([id,term])=>translations[term.lang]=term.value);} 6219return this._rpc({model:this.dataPointModel,method:'update_field_translations',args:[[this.resId],this.fieldName,translations],}).then(()=>
6219{if(updateFormViewField){this.trigger_up('field_changed',updateFormViewField);}});}});return TranslationDialog;});; 6220 6221/* /web/static/src/env.js */ 6222odoo.define('@web/env',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{EventBus}=require("@odoo/owl");__exports.makeEnv=makeEnv;function makeEnv(){return{bus:new EventBus(),services:{},debug:odoo.debug,_t:()=>{throw new Error("Translations are not ready yet. Maybe use _lt instead?");},get isSmall(){throw new Error("UI service not initialized!");},};} 6223const serviceRegistry=registry.category("services");const SERVICES_METADATA=__exports.SERVICES_METADATA={};let startServicesPromise=null;__exports.startServices=startServices;async function startServices(env){const toStart=new Set();serviceRegistry.addEventListener("UPDATE",async(ev)=>{await Promise.resolve();const{operation,key:name,value:service}=ev.detail;if(operation==="delete"){return;} 6224if(toStart.size){const namedService=Object.assign(Object.create(service),{name});toStart.add(namedService);}else{await _startServices(env,toStart);}});await Promise.resolve();await _startServices(env,toStart);} 6225async function _startServices(env,toStart){if(startServicesPromise){return startServicesPromise.then(()=>_startServices(env,toStart));} 6226const services=env.services;for(const[name,service]of serviceRegistry.getEntries()){if(!(name in services)){const namedService=Object.assign(Object.create(service),{name});toStart.add(namedService);}} 6227async function start(){let service=null;const proms=[];while((service=findNext())){const name=service.name;toStart.delete(service);const entries=(service.dependencies||[]).map((dep)=>[dep,services[dep]]);const dependencies=Object.fromEntries(entries);let value;try{value=service.start(env,dependencies);}catch(e){value=e;console.error(e);} 6228if("async"in service){SERVICES_METADATA[name]=service.async;} 6229if(value instanceof Promise){proms.push(new Promise((resolve)=>{value.then((val)=>{services[name]=val||null;}).catch((error)=>{services[name]=error;console.error("Can't load service '"+name+"' because:",error);}).finally(resolve);}));}else{services[service.name]=value||null;}} 6230await Promise.all(proms);if(proms.length){return start();}} 6231startServicesPromise=start();await startServicesPromise;startServicesPromise=null;if(toStart.size){const names=[...toStart].map((s)=>s.name);const missingDeps=new Set();[...toStart].forEach((s)=>s.dependencies.forEach((dep)=>{if(!(dep in services)&&!names.includes(dep)){missingDeps.add(dep);}}));const depNames=[...missingDeps].join(", ");throw new Error(`Some services could not be started: ${names}. Missing dependencies: ${depNames}`);} 6232function findNext(){for(const s of toStart){if(s.dependencies){if(s.dependencies.every((d)=>d in services)){return s;}}else{return s;}} 6233return null;}} 6234return __exports;});; 6235 6236/* /web/static/src/core/action_swiper/action_swiper.js */ 6237odoo.define('@web/core/action_swiper/action_swiper',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{localization}=require("@web/core/l10n/localization");const{clamp}=require("@web/core/utils/numbers");const{Component,onMounted,onWillUnmount,useRef,useState}=require("@odoo/owl");const isScrollSwipable=(scrollables)=>{return{left:!scrollables.filter((e)=>e.scrollLeft!==0).length,right:!scrollables.filter((e)=>e.scrollLeft+Math.round(e.getBoundingClientRect().width)!==e.scrollWidth).length,};};const ActionSwiper=__exports.ActionSwiper=class ActionSwiper extends Component{setup(){this.actionTimeoutId=null;this.resetTimeoutId=null;this.defaultState={containerStyle:"",isSwiping:false,width:undefined,};this.root=useRef("root");this.targetContainer=useRef("targetContainer");this.state=useState({...this.defaultState});this.scrollables=undefined;this.startX=undefined;this.swipedDistance=0;this.isScrollValidated=false;onMounted(()=>{if(this.targetContainer.el){this.state.width=this.targetContainer.el.getBoundingClientRect().width;} 6238if(this.props.onLeftSwipe||this.props.onRightSwipe){const classes=new Set(this.root.el.classList);classes.delete("o_actionswiper");for(const className of classes){this.targetContainer.el.firstChild.classList.add(className);this.root.el.classList.remove(className);}}});onWillUnmount(()=>{browser.clearTimeout(this.actionTimeoutId);browser.clearTimeout(this.resetTimeoutId);});} 6239get localizedProps(){return{onLeftSwipe:localization.direction==="rtl"?this.props.onRightSwipe:this.props.onLeftSwipe,onRightSwipe:localization.direction==="rtl"?this.props.onLeftSwipe:this.props.onRightSwipe,};} 6240_onTouchEndSwipe(){if(this.state.isSwiping){this.state.isSwiping=false;if(this.localizedProps.onRightSwipe&&this.swipedDistance>this.state.width/this.props.swipeDistanceRatio){this.swipedDistance=this.state.width;this.handleSwipe(this.localizedProps.onRightSwipe.action);}else if(this.localizedProps.onLeftSwipe&&this.swipedDistance<-this.state.width/this.props.swipeDistanceRatio){this.swipedDistance=-this.state.width;this.handleSwipe(this.localizedProps.onLeftSwipe.action);}else{this.state.containerStyle="";}}} 6241_onTouchMoveSwipe(ev){if(this.state.isSwiping){if(this.props.swipeInvalid&&this.props.swipeInvalid()){this.state.isSwiping=false;return;} 6242const{onLeftSwipe,onRightSwipe}=this.localizedProps;this.swipedDistance=clamp(ev.touches[0].clientX-this.startX,onLeftSwipe?-this.state.width:0,onRightSwipe?this.state.width:0);if(Math.abs(this.swipedDistance)>40){ev.preventDefault();} 6243if(!this.isScrollValidated&&this.scrollables&&!isScrollSwipable(this.scrollables)[this.swipedDistance>0?"left":"right"]){return this._reset();} 6244this.isScrollValidated=true;if(this.props.animationOnMove){this.state.containerStyle=`transform: translateX(${this.swipedDistance}px)`;}}} 6245_onTouchStartSwipe(ev){this.scrollables=ev.composedPath().filter((e)=>
6245e.nodeType===1&&this.targetContainer.el.contains(e)&&e.scrollWidth>e.getBoundingClientRect().width&&["auto","scroll"].includes(window.getComputedStyle(e)["overflow-x"]));if(!this.state.width){this.state.width=this.targetContainer&&this.targetContainer.el.getBoundingClientRect().width;} 6246this.state.isSwiping=true;this.isScrollValidated=false;this.startX=ev.touches[0].clientX;} 6247_reset(){Object.assign(this.state,{...this.defaultState});this.scrollables=undefined;this.startX=undefined;this.swipedDistance=0;this.isScrollValidated=false;} 6248handleSwipe(action){if(this.props.animationType==="bounce"){this.state.containerStyle=`transform: translateX(${this.swipedDistance}px)`;this.actionTimeoutId=browser.setTimeout(async()=>{await action();this._reset();},500);}else if(this.props.animationType==="forwards"){this.state.containerStyle=`transform: translateX(${this.swipedDistance}px)`;this.actionTimeoutId=browser.setTimeout(async()=>{await action();this.state.isSwiping=true;this.state.containerStyle=`transform: translateX(${-this.swipedDistance}px)`;this.resetTimeoutId=browser.setTimeout(()=>{this._reset();},100);},100);}else{return action();}}} 6249ActionSwiper.props={onLeftSwipe:{type:Object,args:{action:Function,icon:String,bgColor:String,},optional:true,},onRightSwipe:{type:Object,args:{action:Function,icon:String,bgColor:String,},optional:true,},slots:Object,animationOnMove:{type:Boolean,optional:true},animationType:{type:String,optional:true},swipeDistanceRatio:{type:Number,optional:true},swipeInvalid:{type:Function,optional:true},};ActionSwiper.defaultProps={onLeftSwipe:undefined,onRightSwipe:undefined,animationOnMove:true,animationType:"bounce",swipeDistanceRatio:2,};ActionSwiper.template="web.ActionSwiper";return __exports;});; 6250 6251/* /web/static/src/core/assets.js */ 6252odoo.define('@web/core/assets',async function(require){'use strict';let __exports={};const{memoize}=require("@web/core/utils/functions");const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const{session}=require("@web/session");const assets=__exports.assets={retries:{count:3,delay:5000,extraDelay:2500,},};class AssetsLoadingError extends Error{} 6253const _loadJS=__exports._loadJS=(assets.loadJS=memoize(function loadJS(url){if(document.querySelector(`script[src="${url}"]`)){return Promise.resolve();} 6254const scriptEl=document.createElement("script");scriptEl.type="text/javascript";scriptEl.src=url;document.head.appendChild(scriptEl);return new Promise((resolve,reject)=>{scriptEl.addEventListener("load",()=>resolve(true));scriptEl.addEventListener("error",()=>{reject(new AssetsLoadingError(`The loading of ${url} failed`));});});}));const _loadCSS=__exports._loadCSS=(assets.loadCSS=memoize(function loadCSS(url,retryCount=0){if(document.querySelector(`link[href="${url}"]`)){return Promise.resolve();} 6255const linkEl=document.createElement("link");linkEl.type="text/css";linkEl.rel="stylesheet";linkEl.href=url;const promise=new Promise((resolve,reject)=>{linkEl.addEventListener("load",()=>resolve(true));linkEl.addEventListener("error",async()=>{if(retryCount<assets.retries.count){await new Promise(resolve=>setTimeout(resolve,assets.retries.delay+assets.retries.extraDelay*retryCount));linkEl.remove();loadCSS(url,retryCount+1).then(resolve).catch(reject);}else{reject(new AssetsLoadingError(`The loading of ${url} failed`));}});});document.head.appendChild(linkEl);return promise;}));const templates=__exports.templates=new DOMParser().parseFromString("<odoo/>","text/xml");let defaultApp;const _loadXML=__exports._loadXML=(assets.loadXML=function loadXML(xml,app=defaultApp){const doc=new DOMParser().parseFromString(xml,"text/xml");if(doc.querySelector("parsererror")){throw new Error(doc.querySelector("parsererror").textContent.trim());} 6256for(const element of doc.querySelectorAll("templates > [t-name][owl]")){element.removeAttribute("owl");const name=element.getAttribute("t-name");const previous=templates.querySelector(`[t-name="${name}"]`);if(previous){console.debug("Override template: "+name);previous.replaceWith(element);}else{templates.documentElement.appendChild(element);}} 6257if(app||defaultApp){console.debug("Add templates in Owl app.");app.addTemplates(templates,app||defaultApp);}else{console.debug("Add templates on window Owl container.");}});
6257__exports.setLoadXmlDefaultApp=setLoadXmlDefaultApp;function setLoadXmlDefaultApp(app){defaultApp=app;} 6258const _getBundle=__exports._getBundle=(assets.getBundle=memoize(async function getBundle(bundleName){const url=new URL(`/web/bundle/${bundleName}`,location.origin);for(const[key,value]of Object.entries(session.bundle_params||{})){url.searchParams.set(key,value);} 6259const response=await browser.fetch(url.href);const json=await response.json();const assets={cssLibs:[],cssContents:[],jsLibs:[],jsContents:[],};for(const key in json){const file=json[key];if(file.type==="link"){assets.cssLibs.push(file.src);}else if(file.type==="style"){assets.cssContents.push(file.content);}else{if(file.src){assets.jsLibs.push(file.src);}else{assets.jsContents.push(file.content);}}} 6260return assets;}));const _loadBundle=__exports._loadBundle=(assets.loadBundle=async function loadBundle(desc){const promiseCSS=Promise.all((desc.cssLibs||[]).map(assets.loadCSS)).then(()=>{if(desc.cssContents&&desc.cssContents.length){const style=document.createElement("style");style.textContent=desc.cssContents.join("\n");document.head.appendChild(style);}});for(const urlData of desc.jsLibs||[]){if(typeof urlData==="string"){await assets.loadJS(urlData);const bundle=urlData.match(/\/web\/assets\/.*\/([^/]+?)(\.min)?\.js/);if(bundle){await odoo.ready(bundle[1]+".bundle.xml");}}else{await Promise.all(urlData.map(loadJS));}} 6261if(desc.jsContents&&desc.jsContents.length){const script=document.createElement("script");script.type="text/javascript";script.textContent=desc.jsContents.join("\n");document.head.appendChild(script);} 6262await promiseCSS;for(const bundleName of desc.assetLibs||[]){if(typeof bundleName==="string"){const desc=await assets.getBundle(bundleName);await assets.loadBundle(desc);}else{await Promise.all(bundleName.map(async(bundleName)=>{const desc=await assets.getBundle(bundleName);return assets.loadBundle(desc);}));}}});const loadJS=__exports.loadJS=function(url){return assets.loadJS(url);};const loadCSS=__exports.loadCSS=function(url){return assets.loadCSS(url);};const loadXML=__exports.loadXML=function(xml,app=defaultApp){return assets.loadXML(xml,app);};const getBundle=__exports.getBundle=function(bundleName){return assets.getBundle(bundleName);};const loadBundle=__exports.loadBundle=function(desc){return assets.loadBundle(desc);};const{Component,xml,onWillStart}=require("@odoo/owl");const LazyComponent=__exports.LazyComponent=class LazyComponent extends Component{setup(){onWillStart(async()=>{const bundle=await getBundle(this.props.bundle);await loadBundle(bundle);this.Component=registry.category("lazy_components").get(this.props.Component);});}} 6263LazyComponent.template=xml`<t t-component="Component" t-props="props.props"/>`;LazyComponent.props={Component:String,bundle:String,props:{type:Object,optional:true},};return __exports;});; 6264 6265/* /web/static/src/core/autocomplete/autocomplete.js */ 6266odoo.define('@web/core/autocomplete/autocomplete',async function(require){'use strict';let __exports={};const{Deferred}=require("@web/core/utils/concurrency");const{useForwardRefToParent,useService}=require("@web/core/utils/hooks");const{useDebounced}=require("@web/core/utils/timing");const{getActiveHotkey}=require("@web/core/hotkeys/hotkey_service");const{usePosition}=require("@web/core/position_hook");const{Component,useExternalListener,useRef,useState}=require("@odoo/owl");const AutoComplete=__exports.AutoComplete=class AutoComplete extends Component{setup(){this.nextSourceId=0;this.nextOptionId=0;this.sources=[];this.state=useState({navigationRev:0,optionsRev:0,open:false,activeSourceOption:null,value:this.props.value,});this.inputRef=useForwardRefToParent("input");this.root=useRef("root");this.debouncedProcessInput=useDebounced(async()=>{const currentPromise=this.pendingPromise;this.pendingPromise=null;this.props.onInput({inputValue:this.inputRef.el.value,});try{await this.open(true);currentPromise.resolve();}catch{currentPromise.reject();}finally{if(currentPromise===this.loadingPromise){this.loadingPromise=null;}}},this.constructor.timeout);useExternalListener(window,"scroll",this.externalClose,true);useExternalListener(window,"pointerdown",this.externalClose,true);this.hotkey=useService("hotkey");this.hotkeysToRemove=[];owl.onWillUpdateProps((nextProps)=>
6266{if(this.props.value!==nextProps.value||this.forceValFromProp){this.forceValFromProp=false;this.state.value=nextProps.value;this.inputRef.el.value=nextProps.value;this.close();}});usePosition(()=>this.inputRef.el,{popper:"sourcesList",position:"bottom-start",});} 6267get activeSourceOptionId(){if(!this.isOpened||!this.state.activeSourceOption){return undefined;} 6268const[sourceIndex,optionIndex]=this.state.activeSourceOption;const source=this.sources[sourceIndex];return`${this.props.id || "autocomplete"}_${sourceIndex}_${ 6269 source.isLoading ? "loading" : optionIndex 6270 }`;} 6271get isOpened(){return this.state.open;} 6272get hasOptions(){for(const source of this.sources){if(source.isLoading||source.options.length){return true;}} 6273return false;} 6274get activeOption(){const[sourceIndex,optionIndex]=this.state.activeSourceOption;return this.sources[sourceIndex].options[optionIndex];} 6275open(useInput=false){this.state.open=true;return this.loadSources(useInput);} 6276close(){this.state.open=false;this.state.activeSourceOption=null;} 6277cancel(){if(this.inputRef.el.value.length){if(this.props.autoSelect){this.inputRef.el.value=this.props.value;this.props.onCancel();}} 6278this.close();} 6279async loadSources(useInput){this.sources=[];this.state.activeSourceOption=null;const proms=[];for(const pSource of this.props.sources){const source=this.makeSource(pSource);this.sources.push(source);const options=this.loadOptions(pSource.options,useInput?this.inputRef.el.value.trim():"");if(options instanceof Promise){source.isLoading=true;const prom=options.then((options)=>{source.options=options.map((option)=>this.makeOption(option));source.isLoading=false;this.state.optionsRev++;});proms.push(prom);}else{source.options=options.map((option)=>this.makeOption(option));}} 6280await Promise.all(proms);this.navigate(0);} 6281loadOptions(options,request){if(typeof options==="function"){return options(request);}else{return options;}} 6282makeOption(option){return Object.assign(Object.create(option),{id:++this.nextOptionId,});} 6283makeSource(source){return{id:++this.nextSourceId,options:[],isLoading:false,placeholder:source.placeholder,optionTemplate:source.optionTemplate,};} 6284isActiveSourceOption([sourceIndex,optionIndex]){return(this.state.activeSourceOption&&this.state.activeSourceOption[0]===sourceIndex&&this.state.activeSourceOption[1]===optionIndex);} 6285selectOption(option,params={}){if(option.unselectable){this.inputRef.el.value="";this.close();return;} 6286if(this.props.resetOnSelect){this.inputRef.el.value="";} 6287this.forceValFromProp=true;this.props.onSelect(option,{...params,input:this.inputRef.el,});const customEvent=new CustomEvent("AutoComplete:OPTION_SELECTED",{bubbles:true});this.root.el.dispatchEvent(customEvent);this.close();} 6288navigate(direction){let step=Math.sign(direction);if(!step){this.state.activeSourceOption=null;step=1;}else{this.state.navigationRev++;} 6289if(this.state.activeSourceOption){let[sourceIndex,optionIndex]=this.state.activeSourceOption;let source=this.sources[sourceIndex];optionIndex+=step;if(0>optionIndex||optionIndex>=source.options.length){sourceIndex+=step;source=this.sources[sourceIndex];while(source&&source.isLoading){sourceIndex+=step;source=this.sources[sourceIndex];} 6290if(source){optionIndex=step<0?source.options.length-1:0;}} 6291this.state.activeSourceOption=source?[sourceIndex,optionIndex]:null;}else{let sourceIndex=step<0?this.sources.length-1:0;let source=this.sources[sourceIndex];while(source&&source.isLoading){sourceIndex+=step;source=this.sources[sourceIndex];} 6292if(source){const optionIndex=step<0?source.options.length-1:0;if(optionIndex<source.options.length){this.state.activeSourceOption=[sourceIndex,optionIndex];}}}} 6293onInputBlur(){if(this.ignoreBlur){this.ignoreBlur=false;return;} 6294this.props.onBlur({inputValue:this.inputRef.el.value,});} 6295onInputClick(){if(!this.isOpened){this.open(this.inputRef.el.value.trim()!==this.props.value.trim());}else{this.close();}} 6296onInputChange(ev){if(this.ignoreBlur){ev.stopImmediatePropagation();} 6297this.props.onChange({inputValue:this.inputRef.el.value,});} 6298async onInput(){this.pendingPromise=this.pendingPromise||new Deferred();this.loadingPromise=this.pendingPromise;this.debouncedProcessInput();} 6299async onInputKeydown(ev){const hotkey=getActiveHotkey(ev);const isSelectKey=hotkey==="enter"||hotkey==="tab";if(this.loadingPromise&&isSelectKey){if(hotkey==="enter"){ev.stopPropagation();ev.preventDefault();} 6300await this.loadingPromise;} 6301switch(hotkey){case"enter":if(!this.isOpened||!this.state.activeSourceOption){return;} 6302this.selectOption(this.activeOption);break;case"escape":if(!this.isOpened){return;} 6303this.cancel();break;case"tab":if(!this.isOpened){return;} 6304if(this.props.autoSelect&&this.state.activeSourceOption&&(this.state.navigationRev>0||this.inputRef.el.value.length>0)){this.selectOption(this.activeOption);} 6305this.close();return;case"arrowup":this.navigate(-1);if(!this.isOpened){this.open(true);} 6306break;case"arrowdown":this.navigate(+1);if(!this.isOpened){this.open(true);} 6307break;default:return;} 6308ev.stopPropagation();ev.preventDefault();} 6309onOptionMouseEnter(indices){this.state.activeSourceOption=indices;} 6310onOptionMouseLeave(){this.state.activeSourceOption=null;} 6311onOptionClick(option){this.selectOption(option);this.inputRef.el.focus();} 6312externalClose(ev){if(this.isOpened&&!this.root.el.contains(ev.target)){this.cancel();}}} 6313Object.assign(AutoComplete,{template:"web.AutoComplete",props:{value:{type:String},id:{type:String,optional:true},onSelect:{type:Function},sources:{type:Array,element:{type:Object,shape:{placeholder:{type:String,optional:true},optionTemplate:{type:String,optional:true},options:[Array,Function],},},},placeholder:{type:String,optional:true},autoSelect:{type:Boolean,optional:true},resetOnSelect:{type:Boolean,optional:true},onCancel:{type:Function,optional:true},onInput:{type:Function,optional:true},onChange:{type:Function,optional:true},onBlur:{type:Function,optional:true},input:{type:Function,optional:true},},defaultProps:{placeholder:"",autoSelect:false,onCancel:()=>{},onInput:()=>{},onChange:()=>{},onBlur:()=>{},},timeout:250,});return __exports;});; 6314 6315/* /web/static/src/core/browser/browser.js */ 6316odoo.define('@web/core/browser/browser',async function(require){'use strict';let __exports={};let sessionStorage;let localStorage;try{sessionStorage=window.sessionStorage;localStorage=window.localStorage;localStorage.setItem("__localStorage__","true");localStorage.removeItem("__localStorage__");}catch(_e){localStorage=makeRAMLocalStorage();sessionStorage=makeRAMLocalStorage();} 6317const browser=__exports.browser={addEventListener:window.addEventListener.bind(window),removeEventListener:window.removeEventListener.bind(window),setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),performance:window.performance,requestAnimationFrame:window.requestAnimationFrame.bind(window),cancelAnimationFrame:window.cancelAnimationFrame.bind(window),console:window.console,history:window.history,navigator,Notification:window.Notification,open:window.open.bind(window),SharedWorker:window.SharedWorker,Worker:window.Worker,XMLHttpRequest:window.XMLHttpRequest,localStorage,sessionStorage,fetch:window.fetch.bind(window),innerHeight:window.innerHeight,innerWidth:window.innerWidth,ontouchstart:window.ontouchstart,};Object.defineProperty(browser,"location",{set(val){window.location=val;},get(){return window.location;},configurable:true,});
6317Object.defineProperty(browser,"innerHeight",{get:()=>window.innerHeight,configurable:true,});Object.defineProperty(browser,"innerWidth",{get:()=>window.innerWidth,configurable:true,});__exports.makeRAMLocalStorage=makeRAMLocalStorage;function makeRAMLocalStorage(){let store={};return{setItem(key,value){const newValue=String(value);store[key]=newValue;window.dispatchEvent(new StorageEvent("storage",{key,newValue}));},getItem(key){return store[key];},clear(){store={};},removeItem(key){delete store[key];window.dispatchEvent(new StorageEvent("storage",{key,newValue:null}));},get length(){return Object.keys(store).length;},key(){return"";},};} 6318return __exports;});; 6319 6320/* /web/static/src/core/browser/cookie_service.js */ 6321odoo.define('@web/core/browser/cookie_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const COOKIE_TTL=24*60*60*365;function parseCookieString(str){const cookie={};const parts=str.split("; ");for(const part of parts){const[key,value]=part.split("=");cookie[key]=value||"";} 6322return cookie;} 6323function cookieToString(key,value,ttl=COOKIE_TTL){let fullCookie=[];if(value!==undefined){fullCookie.push(`${key}=${value}`);} 6324fullCookie=fullCookie.concat(["path=/",`max-age=${ttl}`]);return fullCookie.join(";");} 6325function makeCookieService(){function getCurrent(){return parseCookieString(document.cookie);} 6326let cookie=getCurrent();function setCookie(key,value,ttl){document.cookie=cookieToString(key,value,ttl);cookie=getCurrent();} 6327return{get current(){return cookie;},setCookie,deleteCookie(key){setCookie(key,"kill",0);},};} 6328const cookieService=__exports.cookieService={start(){return makeCookieService();},};registry.category("services").add("cookie",cookieService);return __exports;});; 6329 6330/* /web/static/src/core/browser/feature_detection.js */ 6331odoo.define('@web/core/browser/feature_detection',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");__exports.isBrowserChrome=isBrowserChrome;function isBrowserChrome(){return browser.navigator.userAgent.includes("Chrome");} 6332__exports.isBrowserFirefox=isBrowserFirefox;function isBrowserFirefox(){return browser.navigator.userAgent.includes("Firefox");} 6333__exports.isAndroid=isAndroid;function isAndroid(){return/Android/i.test(browser.navigator.userAgent);} 6334__exports.isIOS=isIOS;function isIOS(){return(/(iPad|iPhone|iPod)/i.test(browser.navigator.userAgent)||(browser.navigator.platform==="MacIntel"&&maxTouchPoints()>1));} 6335__exports.isOtherMobileOS=isOtherMobileOS;function isOtherMobileOS(){return/(webOS|BlackBerry|Windows Phone)/i.test(browser.navigator.userAgent);} 6336__exports.isMacOS=isMacOS;function isMacOS(){return Boolean(browser.navigator.userAgent.match(/Mac/i));} 6337__exports.isMobileOS=isMobileOS;function isMobileOS(){return isAndroid()||isIOS()||isOtherMobileOS();} 6338__exports.isIosApp=isIosApp;function isIosApp(){return/OdooMobile \(iOS\)/i.test(browser.navigator.userAgent);} 6339__exports.hasTouch=hasTouch;function hasTouch(){return browser.ontouchstart!==undefined;} 6340__exports.maxTouchPoints=maxTouchPoints;function maxTouchPoints(){return browser.navigator.maxTouchPoints||1;} 6341return __exports;});; 6342 6343/* /web/static/src/core/browser/router_service.js */ 6344odoo.define('@web/core/browser/router_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{shallowEqual}=require("@web/core/utils/objects");const{objectToUrlEncodedString}=require("@web/core/utils/urls");const{browser}=require("@web/core/browser/browser");function cast(value){return!value||isNaN(value)?value:Number(value);} 6345function parseString(str){const parts=str.split("&");const result={};for(const part of parts){const[key,value]=part.split("=");const decoded=decodeURIComponent(value||"");result[key]=cast(decoded);} 6346return result;} 6347function applyLocking(lockedKeys,hash,currentHash,options={}){const newHash={};for(const key in hash){if("lock"in options){options.lock?lockedKeys.add(key):lockedKeys.delete(key);}else if(lockedKeys.has(key)){continue;} 6348newHash[key]=hash[key];} 6349for(const key in currentHash){if(lockedKeys.has(key)&&!(key in newHash)){newHash[key]=currentHash[key];}} 6350return newHash;} 6351function computeNewRoute(hash,replace,currentRoute){if(!replace){hash=Object.assign({},currentRoute.hash,hash);} 6352hash=sanitizeHash(hash);if(!shallowEqual(currentRoute.hash,hash)){return Object.assign({},currentRoute,{hash});} 6353return false;} 6354function sanitizeHash(hash){return Object.fromEntries(Object.entries(hash).filter(([,v])=>v!==undefined).map(([k,v])=>[k,cast(v)]));} 6355__exports.parseHash=parseHash;function parseHash(hash){return hash&&hash!=="#"?parseString(hash.slice(1)):{};}
6356__exports.parseSearchQuery=parseSearchQuery;function parseSearchQuery(search){return search?parseString(search.slice(1)):{};} 6357__exports.routeToUrl=routeToUrl;function routeToUrl(route){const search=objectToUrlEncodedString(route.search);const hash=objectToUrlEncodedString(route.hash);return route.pathname+(search?"?"+search:"")+(hash?"#"+hash:"");} 6358async function redirect(env,url,wait=false){if(wait){await new Promise((resolve)=>{const waitForServer=(delay)=>{browser.setTimeout(async()=>{env.services.rpc("/web/webclient/version_info",{}).then(resolve).catch(()=>waitForServer(250));},delay);};waitForServer(1000);});} 6359browser.location.assign(url);} 6360function getRoute(urlObj){const{pathname,search,hash}=urlObj;const searchQuery=parseSearchQuery(search);const hashQuery=parseHash(hash);return{pathname,search:searchQuery,hash:hashQuery};} 6361function makeRouter(env){const bus=env.bus;const lockedKeys=new Set();let current=getRoute(browser.location);let pushTimeout;browser.addEventListener("hashchange",(ev)=>{browser.clearTimeout(pushTimeout);const loc=new URL(ev.newURL);current=getRoute(loc);bus.trigger("ROUTE_CHANGE");});browser.addEventListener("pageshow",(ev)=>{if(ev.persisted){browser.clearTimeout(pushTimeout);bus.trigger("ROUTE_CHANGE");}});function makeDebouncedPush(mode){let allPushArgs=[];function doPush(){const replace=allPushArgs.some(([,options])=>options&&options.replace);const newHash=allPushArgs.reduce((finalHash,[hash,options])=>{hash=applyLocking(lockedKeys,hash,current.hash,options);if(finalHash){hash=applyLocking(lockedKeys,hash,finalHash,options);} 6362return Object.assign(finalHash||{},hash);},null);const newRoute=computeNewRoute(newHash,replace,current);if(!newRoute){return;} 6363const url=browser.location.origin+routeToUrl(newRoute);if(mode==="push"){browser.history.pushState({},"",url);}else{browser.history.replaceState({},"",url);} 6364current=getRoute(browser.location);} 6365return function pushOrReplaceState(hash,options){allPushArgs.push([hash,options]);browser.clearTimeout(pushTimeout);pushTimeout=browser.setTimeout(()=>{doPush();pushTimeout=null;allPushArgs=[];});};} 6366return{get current(){return current;},pushState:makeDebouncedPush("push"),replaceState:makeDebouncedPush("replace"),redirect:(url,wait)=>redirect(env,url,wait),cancelPushes:()=>browser.clearTimeout(pushTimeout),};} 6367const routerService=__exports.routerService={start(env){return makeRouter(env);},};__exports.objectToQuery=objectToQuery;function objectToQuery(obj){const query={};Object.entries(obj).forEach(([k,v])=>{query[k]=v?String(v):v;});return query;} 6368registry.category("services").add("router",routerService);return __exports;});; 6369 6370/* /web/static/src/core/browser/title_service.js */ 6371odoo.define('@web/core/browser/title_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const titleService=__exports.titleService={start(){const titleParts={};function getParts(){return Object.assign({},titleParts);} 6372function setParts(parts){for(const key in parts){const val=parts[key];if(!val){delete titleParts[key];}else{titleParts[key]=val;}} 6373document.title=Object.values(titleParts).join(" - ");} 6374return{get current(){return document.title;},getParts,setParts,};},};registry.category("services").add("title",titleService);return __exports;});; 6375 6376/* /web/static/src/core/checkbox/checkbox.js */ 6377odoo.define('@web/core/checkbox/checkbox',async function(require){'use strict';let __exports={};const{useHotkey}=require("@web/core/hotkeys/hotkey_hook");const{Component,useRef}=require("@odoo/owl");const CheckBox=__exports.CheckBox=class CheckBox extends Component{setup(){this.id=`checkbox-comp-${CheckBox.nextId++}`;this.rootRef=useRef("root");useHotkey("Enter",({area})=>{const oldValue=area.querySelector("input").checked;this.props.onChange(!oldValue);},{area:()=>this.rootRef.el,bypassEditableProtection:true});} 6378onClick(ev){if(ev.composedPath().find((el)=>["INPUT","LABEL"].includes(el.tagName))){ev.stopPropagation();return;} 6379const input=this.rootRef.el.querySelector("input");input.focus();if(!this.props.disabled){ev.stopPropagation();input.checked=!input.checked;this.props.onChange(input.checked);}} 6380onChange(ev){if(!this.props.disabled){this.props.onChange(ev.target.checked);}}} 6381CheckBox.template="web.CheckBox";CheckBox.nextId=1;
6381CheckBox.defaultProps={onChange:()=>{},};CheckBox.props={id:{type:true,optional:true,},disabled:{type:Boolean,optional:true,},value:{type:Boolean,optional:true,},slots:{type:Object,optional:true,},onChange:{type:Function,optional:true,},className:{type:String,optional:true,},name:{type:String,optional:true,},};return __exports;});; 6382 6383/* /web/static/src/core/colorlist/colorlist.js */ 6384odoo.define('@web/core/colorlist/colorlist',async function(require){'use strict';let __exports={};const{_lt}=require("@web/core/l10n/translation");const{Component,useRef,useState,useExternalListener}=require("@odoo/owl");const ColorList=__exports.ColorList=class ColorList extends Component{setup(){this.colorlistRef=useRef("colorlist");this.state=useState({isExpanded:this.props.isExpanded});useExternalListener(window,"click",this.onOutsideClick);} 6385get colors(){return this.constructor.COLORS;} 6386onColorSelected(id){this.props.onColorSelected(id);if(!this.props.forceExpanded){this.state.isExpanded=false;}} 6387onOutsideClick(ev){if(this.colorlistRef.el.contains(ev.target)||this.props.forceExpanded){return;} 6388this.state.isExpanded=false;} 6389onToggle(ev){if(this.props.canToggle){ev.preventDefault();ev.stopPropagation();this.state.isExpanded=!this.state.isExpanded;this.colorlistRef.el.firstElementChild.focus();}}} 6390ColorList.COLORS=[_lt("No color"),_lt("Red"),_lt("Orange"),_lt("Yellow"),_lt("Light blue"),_lt("Dark purple"),_lt("Salmon pink"),_lt("Medium blue"),_lt("Dark blue"),_lt("Fuchsia"),_lt("Green"),_lt("Purple"),];ColorList.template="web.ColorList";ColorList.defaultProps={forceExpanded:false,isExpanded:false,};ColorList.props={canToggle:{type:Boolean,optional:true},colors:Array,forceExpanded:{type:Boolean,optional:true},isExpanded:{type:Boolean,optional:true},onColorSelected:Function,selectedColor:{type:Number,optional:true},};return __exports;});; 6391 6392/* /web/static/src/core/confirmation_dialog/confirmation_dialog.js */ 6393odoo.define('@web/core/confirmation_dialog/confirmation_dialog',async function(require){'use strict';let __exports={};const{Dialog}=require("@web/core/dialog/dialog");const{_lt}=require("@web/core/l10n/translation");const{useChildRef}=require("@web/core/utils/hooks");const{Component}=require("@odoo/owl");const ConfirmationDialog=__exports.ConfirmationDialog=class ConfirmationDialog extends Component{setup(){this.env.dialogData.close=()=>this._cancel();this.modalRef=useChildRef();this.isConfirmedOrCancelled=false;} 6394async _cancel(){if(this.isConfirmedOrCancelled){return;} 6395this.isConfirmedOrCancelled=true;this.disableButtons();if(this.props.cancel){try{await this.props.cancel();}catch(e){this.props.close();throw e;}} 6396this.props.close();} 6397async _confirm(){if(this.isConfirmedOrCancelled){return;} 6398this.isConfirmedOrCancelled=true;this.disableButtons();if(this.props.confirm){try{await this.props.confirm();}catch(e){this.props.close();throw e;}} 6399this.props.close();} 6400disableButtons(){if(!this.modalRef.el){return;} 6401for(const button of[...this.modalRef.el.querySelectorAll(".modal-footer button")]){button.disabled=true;}}} 6402ConfirmationDialog.template="web.ConfirmationDialog";ConfirmationDialog.components={Dialog};ConfirmationDialog.props={close:Function,title:{validate:(m)=>{return(typeof m==="string"||(typeof m==="object"&&typeof m.toString==="function"));},optional:true,},body:String,confirm:{type:Function,optional:true},confirmLabel:{type:String,optional:true},cancel:{type:Function,optional:true},cancelLabel:{type:String,optional:true},};ConfirmationDialog.defaultProps={confirmLabel:_lt("Ok"),cancelLabel:_lt("Cancel"),title:_lt("Confirmation"),};const AlertDialog=__exports.AlertDialog=class AlertDialog extends ConfirmationDialog{} 6403AlertDialog.template="web.AlertDialog";AlertDialog.props={...ConfirmationDialog.props,contentClass:{type:String,optional:true},};AlertDialog.defaultProps={...ConfirmationDialog.defaultProps,title:_lt("Alert"),};return __exports;});; 6404 6405/* /web/static/src/core/context.js */ 6406odoo.define('@web/core/context',async function(require){'use strict';let __exports={};const{evaluateExpr}=require("@web/core/py_js/py");__exports.makeContext=makeContext;function makeContext(contexts,initialEvaluationContext){const evaluationContext=Object.assign({},initialEvaluationContext);const context={};for(let ctx of contexts){if(ctx!==""){ctx=typeof ctx==="string"?evaluateExpr(ctx,evaluationContext):ctx;Object.assign(context,ctx);Object.assign(evaluationContext,context);}} 6407return context;} 6408return __exports;});; 6409 6410/* /web/static/src/core/datepicker/datepicker.js */ 6411odoo.define('@web/core/datepicker/datepicker',async function(require){'use strict';let __exports={};const{Component,onMounted,onWillUnmount,onWillUpdateProps,useExternalListener,useRef,useState,}=require("@odoo/owl");const{isMobileOS}=require("@web/core/browser/feature_detection");const{formatDate,formatDateTime,luxonToMoment,luxonToMomentFormat,momentToLuxon,parseDate,parseDateTime,}=require("@web/core/l10n/dates");const{localization}=require("@web/core/l10n/localization");const{useAutofocus}=require("@web/core/utils/hooks");const{pick}=require("@web/core/utils/objects");const{DateTime}=luxon;let datePickerId=0;function areEqual(value1,value2){if(value1&&value2){return Number(value1)===Number(value2);}else{return value1===value2;}} 6412function wrapError(fn,defaultValue){return(...args)=>{const result=[defaultValue,null];try{result[0]=fn(...args);}catch(_err){result[1]=_err;} 6413return result;};} 6414const DatePicker=__exports.DatePicker=class DatePicker extends Component{setup(){this.rootRef=useRef("root");this.inputRef=useRef("input");this.hiddenInputRef=useRef("hiddenInput");this.state=useState({warning:false});this.datePickerId=`o_datepicker_${datePickerId++}`;this.isPickerOpen=false;this.isPickerChanged=false;this.pickerDate=this.props.date;this.ignorePickerEvents=true;this.initFormat();this.setDateAndFormat(this.props);useAutofocus();useExternalListener(window,"click",this.onWindowClick,{capture:true});useExternalListener(window,"scroll",this.onWindowScroll,{capture:true});onMounted(this.onMounted);onWillUpdateProps(this.onWillUpdateProps);onWillUnmount(this.onWillUnmount);} 6415onMounted(){this.bootstrapDateTimePicker(this.props);this.updateInput(this.date);this.addPickerListener("show",()=>{this.isPickerOpen=true;this.inputRef.el.select();});this.addPickerListener("change",({date})=>{if(date&&this.isPickerOpen){const{locale}=this.getOptions();this.isPickerChanged=true;this.pickerDate=momentToLuxon(date).setLocale(locale);this.updateInput(this.pickerDate);}});this.addPickerListener("hide",()=>{this.isPickerOpen=false;this.onDateChange();this.isPickerChanged=false;});this.addPickerListener("error",()=>false);this.ignorePickerEvents=false;} 6416onWillUpdateProps(nextProps){this.ignorePickerEvents=true;this.setDateAndFormat(nextProps);const shouldUpdate=this.props.revId!==nextProps.revId||Object.entries(pick(nextProps,"date","format")).some(([key,val])=>!areEqual(this.props[key],val));if(shouldUpdate&&!areEqual(this.pickerDate,nextProps.date)){if(nextProps.date){this.bootstrapDateTimePicker("date",luxonToMoment(nextProps.date));}else{this.bootstrapDateTimePicker("clear");}} 6417if(shouldUpdate){this.updateInput(this.date);} 6418if(this.isPickerOpen){this.bootstrapDateTimePicker("hide");this.bootstrapDateTimePicker("show");} 6419this.ignorePickerEvents=false;} 6420onWillUnmount(){window.$(this.rootRef.el).off();this.bootstrapDateTimePicker("destroy");} 6421addPickerListener(type,listener){return window.$(this.rootRef.el).on(`${type}.datetimepicker`,(ev)=>{if(this.ignorePickerEvents){return false;} 6422return listener(ev);});} 6423getOptions(){return{format:this.format,locale:this.props.locale||(this.date&&this.date.locale),};} 6424initFormat(){this.defaultFormat=localization.dateFormat;this.formatValue=wrapError(formatDate,"");this.parseValue=wrapError(parseDate,false);this.isLocal=false;} 6425setDateAndFormat({date,locale,format}){this.date=date&&locale?date.setLocale(locale):date;this.format=format||this.defaultFormat;this.staticFormat="yyyy-MM-dd";} 6426updateInput(value){value=value||false;const options=this.getOptions();const[formattedValue,error]=this.formatValue(value,options);if(!error){this.inputRef.el.value=formattedValue;[this.hiddenInputRef.el.value]=this.formatValue(value,{...options,format:this.staticFormat,});this.props.onUpdateInput(formattedValue);} 6427return formattedValue;} 6428bootstrapDateTimePicker(commandOrParams,...commandArgs){if(typeof commandOrParams==="object"){const params={...commandOrParams,date:this.date||null,format:luxonToMomentFormat(this.staticFormat),locale:commandOrParams.locale||(this.date&&this.date.locale),};for(const prop in params){if(params[prop]instanceof DateTime){params[prop]=luxonToMoment(params[prop]);}} 6429commandOrParams=params;} 6430window.$(this.rootRef.el).datetimepicker(commandOrParams,...commandArgs);} 6431onDateChange(){const[value,error]=this.isPickerChanged?[this.pickerDate,null]:this.parseValue(this.inputRef.el.value,this.getOptions());this.state.warning=value&&value>DateTime.local();if(error||areEqual(this.date,value)){this.updateInput(this.date);}else{this.props.onDateTimeChanged(value);} 6432if(this.pickerDate){this.inputRef.el.select();}} 6433onInputChange(){this.onDateChange();} 6434onInputInput(ev){this.isPickerChanged=false;return this.props.onInput(ev);} 6435onInputKeydown(ev){switch(ev.key){case"Escape":{if(this.isPickerOpen){ev.preventDefault();ev.stopPropagation();this.bootstrapDateTimePicker("hide");this.inputRef.el.select();} 6436break;} 6437case"Tab":{this.bootstrapDateTimePicker("hide");break;} 6438case"Enter":{this.onInputChange();break;}}} 6439onWindowClick({target}){if(target.closest(".bootstrap-datetimepicker-widget")){return;}else if(this.rootRef.el.contains(target)){this.bootstrapDateTimePicker("toggle");}else{this.bootstrapDateTimePicker("hide");}} 6440onWindowScroll(ev){if(!isMobileOS()&&ev.target!==this.inputRef.el){this.bootstrapDateTimePicker("hide");}}} 6441DatePicker.defaultProps={calendarWeeks:true,icons:{clear:"fa fa-delete",close:"fa fa-check primary",date:"fa fa-calendar",down:"fa fa-chevron-down",next:"fa fa-chevron-right",previous:"fa fa-chevron-left",time:"fa fa-clock-o",today:"fa fa-calendar-check-o",up:"fa fa-chevron-up",},inputId:"",maxDate:DateTime.fromObject({year:9999,month:12,day:31}),minDate:DateTime.fromObject({year:1000}),useCurrent:false,widgetParent:"body",onInput:()=>{},onUpdateInput:()=>{},revId:0,};DatePicker.props={onDateTimeChanged:Function,date:{type:[DateTime,{value:false}],optional:true},warn_future:{type:Boolean,optional:true},buttons:{type:Object,shape:{showClear:Boolean,showClose:Boolean,showToday:Boolean,},optional:true,},calendarWeeks:{type:Boolean,optional:true},format:{type:String,optional:true},icons:{type:Object,shape:{clear:String,close:String,date:String,down:String,next:String,previous:String,time:String,today:String,up:String,},optional:true,},inputId:{type:String,optional:true},keyBinds:{validate:(kb)=>typeof kb==="object"||kb===null,optional:true},locale:{type:String,optional:true},maxDate:{type:DateTime,optional:true},minDate:{type:DateTime,optional:true},readonly:{type:Boolean,optional:true},useCurrent:{type:Boolean,optional:true},widgetParent:{type:String,optional:true},daysOfWeekDisabled:{type:Array,optional:true},placeholder:{type:String,optional:true},onInput:{type:Function,optional:true},onUpdateInput:{type:Function,optional:true},revId:{type:Number,optional:true},};DatePicker.template="web.DatePicker";const DateTimePicker=__exports.DateTimePicker=class DateTimePicker extends DatePicker{initFormat(){this.defaultFormat=localization.dateTimeFormat;this.formatValue=wrapError(formatDateTime,"");this.parseValue=wrapError(parseDateTime,false);this.isLocal=true;} 6442setDateAndFormat(nextProps){super.setDateAndFormat(nextProps);this.staticFormat+=` ${/h/.test(this.format) ? "hh" : "HH"}:mm:ss`;}} 6443DateTimePicker.defaultProps={...DatePicker.defaultProps,buttons:{showClear:false,showClose:true,showToday:false,},};return __exports;});; 6444 6445/* /web/static/src/core/debug/debug_context.js */ 6446odoo.define('@web/core/debug/debug_context',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{memoize}=require("@web/core/utils/functions");const{useEffect,useEnv,useSubEnv}=require("@odoo/owl");const debugRegistry=registry.category("debug");const getAccessRights=memoize(async function getAccessRights(orm){const rightsToCheck={"ir.ui.view":"write","ir.rule":"read","ir.model.access":"read",};const proms=Object.entries(rightsToCheck).map(([model,operation])=>{return orm.call(model,"check_access_rights",[],{operation,raise_exception:false,});});
6446const[canEditView,canSeeRecordRules,canSeeModelAccess]=await Promise.all(proms);const accessRights={canEditView,canSeeRecordRules,canSeeModelAccess};return accessRights;});class DebugContext{constructor(env,defaultCategories){this.orm=env.services.orm;this.categories=new Map(defaultCategories.map((cat)=>[cat,[{}]]));} 6447activateCategory(category,context){const contexts=this.categories.get(category)||new Set();contexts.add(context);this.categories.set(category,contexts);return()=>{contexts.delete(context);if(contexts.size===0){this.categories.delete(category);}};} 6448async getItems(env){const accessRights=await getAccessRights(this.orm);return[...this.categories.entries()].flatMap(([category,contexts])=>{return debugRegistry.category(category).getAll().map((factory)=>factory(Object.assign({env,accessRights},...contexts)));}).filter(Boolean).sort((x,y)=>{const xSeq=x.sequence||1000;const ySeq=y.sequence||1000;return xSeq-ySeq;});}} 6449const debugContextSymbol=Symbol("debugContext");__exports.createDebugContext=createDebugContext;function createDebugContext(env,{categories=[]}={}){return{[debugContextSymbol]:new DebugContext(env,categories)};} 6450__exports.useOwnDebugContext=useOwnDebugContext;function useOwnDebugContext({categories=[]}={}){useSubEnv(createDebugContext(useEnv(),{categories}));} 6451__exports.useEnvDebugContext=useEnvDebugContext;function useEnvDebugContext(){const debugContext=useEnv()[debugContextSymbol];if(!debugContext){throw new Error("There is no debug context available in the current environment.");} 6452return debugContext;} 6453__exports.useDebugCategory=useDebugCategory;function useDebugCategory(category,context={}){const env=useEnv();if(env.debug){const debugContext=useEnvDebugContext();useEffect(()=>debugContext.activateCategory(category,context),()=>[]);}} 6454return __exports;});; 6455 6456/* /web/static/src/core/debug/debug_menu_basic.js */ 6457odoo.define('@web/core/debug/debug_menu_basic',async function(require){'use strict';let __exports={};const{useEnvDebugContext}=require("@web/core/debug/debug_context");const{Dropdown}=require("@web/core/dropdown/dropdown");const{DropdownItem}=require("@web/core/dropdown/dropdown_item");const{Component}=require("@odoo/owl");const DebugMenuBasic=__exports.DebugMenuBasic=class DebugMenuBasic extends Component{setup(){const debugContext=useEnvDebugContext();this.getElements=async()=>{this.elements=await debugContext.getItems(this.env);};}} 6458DebugMenuBasic.components={Dropdown,DropdownItem,};DebugMenuBasic.template="web.DebugMenu";return __exports;});; 6459 6460/* /web/static/src/core/debug/debug_menu_items.js */ 6461odoo.define('@web/core/debug/debug_menu_items',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{routeToUrl}=require("@web/core/browser/router_service");const{registry}=require("@web/core/registry");function activateAssetsDebugging({env}){return{type:"item",description:env._t("Activate Assets Debugging"),callback:()=>{browser.location.search="?debug=assets";},sequence:410,};} 6462function activateTestsAssetsDebugging({env}){return{type:"item",description:env._t("Activate Tests Assets Debugging"),callback:()=>{browser.location.search="?debug=assets,tests";},sequence:420,};} 6463__exports.regenerateAssets=regenerateAssets;function regenerateAssets({env}){return{type:"item",description:env._t("Regenerate Assets Bundles"),callback:async()=>{await env.services.orm.call("ir.attachment","regenerate_assets_bundles",);browser.location.reload();},sequence:430,};} 6464__exports.becomeSuperuser=becomeSuperuser;function becomeSuperuser({env}){const becomeSuperuserURL=browser.location.origin+"/web/become";if(!env.services.user.isAdmin){return false;} 6465return{type:"item",description:env._t("Become Superuser"),href:becomeSuperuserURL,callback:()=>{browser.open(becomeSuperuserURL,"_self");},sequence:440,};} 6466function leaveDebugMode({env}){return{type:"item",description:env._t("Leave the Developer Tools"),callback:()=>{const route=env.services.router.current;route.search.debug="";browser.location.href=browser.location.origin+routeToUrl(route);},sequence:450,};} 6467registry.category("debug").category("default").add("activateAssetsDebugging",activateAssetsDebugging).add("regenerateAssets",regenerateAssets).add("becomeSuperuser",becomeSuperuser).add("leaveDebugMode",leaveDebugMode).add("activateTestsAssetsDebugging",activateTestsAssetsDebugging);return __exports;});; 6468 6469/* /web/static/src/core/debug/debug_providers.js */ 6470odoo.define('@web/core/debug/debug_providers',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{browser}=require("@web/core/browser/browser");const{routeToUrl}=require("@web/core/browser/router_service");
6470const commandProviderRegistry=registry.category("command_provider");commandProviderRegistry.add("debug",{provide:(env,options)=>{const result=[];if(env.debug){if(!env.debug.includes("assets")){result.push({action(){browser.location.search="?debug=assets";},category:"debug",name:env._t("Activate debug mode (with assets)"),});} 6471result.push({action(){const route=env.services.router.current;route.search.debug="";browser.location.href=browser.location.origin+routeToUrl(route);},category:"debug",name:env._t("Deactivate debug mode"),});result.push({action(){const runTestsURL=browser.location.origin+"/web/tests?debug=assets";browser.open(runTestsURL);},category:"debug",name:env._t("Run JS Tests"),});result.push({action(){const runTestsURL=browser.location.origin+"/web/tests/mobile?debug=assets";browser.open(runTestsURL);},category:"debug",name:env._t("Run JS Mobile Tests"),});}else{const debugKey="debug";if(options.searchValue.toLowerCase()===debugKey){result.push({action(){browser.location.search="?debug=assets";},category:"debug",name:`${env._t("Activate debug mode (with assets)")} (${debugKey})`,});}} 6472return result;},});return __exports;});; 6473 6474/* /web/static/src/core/debug/debug_utils.js */ 6475odoo.define('@web/core/debug/debug_utils',async function(require){'use strict';let __exports={};__exports.editModelDebug=editModelDebug;function editModelDebug(env,title,model,id){return env.services.action.doAction({res_model:model,res_id:id,name:title,type:"ir.actions.act_window",views:[[false,"form"]],view_mode:"form",target:"new",});} 6476return __exports;});; 6477 6478/* /web/static/src/core/debug/profiling/profiling_item.js */ 6479odoo.define('@web/core/debug/profiling/profiling_item',async function(require){'use strict';let __exports={};const{DropdownItem}=require("@web/core/dropdown/dropdown_item");const{useBus,useService}=require("@web/core/utils/hooks");const{Component}=require("@odoo/owl");const ProfilingItem=__exports.ProfilingItem=class ProfilingItem extends Component{setup(){this.profiling=useService("profiling");useBus(this.props.bus,"UPDATE",this.render);} 6480changeParam(param,ev){this.profiling.setParam(param,ev.target.value);} 6481toggleParam(param){const value=this.profiling.state.params.execution_context_qweb;this.profiling.setParam(param,!value);} 6482openProfiles(){if(this.env.services.action){this.env.services.action.doAction("base.action_menu_ir_profile");}else{window.location="/web/#action=base.action_menu_ir_profile";}}} 6483ProfilingItem.components={DropdownItem};ProfilingItem.template="web.DebugMenu.ProfilingItem";return __exports;});; 6484 6485/* /web/static/src/core/debug/profiling/profiling_qweb.js */ 6486odoo.define('@web/core/debug/profiling/profiling_qweb',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{useService}=require("@web/core/utils/hooks");const{loadBundle}=require("@web/core/assets");const{renderToString}=require("@web/core/utils/render");const{useDebounced}=require("@web/core/utils/timing");const{Component,useState,useRef,onWillStart,onMounted,onWillUnmount}=require("@odoo/owl");class MenuItem extends Component{} 6487MenuItem.template="web.ProfilingQwebView.menuitem";function processValue(value){const data=JSON.parse(value);for(const line of data[0].results.data){line.xpath=line.xpath.replace(/([^\]])\//g,"$1[1]/").replace(/([^\]])$/g,"$1[1]");} 6488return data;} 6489const ProfilingQwebView=__exports.ProfilingQwebView=class ProfilingQwebView extends Component{setup(){super.setup();this.orm=useService("orm");this.ace=useRef("ace");this.selector=useRef("selector");this.value=processValue(this.props.value);this.state=useState({viewID:this.profile.data.length?this.profile.data[0].view_id:0,view:null,});this.renderProfilingInformation=useDebounced(this.renderProfilingInformation,100);onWillStart(async()=>{await loadBundle({jsLibs:["/web/static/lib/ace/ace.js",["/web/static/lib/ace/mode-python.js","/web/static/lib/ace/mode-xml.js","/web/static/lib/ace/mode-qweb.js",],],});await this._fetchViewData();this.state.view=this.viewObjects.find((view)=>view.id===this.state.viewID);});onMounted(()=>{this._startAce(this.ace.el);this._renderView();});onWillUnmount(()=>{if(this.aceEditor){this.aceEditor.destroy();} 6490this._unmoutInfo();});} 6491get profile(){return this.value?this.value[0].results:{archs:{},data:[]};} 6492async _fetchViewData(){const viewIDs=Array.from(new Set(this.profile.data.map((line)=>line.view_id)));const viewObjects=await this.orm.call("ir.ui.view","search_read",[],{fields:["id","display_name","key"],domain:[["id","in",viewIDs]],});for(const view of viewObjects){view.delay=0;view.query=0;const lines=this.profile.data.filter((l)=>l.view_id===view.id);const root=lines.find((l)=>l.xpath==="");if(root){view.delay+=root.delay;view.query+=root.query;}else{view.delay=lines.map((l)=>l.delay).reduce((a,b)=>a+b);view.query=lines.map((l)=>l.query).reduce((a,b)=>a+b);} 6493view.delay=Math.ceil(view.delay*10)/10;} 6494this.viewObjects=viewObjects;}
6495_formatDelay(delay){return delay?_.str.sprintf("%.1f",Math.ceil(delay*10)/10):".";} 6496_startAce(node){this.aceEditor=window.ace.edit(node);this.aceEditor.setOptions({maxLines:Infinity,showPrintMargin:false,highlightActiveLine:false,highlightGutterLine:true,readOnly:true,});this.aceEditor.renderer.setOptions({displayIndentGuides:true,showGutter:true,});this.aceEditor.renderer.$cursorLayer.element.style.display="none";this.aceEditor.$blockScrolling=true;this.aceSession=this.aceEditor.getSession();this.aceSession.setOptions({useWorker:false,mode:"ace/mode/qweb",tabSize:2,useSoftTabs:true,});this.aceEditor.renderer.on("afterRender",this.renderProfilingInformation.bind(this));} 6497renderProfilingInformation(){this._unmoutInfo();const flat={};const arch=[{xpath:"",children:[]}];const rows=this.ace.el.querySelectorAll(".ace_gutter .ace_gutter-cell");const elems=this.ace.el.querySelectorAll(".ace_tag-open, .ace_end-tag-close, .ace_end-tag-open, .ace_qweb");elems.forEach((node)=>{const parent=arch[arch.length-1];let xpath=parent.xpath;if(node.classList.contains("ace_end-tag-close")){let previous=node;while((previous=previous.previousElementSibling)){if(previous&&previous.classList.contains("ace_tag-name")){break;}} 6498const tag=previous&&previous.textContent;if(parent.tag===tag){arch.pop();}}else if(node.classList.contains("ace_end-tag-open")){const tag=node.nextElementSibling&&node.nextElementSibling.textContent;if(parent.tag===tag){arch.pop();}}else if(node.classList.contains("ace_qweb")){const directive=node.textContent;parent.directive.push({el:node,directive:directive,});let delay=0;let query=0;for(const line of this.profile.data){if(line.view_id===this.state.viewID&&line.xpath===xpath&&line.directive.includes(directive)){delay+=line.delay;query+=line.query;}} 6499if((delay||query)&&!node.querySelector(".o_info")){this._renderHover(delay,query,node);}}else if(node.classList.contains("ace_tag-open")){const nodeTagName=node.nextElementSibling;const aceLine=nodeTagName.parentNode;const index=[].indexOf.call(aceLine.parentNode.children,aceLine);const row=rows[index];xpath+="/"+nodeTagName.textContent;let i=1;while(flat[xpath+"["+i+"]"]){i++;} 6500xpath+="["+i+"]";flat[xpath]={xpath:xpath,tag:nodeTagName.textContent,children:[],directive:[],};arch.push(flat[xpath]);parent.children.push(flat[xpath]);const closed=!!row.querySelector(".ace_closed");const delays=[];const querys=[];const groups={};let displayDetail=false;for(const line of this.profile.data){if(line.view_id===this.state.viewID&&(closed?line.xpath.startsWith(xpath):line.xpath===xpath)){delays.push(line.delay);querys.push(line.query);const directive=line.directive.split("=")[0];if(!groups[directive]){groups[directive]={delays:[],querys:[],};}else{displayDetail=true;} 6501groups[directive].delays.push(this._formatDelay(line.delay));groups[directive].querys.push(line.query);}} 6502if(delays.length&&!row.querySelector(".o_info")){this._renderInfo(delays,querys,displayDetail,groups,row);}} 6503node.setAttribute("data-xpath",xpath);});} 6504_renderView(){const view=this.viewObjects.find((view)=>view.id===this.state.viewID);if(view){const arch=this.profile.archs[view.id]||"";if(this.aceSession.getValue()!==arch){this.aceSession.setValue(arch);}}else{this.aceSession.setValue("");} 6505this.state.view=view;} 6506_unmoutInfo(){if(this.hover){if(this.ace.el.querySelector(".o_ace_hover")){this.ace.el.querySelector(".o_ace_hover").remove();}} 6507if(this.info){if(this.ace.el.querySelector(".o_ace_info")){this.ace.el.querySelector(".o_ace_info").remove();}}} 6508_renderHover(delay,query,node){const xml=renderToString("web.ProfilingQwebView.hover",{delay:this._formatDelay(delay),query:query,});const div=new DOMParser().parseFromString(xml,"text/html").querySelector("div");node.insertBefore(div,node.firstChild);} 6509_renderInfo(delays,querys,displayDetail,groups,node){const xml=renderToString("web.ProfilingQwebView.info",{delay:this._formatDelay(delays.reduce((a,b)=>a+b,0)),query:querys.reduce((a,b)=>
6509a+b,0)||".",displayDetail:displayDetail,groups:groups,});const div=new DOMParser().parseFromString(xml,"text/html").querySelector("div");node.insertBefore(div,node.firstChild);} 6510_onSelectView(ev){this.state.viewID=+ev.currentTarget.dataset.id;this._renderView();}} 6511ProfilingQwebView.template="web.ProfilingQwebView";ProfilingQwebView.components={MenuItem};registry.category("fields").add("profiling_qweb_view",ProfilingQwebView);return __exports;});; 6512 6513/* /web/static/src/core/debug/profiling/profiling_service.js */ 6514odoo.define('@web/core/debug/profiling/profiling_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{ProfilingItem}=require("@web/core/debug/profiling/profiling_item");const{session}=require("@web/session");const{profilingSystrayItem}=require("@web/core/debug/profiling/profiling_systray_item");const{EventBus,reactive}=require("@odoo/owl");const systrayRegistry=registry.category("systray");const profilingService={dependencies:["orm"],start(env,{orm}){if(!env.debug){return;} 6515function notify(){if(systrayRegistry.contains("web.profiling")&&state.isEnabled===false){systrayRegistry.remove("web.profiling",profilingSystrayItem);} 6516if(!systrayRegistry.contains("web.profiling")&&state.isEnabled===true){systrayRegistry.add("web.profiling",profilingSystrayItem,{sequence:99});} 6517bus.trigger("UPDATE");} 6518const state=reactive({session:session.profile_session||false,collectors:session.profile_collectors||["sql","traces_async"],params:session.profile_params||{},get isEnabled(){return Boolean(state.session);},},notify);const bus=new EventBus();notify();async function setProfiling(params){const kwargs=Object.assign({collectors:state.collectors,params:state.params,profile:state.isEnabled,},params);const resp=await orm.call("ir.profile","set_profiling",[],kwargs);if(resp.type){env.services.action.doAction(resp);}else{state.session=resp.session;state.collectors=resp.collectors;state.params=resp.params;}} 6519function profilingSeparator(){return{type:"separator",sequence:500,};} 6520function profilingItem(){return{type:"component",Component:ProfilingItem,props:{bus},sequence:510,};} 6521registry.category("debug").category("default").add("profilingSeparator",profilingSeparator).add("profilingItem",profilingItem);return{state,async toggleProfiling(){await setProfiling({profile:!state.isEnabled});},async toggleCollector(collector){const nextCollectors=state.collectors.slice();const index=nextCollectors.indexOf(collector);if(index>=0){nextCollectors.splice(index,1);}else{nextCollectors.push(collector);} 6522await setProfiling({collectors:nextCollectors});},async setParam(key,value){const nextParams=Object.assign({},state.params);nextParams[key]=value;await setProfiling({params:nextParams});},isCollectorEnabled(collector){return state.collectors.includes(collector);},};},};registry.category("services").add("profiling",profilingService);return __exports;});; 6523 6524/* /web/static/src/core/debug/profiling/profiling_systray_item.js */ 6525odoo.define('@web/core/debug/profiling/profiling_systray_item',async function(require){'use strict';let __exports={};const{Component}=require("@odoo/owl");class ProfilingSystrayItem extends Component{} 6526ProfilingSystrayItem.template="web.ProfilingSystrayItem";const profilingSystrayItem=__exports.profilingSystrayItem={Component:ProfilingSystrayItem,};return __exports;});; 6527 6528/* /web/static/src/core/dialog/dialog.js */ 6529odoo.define('@web/core/dialog/dialog',async function(require){'use strict';let __exports={};const{useHotkey}=require("@web/core/hotkeys/hotkey_hook");const{useActiveElement}=require("@web/core/ui/ui_service");const{useForwardRefToParent}=require("@web/core/utils/hooks");const{Component,useChildSubEnv,useState}=require("@odoo/owl");const Dialog=__exports.Dialog=class Dialog extends Component{setup(){this.modalRef=useForwardRefToParent("modalRef");useActiveElement("modalRef");this.data=useState(this.env.dialogData);useHotkey("escape",()=>{this.data.close();});this.id=`dialog_${this.data.id}`;useChildSubEnv({inDialog:true,dialogId:this.id,closeDialog:this.data.close});owl.onWillDestroy(()=>
6529{if(this.env.isSmall){this.data.scrollToOrigin();}});} 6530get isFullscreen(){return this.props.fullscreen||this.env.isSmall;}} 6531Dialog.template="web.Dialog";Dialog.props={contentClass:{type:String,optional:true},bodyClass:{type:String,optional:true},fullscreen:{type:Boolean,optional:true},footer:{type:Boolean,optional:true},header:{type:Boolean,optional:true},size:{type:String,optional:true,validate:(s)=>["sm","md","lg","xl","fullscreen"].includes(s)},technical:{type:Boolean,optional:true},title:{type:String,optional:true},modalRef:{type:Function,optional:true},slots:{type:Object,shape:{default:Object,header:{type:Object,optional:true},footer:{type:Object,optional:true},},},withBodyPadding:{type:Boolean,optional:true},};Dialog.defaultProps={contentClass:"",bodyClass:"",fullscreen:false,footer:true,header:true,size:"lg",technical:true,title:"Odoo",withBodyPadding:true,};return __exports;});; 6532 6533/* /web/static/src/core/dialog/dialog_container.js */ 6534odoo.define('@web/core/dialog/dialog_container',async function(require){'use strict';let __exports={};const{ErrorHandler,WithEnv}=require("@web/core/utils/components");const{Component,xml}=require("@odoo/owl");const DialogContainer=__exports.DialogContainer=class DialogContainer extends Component{handleError(error,dialog){dialog.props.close();Promise.resolve().then(()=>{throw error;});}} 6535DialogContainer.components={ErrorHandler,WithEnv};DialogContainer.template=xml` 6536 <div class="o_dialog_container" t-att-class="{'modal-open': Object.keys(props.dialogs).length > 0}"> 6537 <div> 6538 <t t-foreach="Object.values(props.dialogs)" t-as="dialog" t-key="dialog.id"> 6539 <ErrorHandler onError="(error) => this.handleError(error, dialog)"> 6540 <WithEnv env="{ dialogData: dialog.dialogData }"> 6541 <t t-component="dialog.class" t-props="dialog.props"/> 6542 </WithEnv> 6543 </ErrorHandler> 6544 </t> 6545 </div> 6546 </div> 6547`;return __exports;});; 6548 6549/* /web/static/src/core/dialog/dialog_service.js */ 6550odoo.define('@web/core/dialog/dialog_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{DialogContainer}=require("@web/core/dialog/dialog_container");const{markRaw,reactive}=require("@odoo/owl");const dialogService=__exports.dialogService={start(env){const dialogs=reactive({});let dialogId=0;registry.category("main_components").add("DialogContainer",{Component:DialogContainer,props:{dialogs},});function add(dialogClass,props,options={}){for(const dialog of Object.values(dialogs)){dialog.dialogData.isActive=false;} 6551const id=++dialogId;function close(){if(dialogs[id]){delete dialogs[id];Object.values(dialogs).forEach((dialog,i,dialogArr)=>{dialog.dialogData.isActive=i===dialogArr.length-1;});if(options.onClose){options.onClose();}}} 6552const dialog={id,class:dialogClass,props:markRaw({...props,close}),dialogData:{isActive:true,close,id,},};const scrollOrigin={top:window.scrollY,left:window.scrollX};dialog.dialogData.scrollToOrigin=()=>{if(!Object.keys(dialogs).length){window.scrollTo(scrollOrigin);}};dialogs[id]=dialog;return close;} 6553function closeAll(){for(const id in dialogs){dialogs[id].dialogData.close();}} 6554return{add,closeAll};},};registry.category("services").add("dialog",dialogService);return __exports;});; 6555 6556/* /web/static/src/core/domain.js */ 6557odoo.define('@web/core/domain',async function(require){'use strict';let __exports={};const{shallowEqual}=require("@web/core/utils/arrays");const{evaluate,formatAST,parseExpr}=require("@web/core/py_js/py");const{toPyValue}=require("@web/core/py_js/py_utils");const InvalidDomainError=__exports.InvalidDomainError=class InvalidDomainError extends Error{} 6558const Domain=__exports.Domain=class Domain{static combine(domains,operator){if(domains.length===0){return new Domain([]);} 6559const domain1=domains[0]instanceof Domain?domains[0]:new Domain(domains[0]);if(domains.length===1){return domain1;} 6560const domain2=Domain.combine(domains.slice(1),operator);const result=new Domain([]);const astValues1=domain1.ast.value;const astValues2=domain2.ast.value;const op=operator==="AND"?"&":"|";const combinedAST={type:4,value:astValues1.concat(astValues2)};result.ast=normalizeDomainAST(combinedAST,op);return result;} 6561static and(domains){return Domain.combine(domains,"AND");} 6562static or(domains){return Domain.combine(domains,"OR");}
6563static not(domain){const result=new Domain(domain);result.ast.value.unshift({type:1,value:"!"});return result;} 6564constructor(descr=[]){if(descr instanceof Domain){return new Domain(descr.toString());}else{const rawAST=typeof descr==="string"?parseExpr(descr):toAST(descr);this.ast=normalizeDomainAST(rawAST);}} 6565contains(record){const expr=evaluate(this.ast,record);return matchDomain(record,expr);} 6566toString(){return formatAST(this.ast);} 6567toList(context){return evaluate(this.ast,context);}} 6568const TRUE_LEAF=[1,"=",1];const FALSE_LEAF=[0,"=",1];const TRUE_DOMAIN=new Domain([TRUE_LEAF]);const FALSE_DOMAIN=new Domain([FALSE_LEAF]);Domain.TRUE=TRUE_DOMAIN;Domain.FALSE=FALSE_DOMAIN;function toAST(domain){const elems=domain.map((elem)=>{switch(elem){case"!":case"&":case"|":return{type:1,value:elem};default:return{type:10,value:elem.map(toPyValue),};}});return{type:4,value:elems};} 6569function normalizeDomainAST(domain,op="&"){if(domain.type!==4){if(domain.type===10){const value=domain.value;if(value.findIndex((e)=>e.type===10)===-1||!value.every((e)=>e.type===10||e.type===1)){throw new InvalidDomainError("Invalid domain AST");}}else{throw new InvalidDomainError("Invalid domain AST");}} 6570if(domain.value.length===0){return domain;} 6571let expected=1;for(const child of domain.value){if(child.type===1&&(child.value==="&"||child.value==="|")){expected++;}else if(child.type!==1||child.value!=="!"){expected--;}} 6572const values=domain.value.slice();while(expected<0){expected++;values.unshift({type:1,value:op});} 6573if(expected>0){throw new InvalidDomainError(`invalid domain ${formatAST(domain)} (missing ${expected} segment(s))`);} 6574return{type:4,value:values};} 6575function matchCondition(record,condition){if(typeof condition==="boolean"){return condition;} 6576const[field,operator,value]=condition;if(typeof field==="string"){const names=field.split(".");if(names.length>=2){return matchCondition(record[names[0]],[names.slice(1).join("."),operator,value]);}} 6577const fieldValue=typeof field==="number"?field:record[field];switch(operator){case"=?":if([false,null].includes(value)){return true;} 6578case"=":case"==":if(Array.isArray(fieldValue)&&Array.isArray(value)){return shallowEqual(fieldValue,value);} 6579return fieldValue===value;case"!=":case"<>":return!matchCondition(record,[field,"==",value]);case"<":return fieldValue<value;case"<=":return fieldValue<=value;case">":return fieldValue>value;case">=":return fieldValue>=value;case"in":{const val=Array.isArray(value)?value:[value];const fieldVal=Array.isArray(fieldValue)?fieldValue:[fieldValue];return fieldVal.some((fv)=>val.includes(fv));} 6580case"not in":{const val=Array.isArray(value)?value:[value];const fieldVal=Array.isArray(fieldValue)?fieldValue:[fieldValue];return!fieldVal.some((fv)=>val.includes(fv));} 6581case"like":if(fieldValue===false){return false;} 6582return fieldValue.indexOf(value)>=0;case"=like":if(fieldValue===false){return false;} 6583return new RegExp(value.replace(/%/g,".*")).test(fieldValue);case"ilike":if(fieldValue===false){return false;} 6584return fieldValue.toLowerCase().indexOf(value.toLowerCase())>=0;case"=ilike":if(fieldValue===false){return false;} 6585return new RegExp(value.replace(/%/g,".*"),"i").test(fieldValue);} 6586throw new InvalidDomainError("could not match domain");} 6587function makeOperators(record){const match=matchCondition.bind(null,record);return{"!":(x)=>!match(x),"&":(a,b)=>match(a)&&match(b),"|":(a,b)=>match(a)||match(b),};} 6588function matchDomain(record,domain){if(domain.length===0){return true;} 6589const operators=makeOperators(record);const reversedDomain=Array.from(domain).reverse();const condStack=[];for(const item of reversedDomain){if(item in operators){const operator=operators[item];const operands=condStack.splice(-operator.length);condStack.push(operator(...operands));}else{condStack.push(item);}} 6590return matchCondition(record,condStack.pop());} 6591return __exports;});; 6592 6593/* /web/static/src/core/domain_selector/domain_selector.js */ 6594odoo.define('@web/core/domain_selector/domain_selector',async function(require){'use strict';let __exports={};const{Domain}=require("@web/core/domain");const{DomainSelectorRootNode}=require("@web/core/domain_selector/domain_selector_root_node");const{Component}=require("@odoo/owl");const DomainSelector=__exports.DomainSelector=class DomainSelector extends Component{setup(){this.nextNodeId=0;} 6595buildTree(){try{const domain=new Domain(this.props.value);const ctx={parent:null,index:0,domain:domain.toList(),get currentElement(){return ctx.domain[ctx.index];},next(){ctx.index++;},getFullDomain(){return rootNode.computeDomain().toString();},};const rootNode=this.makeRootNode(ctx);ctx.parent=rootNode;
6595this.traverseNode(ctx);return ctx.parent;}catch(_e){return false;}} 6596traverseNode(ctx,negate=false){if(ctx.index<ctx.domain.length){if(ctx.currentElement==="!"){ctx.next();this.traverseNode(ctx,!negate);}else if(typeof ctx.currentElement==="string"&&["&","|"].includes(ctx.currentElement)){this.traverseBranchNode(ctx,negate);}else{this.traverseLeafNode(ctx,negate);}}} 6597traverseBranchNode(ctx,negate){if(ctx.parent.type!=="branch"||ctx.parent.operator!==ctx.currentElement){const node=this.makeBranchNode(ctx,ctx.currentElement,[],negate);ctx.parent.operands.push(node);ctx=Object.assign(Object.create(ctx),{parent:node});} 6598ctx.next();this.traverseNode(ctx);ctx.next();this.traverseNode(ctx);} 6599traverseLeafNode(ctx,negate){const condition=ctx.currentElement;const[leftOperand,operator,rightOperand]=condition;const node=this.makeLeafNode(ctx,operator,[leftOperand,rightOperand],negate);ctx.parent.operands.push(node);} 6600makeBranchNode(ctx,operator,operands,negate){const updateDomain=()=>this.props.update(ctx.getFullDomain());const makeFakeNode=this.makeFakeNode.bind(this);return{type:"branch",id:this.nextNodeId++,operator,operands,computeDomain(){let domain=Domain.combine(this.operands.map((operand)=>operand.computeDomain()),this.operator==="&"?"AND":"OR");if(negate){domain=Domain.not(domain);} 6601return domain;},update(operator){this.operator=operator;updateDomain();},insert(newNodeType){const newNode=makeFakeNode(ctx,newNodeType);const operands=ctx.parent.operands;operands.splice(operands.indexOf(this)+1,0,newNode);updateDomain();},delete(){const operands=ctx.parent.operands;operands.splice(operands.indexOf(this),1);updateDomain();},};} 6602makeLeafNode(ctx,operator,operands,negate){const updateDomain=()=>this.props.update(ctx.getFullDomain());const makeFakeNode=this.makeFakeNode.bind(this);return{type:"leaf",id:this.nextNodeId++,operator,operands,computeDomain(){let domain=new Domain([[this.operands[0],this.operator,this.operands[1]]]);if(negate){domain=Domain.not(domain);} 6603return domain;},update(changes){if("fieldName"in changes){this.operands[0]=changes.fieldName;} 6604if("operator"in changes){this.operator=changes.operator;} 6605if("value"in changes){this.operands[1]=changes.value;} 6606updateDomain();},insert(newNodeType){const newNode=makeFakeNode(ctx,newNodeType);const operands=ctx.parent.operands;operands.splice(operands.indexOf(this)+1,0,newNode);updateDomain();},delete(){const operands=ctx.parent.operands;operands.splice(operands.indexOf(this),1);updateDomain();},};} 6607makeRootNode(ctx){const updateDomain=(...args)=>this.props.update(...args);const makeFakeNode=this.makeFakeNode.bind(this);return{type:"root",id:this.nextNodeId++,operator:"&",operands:[],computeDomain(){return Domain.combine(this.operands.map((operand)=>operand.computeDomain()),"AND");},update(newValue,fromDebug){if(typeof newValue==="string"){updateDomain(newValue,fromDebug);}else if(this.operands.length){this.operands[0].update(newValue);}},insert(newNodeType){const newNode=makeFakeNode(ctx,newNodeType);if(ctx.parent){const operands=ctx.parent.operands;operands.splice(operands.indexOf(this)+1,0,newNode);}else{this.operands.push(newNode);} 6608updateDomain(ctx.getFullDomain());},delete(){},};} 6609makeFakeNode(ctx,type){const[field,op,value]=this.props.defaultLeafValue;if(type==="branch"){return this.makeBranchNode(ctx,ctx.parent.operator==="&"?"|":"&",[this.makeLeafNode(ctx,op,[field,value]),this.makeLeafNode(ctx,op,[field,value]),]);}else{return this.makeLeafNode(ctx,op,[field,value]);}} 6610resetDomain(){this.props.update("[]");}} 6611Object.assign(DomainSelector,{template:"web._DomainSelector",components:{DomainSelectorRootNode,},props:{className:{type:String,optional:true},resModel:String,value:String,debugValue:{type:String,optional:true},readonly:{type:Boolean,optional:true},update:{type:Function,optional:true},isDebugMode:{type:Boolean,optional:true},defaultLeafValue:{type:Array,optional:true},},defaultProps:{readonly:true,update:()=>{},isDebugMode:false,defaultLeafValue:["id","=",1],},});return __exports;});; 6612 6613/* /web/static/src/core/domain_selector/domain_selector_branch_node.js */ 6614odoo.define('@web/core/domain_selector/domain_selector_branch_node',async function(require){'use strict';let __exports={};const{DomainSelectorBranchOperator}=require("@web/core/domain_selector/domain_selector_branch_operator");const{DomainSelectorControlPanel}=require("@web/core/domain_selector/domain_selector_control_panel");const{DomainSelectorLeafNode}=require("@web/core/domain_selector/domain_selector_leaf_node");const{Component,useRef}=require("@odoo/owl");const DomainSelectorBranchNode=__exports.DomainSelectorBranchNode=class DomainSelectorBranchNode extends Component{setup(){this.root=useRef("root");} 6615onHoverDeleteNodeBtn(hovering){this.root.el.classList.toggle("o_hover_btns",hovering);} 6616onHoverInsertLeafNodeBtn(hovering){this.root.el.classList.toggle("o_hover_add_node",hovering);} 6617onHoverInsertBranchNodeBtn(hovering){this.root.el.classList.toggle("o_hover_add_node",hovering);this.root.el.classList.toggle("o_hover_add_inset_node",hovering);}} 6618DomainSelectorBranchNode.template="web.DomainSelectorBranchNode";DomainSelectorBranchNode.components={DomainSelectorBranchNode,DomainSelectorBranchOperator,DomainSelectorControlPanel,DomainSelectorLeafNode,};return __exports;});; 6619 6620/* /web/static/src/core/domain_selector/domain_selector_branch_operator.js */ 6621odoo.define('@web/core/domain_selector/domain_selector_branch_operator',async function(require){'use strict';let __exports={};const{Dropdown}=require("@web/core/dropdown/dropdown");const{DropdownItem}=require("@web/core/dropdown/dropdown_item");const{Component}=require("@odoo/owl");const DomainSelectorBranchOperator=__exports.DomainSelectorBranchOperator=class DomainSelectorBranchOperator extends Component{onOperatorSelected(operator){this.props.node.update(operator);}} 6622DomainSelectorBranchOperator.components={Dropdown,DropdownItem,};DomainSelectorBranchOperator.template="web.DomainSelectorBranchOperator";DomainSelectorBranchOperator.props={node:Object,readonly:Boolean,showCaret:{type:Boolean,optional:true,},};return __exports;});; 6623 6624/* /web/static/src/core/domain_selector/domain_selector_control_panel.js */ 6625odoo.define('@web/core/domain_selector/domain_selector_control_panel',async function(require){'use strict';let __exports={};const{Component,toRaw}
6625=require("@odoo/owl");const DomainSelectorControlPanel=__exports.DomainSelectorControlPanel=class DomainSelectorControlPanel extends Component{deleteNode(){this.props.node.delete();} 6626insertNode(newNodeType){toRaw(this.props.node).insert(newNodeType);} 6627onEnterDeleteNodeBtn(){this.props.onHoverDeleteNodeBtn(true);} 6628onLeaveDeleteNodeBtn(){this.props.onHoverDeleteNodeBtn(false);} 6629onEnterInsertLeafNodeBtn(){this.props.onHoverInsertLeafNodeBtn(true);} 6630onLeaveInsertLeafNodeBtn(){this.props.onHoverInsertLeafNodeBtn(false);} 6631onEnterInsertBranchNodeBtn(){this.props.onHoverInsertBranchNodeBtn(true);} 6632onLeaveInsertBranchNodeBtn(){this.props.onHoverInsertBranchNodeBtn(false);}} 6633DomainSelectorControlPanel.template="web.DomainSelectorControlPanel";DomainSelectorControlPanel.props={node:Object,onHoverDeleteNodeBtn:Function,onHoverInsertLeafNodeBtn:Function,onHoverInsertBranchNodeBtn:Function,};return __exports;});; 6634 6635/* /web/static/src/core/domain_selector/domain_selector_leaf_node.js */ 6636odoo.define('@web/core/domain_selector/domain_selector_leaf_node',async function(require){'use strict';let __exports={};const{useModelField}=require("@web/core/model_field_selector/model_field_hook");const{ModelFieldSelector}=require("@web/core/model_field_selector/model_field_selector");const{registry}=require("@web/core/registry");const{DomainSelectorControlPanel}=require("@web/core/domain_selector/domain_selector_control_panel");const{DomainSelectorDefaultField}=require("@web/core/domain_selector/fields/domain_selector_default_field");const{Component,onWillStart,onWillUpdateProps,useRef}=require("@odoo/owl");const DomainSelectorLeafNode=__exports.DomainSelectorLeafNode=class DomainSelectorLeafNode extends Component{setup(){this.root=useRef("root");this.modelField=useModelField();this.fieldInfo={type:"integer",string:"ID",};onWillStart(async()=>{this.fieldInfo=await this.loadField(this.props.resModel,this.props.node.operands[0]);});onWillUpdateProps(async(nextProps)=>{this.fieldInfo=await this.loadField(nextProps.resModel,nextProps.node.operands[0]);});} 6637get displayedOperator(){const op=this.getOperatorInfo(this.props.node.operator);return op?op.label:"?";} 6638get isValueHidden(){const op=this.getOperatorInfo(this.props.node.operator);return op?op.hideValue:false;} 6639async loadField(resModel,fieldName){const chain=await this.modelField.loadChain(resModel,fieldName);if(!chain[chain.length-1].field&&chain.length>1){return chain[chain.length-2].field;} 6640return(chain[chain.length-1].field||{type:"integer",string:"ID",});} 6641findOperator(operatorList,opToFind){return operatorList.find((o)=>o.matches({field:this.fieldInfo,value:this.props.node.operands[1],operator:opToFind,}));} 6642getOperators(field){const operators=field.getOperators();if(this.findOperator(operators,this.props.node.operator)){return operators;} 6643return operators.concat(this.findOperator(registry.category("domain_selector/operator").getAll(),this.props.node.operator));} 6644getFieldComponent(type){return registry.category("domain_selector/fields").get(type,DomainSelectorDefaultField);} 6645getOperatorInfo(operator){const op=this.findOperator(this.getFieldComponent(this.fieldInfo.type).getOperators(),operator);if(op){return op;} 6646return this.findOperator(registry.category("domain_selector/operator").getAll(),this.props.node.operator);} 6647async onFieldChange(fieldName){const changes={fieldName};const fieldInfo=await this.loadField(this.props.resModel,fieldName);const component=this.getFieldComponent(fieldInfo.type);Object.assign(changes,component.onDidTypeChange(fieldInfo));if(!this.findOperator(component.getOperators(),this.props.node.operator)){const operatorInfo=component.getOperators()[0];changes.operator=operatorInfo.value;Object.assign(changes,operatorInfo.onDidChange(this.getOperatorInfo(this.props.node.operator),()=>component.onDidTypeChange(this.fieldInfo)));} 6648this.props.node.update(changes);} 6649onOperatorChange(ev){const component=this.getFieldComponent(this.fieldInfo.type);const operatorInfo=component.getOperators()[parseInt(ev.target.value,10)];const changes={operator:operatorInfo.value};Object.assign(changes,operatorInfo.onDidChange(this.getOperatorInfo(this.props.node.operator),()=>component.onDidTypeChange(this.fieldInfo)));this.props.node.update(changes);} 6650onHoverDeleteNodeBtn(hovering){this.root.el.classList.toggle("o_hover_btns",hovering);} 6651onHoverInsertLeafNodeBtn(hovering){this.root.el.classList.toggle("o_hover_add_node",hovering);} 6652onHoverInsertBranchNodeBtn(hovering){this.root.el.classList.toggle("o_hover_add_node",hovering);this.root.el.classList.toggle("o_hover_add_inset_node",hovering);}} 6653Object.assign(DomainSelectorLeafNode,{template:"web.DomainSelectorLeafNode",components:{DomainSelectorControlPanel,ModelFieldSelector,},});return __exports;});; 6654 6655/* /web/static/src/core/domain_selector/domain_selector_operators.js */ 6656odoo.define('@web/core/domain_selector/domain_selector_operators',async function(require){'use strict';let __exports={};const{_lt}=require("@web/core/l10n/translation");const{registry}=require("@web/core/registry");function onDidChange(action){return function(oldOperator,fieldChange){if(this.category!==oldOperator.category){return action(fieldChange);} 6657return{};};} 6658function matchValue(){return function({operator}){return operator===this.value;};} 6659const dso=registry.category("domain_selector/operator");dso.add("=",{category:"equality",label:"=",value:"=",onDidChange:onDidChange((fieldChange)=>fieldChange()),matches({operator,value}){return operator===this.value&&typeof value!=="boolean";},});dso.add("!=",{category:"equality",label:_lt("is not ="),value:"!=",onDidChange:onDidChange((fieldChange)=>fieldChange()),matches({operator,value}){return operator===this.value&&typeof value!=="boolean";},});dso.add(">",{category:"comparison",label:">",value:">",onDidChange:onDidChange((fieldChange)=>fieldChange()),matches:matchValue(),});dso.add(">=",{category:"comparison",label:">=",value:">=",onDidChange:onDidChange((fieldChange)=>fieldChange()),matches:matchValue(),});dso.add("<",{category:"comparison",label:"<",value:"<",onDidChange:onDidChange((fieldChange)=>fieldChange()),matches:matchValue(),});dso.add("<=",{category:"comparison",label:"<=",value:"<=",onDidChange:onDidChange((fieldChange)=>fieldChange()),matches:matchValue(),});dso.add("ilike",{category:"like",label:_lt("contains"),value:"ilike",onDidChange:onDidChange(()=>({value:""})),matches:matchValue(),});dso.add("not ilike",{category:"like",label:_lt("does not contain"),value:"not ilike",onDidChange:onDidChange(()=>({value:""})),matches:matchValue(),});dso.add("like",{category:"like",label:_lt("like"),value:"like",onDidChange:onDidChange(()=>({value:""})),matches:matchValue(),});dso.add("not like",{category:"like",label:_lt("not like"),value:"not like",onDidChange:onDidChange(()=>({value:""})),matches:matchValue(),});dso.add("=like",{category:"like",label:_lt("=like"),value:"=like",onDidChange:onDidChange(()=>({value:""})),matches:matchValue(),});dso.add("=ilike",{category:"like",label:_lt("=ilike"),value:"=ilike",onDidChange:onDidChange(()=>({value:""})),matches:matchValue(),});dso.add("child_of",{category:"relation",label:_lt("child of"),value:"child_of",onDidChange:onDidChange(()=>({value:1})),matches:matchValue(),});dso.add("parent_of",{category:"relation",label:_lt("parent of"),value:"parent_of",onDidChange:onDidChange(()=>({value:1})),matches:matchValue(),});dso.add("in",{category:"in",label:_lt("in"),value:"in",onDidChange:onDidChange(()=>({value:[]})),matches:matchValue(),});dso.add("not in",{category:"in",label:_lt("not in"),value:"not in",onDidChange:onDidChange(()=>({value:[]})),matches:matchValue(),});dso.add("set",{category:"set",label:_lt("is set"),value:"set",hideValue:true,onDidChange(){return{operator:"!=",value:false,};},matches({operator,value}){return operator==="!="&&typeof value==="boolean";},});dso.add("not set",{category:"set",label:_lt("is not set"),value:"not set",hideValue:true,onDidChange(){return{operator:"=",value:false,};},matches({operator,value}){return operator==="="&&typeof value==="boolean";},});return __exports;});; 6660 6661/* /web/static/src/core/domain_selector/domain_selector_root_node.js */ 6662odoo.define('@web/core/domain_selector/domain_selector_root_node',async function(require){'use strict';let __exports={};const{DomainSelectorBranchNode}=require("@web/core/domain_selector/domain_selector_branch_node");const{DomainSelectorBranchOperator}=require("@web/core/domain_selector/domain_selector_branch_operator");const{DomainSelectorLeafNode}=require("@web/core/domain_selector/domain_selector_leaf_node");const{Component}=require("@odoo/owl");const DomainSelectorRootNode=__exports.DomainSelectorRootNode=class DomainSelectorRootNode extends Component{get hasNode(){return this.props.node.operands.length>0;} 6663get node(){return this.props.node.operands[0];} 6664insertNode(newNodeType){this.props.node.insert(newNodeType);} 6665onOperatorSelected(ev){this.props.node.update(ev.detail.payload.operator);} 6666onChange(ev){this.props.node.update(ev.target.value,true);}} 6667DomainSelectorRootNode.template="web.DomainSelectorRootNode";DomainSelectorRootNode.components={DomainSelectorBranchNode,DomainSelectorBranchOperator,DomainSelectorLeafNode,};return __exports;});; 6668 6669/* /web/static/src/core/domain_selector/fields/domain_selector_boolean_field.js */ 6670odoo.define('@web/core/domain_selector/fields/domain_selector_boolean_field',async function(require){'use strict';let __exports={};const{_lt}=require("@web/core/l10n/translation");const{registry}=require("@web/core/registry");const{Component}=require("@odoo/owl");const dsf=registry.category("domain_selector/fields");const DomainSelectorBooleanField=__exports.DomainSelectorBooleanField=class DomainSelectorBooleanField extends Component{onChange(ev){this.props.update({value:ev.target.value==="1",});}} 6671Object.assign(DomainSelectorBooleanField,{template:"web.DomainSelectorBooleanField",onDidTypeChange(){return{value:true};},getOperators(){return[{category:"equality",label:_lt("is"),value:"=",onDidChange(){},matches({operator}){return operator===this.value;},},{category:"equality",label:_lt("is not"),value:"!=",onDidChange(){},matches({operator}){return operator===this.value;},},];},});dsf.add("boolean",DomainSelectorBooleanField);return __exports;});; 6672 6673/* /web/static/src/core/domain_selector/fields/domain_selector_datetime_field.js */ 6674odoo.define('@web/core/domain_selector/fields/domain_selector_datetime_field',async function(require){'use strict';let __exports={};const{DatePicker,DateTimePicker}=require("@web/core/datepicker/datepicker");const{deserializeDate,deserializeDateTime,serializeDate,serializeDateTime,}=require("@web/core/l10n/dates");const{registry}=require("@web/core/registry");const{Component}=require("@odoo/owl");const dsf=registry.category("domain_selector/fields");const dso=registry.category("domain_selector/operator");const DomainSelectorDateTimeField=__exports.DomainSelectorDateTimeField=class DomainSelectorDateTimeField extends Component{get component(){const{DatePicker,DateTimePicker}=this.constructor.components;return this.props.field.type==="date"?DatePicker:DateTimePicker;} 6675get deserializedValue(){const deserialize=this.props.field.type==="date"?deserializeDate:deserializeDateTime;return this.props.value?deserialize(this.props.value):luxon.DateTime.local();} 6676onChange(value){if(!this.deserializedValue.isValid&&!value){return;} 6677const serialize=this.props.field.type==="date"?serializeDate:serializeDateTime;this.props.update({value:serialize(value||luxon.DateTime.local())});}} 6678Object.assign(DomainSelectorDateTimeField,{template:"web.DomainSelectorDateTimeField",components:{DatePicker,DateTimePicker,},onDidTypeChange(field){const serialize=field.type==="date"?serializeDate:serializeDateTime;return{value:serialize(luxon.DateTime.local())};},getOperators(){return["=","!=",">","<",">=","<=","set","not set"].map((key)=>dso.get(key));},});dsf.add("date",DomainSelectorDateTimeField);dsf.add("datetime",DomainSelectorDateTimeField);return __exports;});; 6679 6680/* /web/static/src/core/domain_selector/fields/domain_selector_default_field.js */ 6681odoo.define('@web/core/domain_selector/fields/domain_selector_default_field',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{DomainSelectorFieldInput}=require("@web/core/domain_selector/fields/domain_selector_field_input");const{Component}=require("@odoo/owl");const dso=registry.category("domain_selector/operator");const DomainSelectorDefaultField=__exports.DomainSelectorDefaultField=class DomainSelectorDefaultField extends Component{} 6682Object.assign(DomainSelectorDefaultField,{template:"web.DomainSelectorDefaultField",components:{DomainSelectorFieldInput,},onDidTypeChange(){return{value:""};},getOperators(){return dso.getAll();},});return __exports;});; 6683 6684/* /web/static/src/core/domain_selector/fields/domain_selector_field_input.js */ 6685odoo.define('@web/core/domain_selector/fields/domain_selector_field_input',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{Component}=require("@odoo/owl");const parsers=registry.category("parsers");const DomainSelectorFieldInput=__exports.DomainSelectorFieldInput=class DomainSelectorFieldInput extends Component{parseValue(value){const parser=parsers.get(this.props.field.type,(value)=>value);try{return parser(value);}catch(_){return value;}} 6686onChange(ev){this.props.update({value:this.parseValue(ev.target.value)});}} 6687DomainSelectorFieldInput.template="web.DomainSelectorFieldInput";return __exports;});; 6688 6689/* /web/static/src/core/domain_selector/fields/domain_selector_field_input_with_tags.js */ 6690odoo.define('@web/core/domain_selector/fields/domain_selector_field_input_with_tags',async function(require){'use strict';let __exports={};const{Component,useRef}=require("@odoo/owl");const DomainSelectorFieldInputWithTags=__exports.DomainSelectorFieldInputWithTags=class DomainSelectorFieldInputWithTags extends Component{setup(){this.inputRef=useRef("input");} 6691removeTag(tagIndex){const value=[...this.props.value];value.splice(tagIndex,1);this.props.update({value});} 6692addTag(value){this.props.update({value:this.props.value.concat(value)});} 6693onBtnClick(){const value=this.inputRef.el.value;this.inputRef.el.value="";this.addTag(value);}} 6694DomainSelectorFieldInputWithTags.template="web.DomainSelectorFieldInputWithTags";return __exports;});; 6695 6696/* /web/static/src/core/domain_selector/fields/domain_selector_number_field.js */ 6697odoo.define('@web/core/domain_selector/fields/domain_selector_number_field',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{DomainSelectorFieldInput}=require("@web/core/domain_selector/fields/domain_selector_field_input");const{Component}=require("@odoo/owl");const dsf=registry.category("domain_selector/fields");const dso=registry.category("domain_selector/operator");const DomainSelectorNumberField=__exports.DomainSelectorNumberField=class DomainSelectorNumberField extends Component{} 6698Object.assign(DomainSelectorNumberField,{template:"web.DomainSelectorNumberField",components:{DomainSelectorFieldInput,},onDidTypeChange(){return{value:0};},getOperators(){return["=","!=",">","<",">=","<=","ilike","not ilike","set","not set",].map((key)=>dso.get(key));},});dsf.add("integer",DomainSelectorNumberField);dsf.add("float",DomainSelectorNumberField);dsf.add("monetary",DomainSelectorNumberField);return __exports;});; 6699 6700/* /web/static/src/core/domain_selector/fields/domain_selector_relation_field.js */ 6701odoo.define('@web/core/domain_selector/fields/domain_selector_relation_field',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{DomainSelectorFieldInput}=require("@web/core/domain_selector/fields/domain_selector_field_input");const{Component}=require("@odoo/owl");const dso=registry.category("domain_selector/operator");const DomainSelectorRelationField=__exports.DomainSelectorRelationField=class DomainSelectorRelationField extends Component{} 6702Object.assign(DomainSelectorRelationField,{template:"web.DomainSelectorRelationField",components:{DomainSelectorFieldInput,}
6702,onDidTypeChange(){return{value:"0"};},getOperators(){return["=","!=","ilike","not ilike","set","not set"].map((key)=>dso.get(key));},});registry.category("domain_selector/fields").add("one2many",DomainSelectorRelationField).add("many2one",DomainSelectorRelationField).add("many2many",DomainSelectorRelationField);return __exports;});; 6703 6704/* /web/static/src/core/domain_selector/fields/domain_selector_selection_field.js */ 6705odoo.define('@web/core/domain_selector/fields/domain_selector_selection_field',async function(require){'use strict';let __exports={};const{evaluateExpr}=require("@web/core/py_js/py");const{formatAST,toPyValue}=require("@web/core/py_js/py_utils");const{registry}=require("@web/core/registry");const{Component}=require("@odoo/owl");const dsf=registry.category("domain_selector/fields");const dso=registry.category("domain_selector/operator");const DomainSelectorSelectionField=__exports.DomainSelectorSelectionField=class DomainSelectorSelectionField extends Component{get options(){return[[false,""],...this.props.field.selection.filter((option)=>!this.props.value.includes(option[0])),];} 6706get formattedValue(){const ast=toPyValue(this.props.value);return formatAST(ast);} 6707onChange(ev){this.props.update({value:ev.target.value});} 6708onChangeMulti(ev){this.props.update({value:evaluateExpr(ev.target.value)});}} 6709Object.assign(DomainSelectorSelectionField,{template:"web.DomainSelectorSelectionField",onDidTypeChange(field){return{value:field.selection[0][0]};},getOperators(){return["=","!=","set","not set"].map((key)=>dso.get(key));},});dsf.add("selection",DomainSelectorSelectionField);return __exports;});; 6710 6711/* /web/static/src/core/domain_selector/fields/domain_selector_text_field.js */ 6712odoo.define('@web/core/domain_selector/fields/domain_selector_text_field',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{DomainSelectorFieldInput}=require("@web/core/domain_selector/fields/domain_selector_field_input");const{DomainSelectorFieldInputWithTags}=require("@web/core/domain_selector/fields/domain_selector_field_input_with_tags");const{Component}=require("@odoo/owl");const dsf=registry.category("domain_selector/fields");const dso=registry.category("domain_selector/operator");const DomainSelectorTextField=__exports.DomainSelectorTextField=class DomainSelectorTextField extends Component{} 6713Object.assign(DomainSelectorTextField,{template:"web.DomainSelectorTextField",components:{DomainSelectorFieldInput,DomainSelectorFieldInputWithTags,},onDidTypeChange(){return{value:""};},getOperators(){return["=","!=","ilike","not ilike","set","not set","in","not in"].map((key)=>dso.get(key));},});dsf.add("char",DomainSelectorTextField);dsf.add("html",DomainSelectorTextField);dsf.add("text",DomainSelectorTextField);return __exports;});; 6714 6715/* /web/static/src/core/domain_selector_dialog/domain_selector_dialog.js */ 6716odoo.define('@web/core/domain_selector_dialog/domain_selector_dialog',async function(require){'use strict';let __exports={};const{Dialog}=require("@web/core/dialog/dialog");const{DomainSelector}=require("@web/core/domain_selector/domain_selector");const{_t}=require("@web/core/l10n/translation");const{Component,useState}=require("@odoo/owl");const DomainSelectorDialog=__exports.DomainSelectorDialog=class DomainSelectorDialog extends Component{setup(){this.state=useState({value:this.props.initialValue,});} 6717get dialogTitle(){return _t("Domain");} 6718get domainSelectorProps(){return{className:this.props.className,resModel:this.props.resModel,readonly:this.props.readonly,isDebugMode:this.props.isDebugMode,defaultLeafValue:this.props.defaultLeafValue,value:this.state.value,update:(value)=>{this.state.value=value;},};} 6719async onSave(){await this.props.onSelected(this.state.value);this.props.close();} 6720onDiscard(){this.props.close();}} 6721DomainSelectorDialog.template="web.DomainSelectorDialog";DomainSelectorDialog.components={Dialog,DomainSelector,};DomainSelectorDialog.props={close:Function,className:{type:String,optional:true},resModel:String,readonly:{type:Boolean,optional:true},isDebugMode:{type:Boolean,optional:true},defaultLeafValue:{type:Array,optional:true},initialValue:{type:String,optional:true},onSelected:{type:Function,optional:true},};DomainSelectorDialog.defaultProps={initialValue:"",onSelected:()=>{},readonly:true,isDebugMode:false,};return __exports;});; 6722 6723/* /web/static/src/core/dropdown/dropdown.js */ 6724odoo.define('@web/core/dropdown/dropdown',async function(require){'use strict';let __exports={};const{useBus,useService}=require("@web/core/utils/hooks");const{usePosition}=require("@web/core/position_hook");const{useDropdownNavigation}=require("@web/core/dropdown/dropdown_navigation_hook");const{localization}=require("@web/core/l10n/localization");const{Component,EventBus,onWillStart,status,useEffect,useExternalListener,useRef,useState,useChildSubEnv,}=require("@odoo/owl");const DIRECTION_CARET_CLASS={bottom:"dropdown",top:"dropup",left:"dropstart",right:"dropend",};const DROPDOWN=__exports.DROPDOWN=Symbol("Dropdown");const Dropdown=__exports.Dropdown=class Dropdown extends Component{setup(){this.state=useState({open:this.props.startOpen,groupIsOpen:this.props.startOpen,});this.rootRef=useRef("root");onWillStart(()=>{if(this.state.open&&this.props.beforeOpen){return this.props.beforeOpen();}});if(!this.props.manualOnly){useExternalListener(window,"click",this.onWindowClicked,{capture:true});useBus(Dropdown.bus,"state-changed",({detail})=>this.onDropdownStateChanged(detail));} 6725this.ui=useService("ui");useEffect(()=>{Promise.resolve().then(()=>{this.myActiveEl=this.ui.activeElement;});},()=>[]);this.parentDropdown=this.env[DROPDOWN];useChildSubEnv({[DROPDOWN]:{close:this.close.bind(this),closeAllParents:()=>{this.close();if(this.parentDropdown){this.parentDropdown.closeAllParents();}},},});useDropdownNavigation();const position=this.props.position||(this.parentDropdown?"right-start":"bottom-start");let[direction]=position.split("-");if(["left","right"].includes(direction)&&localization.direction==="rtl"){direction=direction==="left"?"right":"left";} 6726const positioningOptions={popper:"menuRef",position,};this.directionCaretClass=DIRECTION_CARET_CLASS[direction];this.togglerRef=useRef("togglerRef");if(this.props.toggler==="parent"){useEffect(()=>{const onClick=(ev)=>{if(this.rootRef.el.contains(ev.target)){return;} 6727this.toggle();};if(this.rootRef.el.parentElement.tabIndex===-1){this.rootRef.el.parentElement.tabIndex=-1;} 6728this.rootRef.el.parentElement.addEventListener("click",onClick);return()=>{this.rootRef.el.parentElement.removeEventListener("click",onClick);};},()=>[]);useEffect((open)=>{this.rootRef.el.parentElement.ariaExpanded=open?"true":"false";},()=>[this.state.open]);usePosition(()=>this.rootRef.el.parentElement,positioningOptions);}else{const togglerRef=useRef("togglerRef");usePosition(()=>togglerRef.el,positioningOptions);}} 6729async changeStateAndNotify(stateSlice){if(stateSlice.open&&this.props.beforeOpen){await this.props.beforeOpen();if(status(this)==="destroyed"){return;}} 6730Object.assign(this.state,stateSlice);const stateChangedPayload={emitter:this,newState:{...this.state},};Dropdown.bus.trigger("state-changed",stateChangedPayload);} 6731close(){return this.changeStateAndNotify({open:false,groupIsOpen:false});} 6732open(){return this.changeStateAndNotify({open:true,groupIsOpen:true});} 6733toggle(){const toggled=!this.state.open;return this.changeStateAndNotify({open:toggled,groupIsOpen:toggled});} 6734get showCaret(){return this.props.showCaret===undefined?this.parentDropdown:this.props.showCaret;} 6735onDropdownStateChanged(args){if(!this.rootRef.el||this.rootRef.el.contains(args.emitter.rootRef.el)){return;} 6736if(args.emitter.rootRef.el.parentElement===this.rootRef.el.parentElement){this.state.groupIsOpen=args.newState.groupIsOpen;if(this.state.open&&args.newState.open){this.state.open=false;}}else{if(this.state.open&&args.newState.open){this.close();}}} 6737onTogglerClick(){this.toggle();} 6738onTogglerMouseEnter(){if(this.state.groupIsOpen&&!this.state.open){this.togglerRef.el.focus();this.open();}} 6739isInActiveElement(){return this.ui.activeElement===this.myActiveEl;} 6740onWindowClicked(ev){if(!this.state.open){return;} 6741if(!this.isInActiveElement()){return;} 6742if(ev.target.closest(".bootstrap-datetimepicker-widget")){return;} 6743const rootEl=this.props.toggler==="parent"?this.rootRef.el.parentElement:this.rootRef.el;const gotClickedInside=rootEl.contains(ev.target);if(!gotClickedInside){this.close();}}} 6744Dropdown.bus=new EventBus();Dropdown.props={class:{type:String,optional:true,},toggler:{type:String,optional:true,validate:(prop)=>["parent"].includes(prop),},skipTogglerTabbing:{type:Boolean,optional:true,},startOpen:{type:Boolean,optional:true,},manualOnly:{type:Boolean,optional:true,},menuClass:{type:String,optional:true,},beforeOpen:{type:Function,optional:true,},togglerClass:{type:String,optional:true,},hotkey:{type:String,optional:true,},tooltip:{type:String,optional:true,},title:{type:String,optional:true,},position:{type:String,optional:true,},slots:{type:Object,optional:true,},showCaret:{type:Boolean,optional:true,},};Dropdown.template="web.Dropdown";return __exports;});; 6745 6746/* /web/static/src/core/dropdown/dropdown_item.js */ 6747odoo.define('@web/core/dropdown/dropdown_item',async function(require){'use strict';let __exports={};const{DROPDOWN}=require("@web/core/dropdown/dropdown");const{Component}=require("@odoo/owl");
6747const ParentClosingMode={None:"none",ClosestParent:"closest",AllParents:"all",};const DropdownItem=__exports.DropdownItem=class DropdownItem extends Component{onClick(ev){const{href,onSelected,parentClosingMode}=this.props;if(href){ev.preventDefault();} 6748if(onSelected){onSelected();} 6749const dropdown=this.env[DROPDOWN];if(!dropdown){return;} 6750const{ClosestParent,AllParents}=ParentClosingMode;switch(parentClosingMode){case ClosestParent:dropdown.close();break;case AllParents:dropdown.closeAllParents();break;}} 6751get dataAttributes(){const{dataset}=this.props;if(this.props.dataset){const attributes=Object.entries(dataset).map(([key,value])=>{return[`data-${key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`)}`,value];});return Object.fromEntries(attributes);} 6752return{};}} 6753DropdownItem.template="web.DropdownItem";DropdownItem.props={onSelected:{type:Function,optional:true,},class:{type:[String,Object],optional:true,},parentClosingMode:{type:ParentClosingMode,optional:true,},hotkey:{type:String,optional:true,},href:{type:String,optional:true,},slots:{type:Object,optional:true,},title:{type:String,optional:true,},dataset:{type:Object,optional:true,},};DropdownItem.defaultProps={parentClosingMode:ParentClosingMode.AllParents,};return __exports;});; 6754 6755/* /web/static/src/core/dropdown/dropdown_navigation_hook.js */ 6756odoo.define('@web/core/dropdown/dropdown_navigation_hook',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{browser}=require("@web/core/browser/browser");const{localization}=require("@web/core/l10n/localization");const{scrollTo}=require("@web/core/utils/scrolling");const{useComponent,useEffect,useRef}=require("@odoo/owl");const ACTIVE_MENU_ELEMENT_CLASS="focus";const MENU_ELEMENTS_SELECTORS=[":scope > .dropdown-item",":scope > .dropdown"];const NEXT_ACTIVE_INDEX_FNS={FIRST:()=>0,LAST:(list)=>list.length-1,NEXT:(list,prevActiveIndex)=>(prevActiveIndex+1)%list.length,PREV:(list,prevActiveIndex)=>(prevActiveIndex<=0?list.length:prevActiveIndex)-1,};__exports.useDropdownNavigation=useDropdownNavigation;function useDropdownNavigation(){const comp=useComponent();if(comp.parentDropdown&&comp.props.toggler==="parent"){throw new Error("A nested Dropdown must use its standard toggler");} 6757const originalOnTogglerClick=comp.onTogglerClick.bind(comp);comp.onTogglerClick=(ev)=>{if(comp.parentDropdown&&!ev.__fromDropdownNavigation){return;} 6758originalOnTogglerClick();};const originalOnTogglerMouseEnter=comp.onTogglerMouseEnter.bind(comp);comp.onTogglerMouseEnter=()=>{if(comp.parentDropdown){return;} 6759originalOnTogglerMouseEnter();};let mouseSelectionActive=true;const menuRef=useRef("menuRef");let menuElements=[];useEffect(()=>{if(!comp.state.open){return;} 6760const addedListeners=[];const queryResult=menuRef.el.querySelectorAll(MENU_ELEMENTS_SELECTORS.join());for(const el of queryResult){const isSubDropdown=el.classList.contains("dropdown");const isSubDropdownOpen=()=>el.classList.contains("show");const navTarget=isSubDropdown?el.querySelector(":scope > .dropdown-toggle"):el;let subDropdownTimeout;const closeSubDropdown=()=>{browser.clearTimeout(subDropdownTimeout);subDropdownTimeout=browser.setTimeout(()=>{if(isSubDropdownOpen()){const ev=new MouseEvent("click",{bubbles:false});ev.__fromDropdownNavigation=true;navTarget.dispatchEvent(ev);}},200);};const openSubDropdown=(immediate=false)=>{browser.clearTimeout(subDropdownTimeout);subDropdownTimeout=browser.setTimeout(()=>{if(!isSubDropdownOpen()){const ev=new MouseEvent("click",{bubbles:false});ev.__fromDropdownNavigation=true;navTarget.dispatchEvent(ev);}},immediate?0:200);};const makeOnlyActive=()=>{for(const menuElement of menuElements){if(menuElement.el===el){continue;} 6761menuElement.navTarget.classList.remove(ACTIVE_MENU_ELEMENT_CLASS);if(menuElement.isSubDropdown){menuElement.closeSubDropdown();}} 6762navTarget.classList.add(ACTIVE_MENU_ELEMENT_CLASS);navTarget.focus();};const menuElement={el,get isActive(){return navTarget.classList.contains(ACTIVE_MENU_ELEMENT_CLASS);},makeOnlyActive,navTarget,get isSubDropdownOpen(){return isSubDropdownOpen();},isSubDropdown,closeSubDropdown,openSubDropdown,};menuElements.push(menuElement);const elementListeners={mouseenter:()=>{if(!mouseSelectionActive){mouseSelectionActive=true;}else{makeOnlyActive();if(isSubDropdown){openSubDropdown();}}},};for(const[eventType,listener]of Object.entries(elementListeners)){navTarget.addEventListener(eventType,listener);} 6763addedListeners.push([navTarget,elementListeners]);} 6764return()=>{menuElements=[];mouseSelectionActive=true;for(const[navTarget,listeners]of addedListeners){for(const[eventType,listener]of Object.entries(listeners)){navTarget.removeEventListener(eventType,listener);}}};});const getActiveMenuElement=()=>{return menuElements.find((menuElement)=>menuElement.isActive);};const setActiveMenuElement=(menuElement)=>{if(menuElements.length){if(typeof menuElement==="string"){const prevIndex=menuElements.indexOf(getActiveMenuElement());const nextIndex=NEXT_ACTIVE_INDEX_FNS[menuElement](menuElements,prevIndex);menuElement=menuElements[nextIndex];} 6765menuElement.makeOnlyActive();scrollTo(menuElement.el,{scrollable:menuElement.el.parentElement});}};useEffect((open)=>{if(open&&comp.parentDropdown){setActiveMenuElement("FIRST");}},()=>[comp.state.open]);const hotkeyService=useService("hotkey");const closeAndRefocus=()=>{const toFocus=comp.props.toggler==="parent"?comp.rootRef.el.parentElement:comp.rootRef.el.querySelector(":scope > .dropdown-toggle");comp.close().then(()=>{toFocus.focus();});};const closeSubDropdown=comp.parentDropdown?closeAndRefocus:()=>{};const openSubDropdown=()=>{const menuElement=getActiveMenuElement();if(menuElement&&menuElement.isSubDropdown){menuElement.openSubDropdown(true);}};const selectActiveMenuElement=()=>{const menuElement=getActiveMenuElement();if(menuElement){if(menuElement.isSubDropdown){menuElement.openSubDropdown(true);}else{menuElement.navTarget.click();}}};let hotkeyRemoves=[];const hotkeyCallbacks={home:()=>setActiveMenuElement("FIRST"),end:()=>setActiveMenuElement("LAST"),tab:()=>setActiveMenuElement("NEXT"),"shift+tab":()=>setActiveMenuElement("PREV"),arrowdown:()=>setActiveMenuElement("NEXT"),arrowup:()=>setActiveMenuElement("PREV"),arrowleft:localization.direction==="rtl"?openSubDropdown:closeSubDropdown,arrowright:localization.direction==="rtl"?closeSubDropdown:openSubDropdown,enter:selectActiveMenuElement,escape:closeAndRefocus,};useEffect((open)=>{if(!open){return;} 6766for(const[hotkey,callback]of Object.entries(hotkeyCallbacks)){const callbackWrapper=()=>{const hasOpenedSubDropdown=menuElements.some((m)=>m.isSubDropdownOpen);if(!hasOpenedSubDropdown){mouseSelectionActive=false;callback.call(comp);}};hotkeyRemoves.push(hotkeyService.add(hotkey,callbackWrapper,{allowRepeat:true}));} 6767return()=>{for(const removeHotkey of hotkeyRemoves){removeHotkey();} 6768hotkeyRemoves=[];};},()=>[comp.state.open]);} 6769return __exports;});; 6770 6771/* /web/static/src/core/effects/effect_container.js */ 6772odoo.define('@web/core/effects/effect_container',async function(require){'use strict';let __exports={};const{Component,xml,onWillDestroy}=require("@odoo/owl");const EffectContainer=__exports.EffectContainer=class EffectContainer extends Component{setup(){this.effect=null;const listenerRef=this.props.bus.addEventListener("UPDATE",(ev)=>{this.effect=ev.detail;this.render();});onWillDestroy(()=>{this.props.bus.removeEventListener("UPDATE",listenerRef);});} 6773removeEffect(){this.effect=null;this.render();}} 6774EffectContainer.template=xml` 6775 <div class="o_effects_manager"> 6776 <t t-if="effect"> 6777 <t t-component="effect.Component" t-props="effect.props" t-key="effect.id" close="() => this.removeEffect()"/> 6778 </t> 6779 </div>`;return __exports;});; 6780 6781/* /web/static/src/core/effects/effect_service.js */ 6782odoo.define('@web/core/effects/effect_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{EffectContainer}=require("@web/core/effects/effect_container");const{RainbowMan}=require("@web/core/effects/rainbow_man");const{EventBus}=require("@odoo/owl");const effectRegistry=registry.category("effects");function rainbowMan(env,params={}){let message=params.message;if(message instanceof jQuery){console.log("Providing a jQuery element to an effect is deprecated. Note that all event handlers will be lost.");message=message.html();}else if(message instanceof Element){console.log("Providing an HTML element to an effect is deprecated. Note that all event handlers will be lost.");message=message.outerHTML;}else if(!message){message=env._t("Well Done!");} 6783if(env.services.user.showEffect){const props={imgUrl:params.img_url||"/web/static/img/smile.svg",fadeout:params.fadeout||"medium",message,Component:params.Component,props:params.props,};return{Component:RainbowMan,props};} 6784env.services.notification.add(message);} 6785effectRegistry.add("rainbow_man",rainbowMan);const effectService=__exports.effectService={start(env){const bus=new EventBus();
6785registry.category("main_components").add("EffectContainer",{Component:EffectContainer,props:{bus},});let effectId=0;function add(params={}){const type=params.type||"rainbow_man";const effect=effectRegistry.get(type);const{Component,props}=effect(env,params)||{};if(Component){bus.trigger("UPDATE",{Component,props,id:effectId++});}} 6786return{add};},};registry.category("services").add("effect",effectService);return __exports;});; 6787 6788/* /web/static/src/core/effects/rainbow_man.js */ 6789odoo.define('@web/core/effects/rainbow_man',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{Component,useEffect,useExternalListener,useState}=require("@odoo/owl");const RainbowMan=__exports.RainbowMan=class RainbowMan extends Component{setup(){useExternalListener(document.body,"click",this.closeRainbowMan);this.state=useState({isFading:false});this.delay=RainbowMan.rainbowFadeouts[this.props.fadeout];if(this.delay){useEffect(()=>{const timeout=browser.setTimeout(()=>{this.state.isFading=true;},this.delay);return()=>browser.clearTimeout(timeout);},()=>[]);}} 6790onAnimationEnd(ev){if(this.delay&&ev.animationName==="reward-fading-reverse"){ev.stopPropagation();this.closeRainbowMan();}} 6791closeRainbowMan(){this.props.close();}} 6792RainbowMan.template="web.RainbowMan";RainbowMan.rainbowFadeouts={slow:4500,medium:3500,fast:2000,no:false};return __exports;});; 6793 6794/* /web/static/src/core/errors/error_dialogs.js */ 6795odoo.define('@web/core/errors/error_dialogs',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{Dialog}=require("@web/core/dialog/dialog");const{_lt}=require("@web/core/l10n/translation");const{registry}=require("@web/core/registry");const{useService}=require("@web/core/utils/hooks");const{capitalize}=require("@web/core/utils/strings");const{Component,useState,markup}=require("@odoo/owl");const odooExceptionTitleMap=__exports.odooExceptionTitleMap=new Map(Object.entries({"odoo.addons.base.models.ir_mail_server.MailDeliveryException":_lt("MailDeliveryException"),"odoo.exceptions.AccessDenied":_lt("Access Denied"),"odoo.exceptions.MissingError":_lt("Missing Record"),"odoo.exceptions.UserError":_lt("User Error"),"odoo.exceptions.ValidationError":_lt("Validation Error"),"odoo.exceptions.AccessError":_lt("Acce
6795ss Error"),"odoo.exceptions.Warning":_lt("Warning"),}));const ErrorDialog=__exports.ErrorDialog=class ErrorDialog extends Component{setup(){this.state=useState({showTraceback:false,});} 6796onClickClipboard(){browser.navigator.clipboard.writeText(`${this.props.name}\n${this.props.message}\n${this.props.traceback}`);}} 6797ErrorDialog.template="web.ErrorDialog";ErrorDialog.components={Dialog};ErrorDialog.title=_lt("Odoo Error");const ClientErrorDialog=__exports.ClientErrorDialog=class ClientErrorDialog extends ErrorDialog{} 6798ClientErrorDialog.title=_lt("Odoo Client Error");const NetworkErrorDialog=__exports.NetworkErrorDialog=class NetworkErrorDialog extends ErrorDialog{} 6799NetworkErrorDialog.title=_lt("Odoo Network Error");const RPCErrorDialog=__exports.RPCErrorDialog=class RPCErrorDialog extends ErrorDialog{setup(){super.setup();this.inferTitle();this.traceback=this.props.traceback;if(this.props.data&&this.props.data.debug){this.traceback=`${this.props.data.debug}\nThe above server error caused the following client error:\n${this.traceback}`;}} 6800inferTitle(){if(this.props.exceptionName&&odooExceptionTitleMap.has(this.props.exceptionName)){this.title=odooExceptionTitleMap.get(this.props.exceptionName).toString();return;} 6801if(!this.props.type){return;} 6802switch(this.props.type){case"server":this.title=this.env._t("Odoo Server Error");break;case"script":this.title=this.env._t("Odoo Client Error");break;case"network":this.title=this.env._t("Odoo Network Error");break;}} 6803onClickClipboard(){browser.navigator.clipboard.writeText(`${this.props.name}\n${this.props.message}\n${this.traceback}`);}} 6804const WarningDialog=__exports.WarningDialog=class WarningDialog extends Component{setup(){this.title=this.inferTitle();const{data,message}=this.props;if(data&&data.arguments&&data.arguments.length>0){this.message=data.arguments[0];}else{this.message=message;}} 6805inferTitle(){if(this.props.exceptionName&&odooExceptionTitleMap.has(this.props.exceptionName)){return odooExceptionTitleMap.get(this.props.exceptionName).toString();} 6806return this.props.title||this.env._t("Odoo Warning");}} 6807WarningDialog.template="web.WarningDialog";WarningDialog.components={Dialog};const RedirectWarningDialog=__exports.RedirectWarningDialog=class RedirectWarningDialog extends Component{setup(){this.actionService=useService("action");const{data,subType}=this.props;const[message,actionId,buttonText,additionalContext]=data.arguments;this.title=capitalize(subType)||this.env._t("Odoo Warning");this.message=message;this.actionId=actionId;this.buttonText=buttonText;this.additionalContext=additionalContext;} 6808async onClick(){const options={};if(this.additionalContext){options.additionalContext=this.additionalContext;} 6809if(this.actionId.help){this.actionId.help=markup(this.actionId.help);} 6810await this.actionService.doAction(this.actionId,options);this.props.close();}} 6811RedirectWarningDialog.template="web.RedirectWarningDialog";RedirectWarningDialog.components={Dialog};const Error504Dialog=__exports.Error504Dialog=class Error504Dialog extends Component{} 6812Error504Dialog.template="web.Error504Dialog";Error504Dialog.components={Dialog};Error504Dialog.title=_lt("Request timeout");const SessionExpiredDialog=__exports.SessionExpiredDialog=class SessionExpiredDialog extends Component{onClick(){browser.location.reload();}} 6813SessionExpiredDialog.template="web.SessionExpiredDialog";SessionExpiredDialog.components={Dialog};SessionExpiredDialog.title=_lt("Odoo Session Expired");registry.category("error_dialogs").add("odoo.exceptions.AccessDenied",WarningDialog).add("odoo.exceptions.AccessError",WarningDialog).add("odoo.exceptions.MissingError",WarningDialog).add("odoo.exceptions.UserError",WarningDialog).add("odoo.exceptions.ValidationError",WarningDialog).add("odoo.exceptions.RedirectWarning",RedirectWarningDialog).add("odoo.http.SessionExpiredException",SessionExpiredDialog).add("werkzeug.exceptions.Forbidden",SessionExpiredDialog).add("504",Error504Dialog);return __exports;});; 6814 6815/* /web/static/src/core/errors/error_handlers.js */ 6816odoo.define('@web/core/errors/error_handlers',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{ConnectionLostError,RPCError}=require("@web/core/network/rpc_service");const{registry}=require("@web/core/registry");const{ClientErrorDialog,ErrorDialog,NetworkErrorDialog,RPCErrorDialog,}=require("@web/core/errors/error_dialogs");const{UncaughtClientError,UncaughtCorsError,UncaughtPromiseError}=require("@web/core/errors/error_service");const errorHandlerRegistry=registry.category("error_handlers");const errorDialogRegistry=registry.category("error_dialogs");const errorNotificationRegistry=registry.category("error_notifications");__exports.rpcErrorHandler=rpcErrorHandler;function rpcErrorHandler(env,error,originalError){if(!(error instanceof UncaughtPromiseError)){return false;} 6817if(originalError instanceof RPCError){error.unhandledRejectionEvent.preventDefault();const exceptionName=originalError.exceptionName;let ErrorComponent=originalError.Component;
6817if(!ErrorComponent&&exceptionName){if(errorNotificationRegistry.contains(exceptionName)){const notif=errorNotificationRegistry.get(exceptionName);env.services.notification.add(notif.message||originalError.data.message,notif);return true;} 6818if(errorDialogRegistry.contains(exceptionName)){ErrorComponent=errorDialogRegistry.get(exceptionName);}} 6819if(!ErrorComponent&&originalError.data.context){const exceptionClass=originalError.data.context.exception_class;if(errorDialogRegistry.contains(exceptionClass)){ErrorComponent=errorDialogRegistry.get(exceptionClass);}} 6820env.services.dialog.add(ErrorComponent||RPCErrorDialog,{traceback:error.traceback,message:originalError.message,name:originalError.name,exceptionName:originalError.exceptionName,data:originalError.data,subType:originalError.subType,code:originalError.code,type:originalError.type,});return true;}} 6821errorHandlerRegistry.add("rpcErrorHandler",rpcErrorHandler,{sequence:97});let connectionLostNotifRemove=null;__exports.lostConnectionHandler=lostConnectionHandler;function lostConnectionHandler(env,error,originalError){if(!(error instanceof UncaughtPromiseError)){return false;} 6822if(originalError instanceof ConnectionLostError){if(connectionLostNotifRemove){return true;} 6823connectionLostNotifRemove=env.services.notification.add(env._t("Connection lost. Trying to reconnect..."),{sticky:true});let delay=2000;browser.setTimeout(function checkConnection(){env.services.rpc("/web/webclient/version_info",{}).then(function(){if(connectionLostNotifRemove){connectionLostNotifRemove();connectionLostNotifRemove=null;} 6824env.services.notification.add(env._t("Connection restored. You are back online."),{type:"info",});}).catch(()=>{delay=delay*1.5+500*Math.random();browser.setTimeout(checkConnection,delay);});},delay);return true;}} 6825errorHandlerRegistry.add("lostConnectionHandler",lostConnectionHandler,{sequence:98});const defaultDialogs=new Map([[UncaughtClientError,ClientErrorDialog],[UncaughtPromiseError,ClientErrorDialog],[UncaughtCorsError,NetworkErrorDialog],]);function defaultHandler(env,error){if(env.services.dialog){const DialogComponent=defaultDialogs.get(error.constructor)||ErrorDialog;env.services.dialog.add(DialogComponent,{traceback:error.traceback,message:error.message,name:error.name,});}else{console.error(error.traceback);} 6826return true;} 6827errorHandlerRegistry.add("defaultHandler",defaultHandler,{sequence:100});return __exports;});; 6828 6829/* /web/static/src/core/errors/error_service.js */ 6830odoo.define('@web/core/errors/error_service',async function(require){'use strict';let __exports={};const{isBrowserFirefox}=require("@web/core/browser/feature_detection");const{browser}=require("@web/core/browser/browser");const{_lt}=require("@web/core/l10n/translation");const{registry}=require("@web/core/registry");const{completeUncaughtError,getErrorTechnicalName}=require("@web/core/errors/error_utils");const UncaughtError=__exports.UncaughtError=class UncaughtError extends Error{constructor(message){super(message);this.name=getErrorTechnicalName(this);this.traceback=null;}} 6831const UncaughtClientError=__exports.UncaughtClientError=class UncaughtClientError extends UncaughtError{constructor(message=_lt("Uncaught Javascript Error")){super(message);}} 6832const UncaughtPromiseError=__exports.UncaughtPromiseError=class UncaughtPromiseError extends UncaughtError{constructor(message=_lt("Uncaught Promise")){super(message);this.unhandledRejectionEvent=null;}} 6833const UncaughtCorsError=__exports.UncaughtCorsError=class UncaughtCorsError extends UncaughtError{constructor(message=_lt("Uncaught CORS Error")){super(message);}} 6834const errorService=__exports.errorService={start(env){function handleError(uncaughtError,retry=true){let originalError=uncaughtError;while(originalError instanceof Error&&"cause"in originalError){originalError=originalError.cause;} 6835const services=env.services;if(!services.dialog||!services.notification||!services.rpc){if(retry){browser.setTimeout(()=>{handleError(uncaughtError,false);},1000);} 6836return;} 6837for(const handler of registry.category("error_handlers").getAll()){if(handler(env,uncaughtError,originalError)){break;}} 6838if(uncaughtError.event&&!uncaughtError.event.defaultPrevented){uncaughtError.event.preventDefault();console.error(uncaughtError.traceback);}} 6839browser.addEventListener("error",async(ev)=>{const{colno,error,filename,lineno,message}=ev;const errorsToIgnore=["ResizeObserver loop completed with undelivered notifications.","ResizeObserver loop limit exceeded",];if(!(error instanceof Error)&&errorsToIgnore.includes(message)){ev.preventDefault();return;} 6840const isRedactedError=!filename&&!lineno&&!colno;const isThirdPartyScriptError=isRedactedError||(isBrowserFirefox()&&new URL(filename).origin!==window.location.origin);if(isThirdPartyScriptError&&!odoo.debug){return;} 6841let uncaughtError;if(isRedactedError){uncaughtError=new UncaughtCorsError();uncaughtError.traceback=env._t(`Unknown CORS error\n\n`+`An unknown CORS error occured.\n`+`The error probably originates from a JavaScript file served from a different origin.\n`+`(Opening your browser console might give you a hint on the error.)`);}else{uncaughtError=new UncaughtClientError();uncaughtError.event=ev;if(error instanceof Error){error.errorEvent=ev;const annotated=env.debug&&env.debug.includes("assets");await completeUncaughtError(uncaughtError,error,annotated);}} 6842uncaughtError.cause=error;handleError(uncaughtError);});browser.addEventListener("unhandledrejection",async(ev)=>{const error=ev.reason;const uncaughtError=new UncaughtPromiseError();uncaughtError.unhandledRejectionEvent=ev;uncaughtError.event=ev;if(error instanceof Error){error.errorEvent=ev;const annotated=env.debug&&env.debug.includes("assets");await completeUncaughtError(uncaughtError,error,annotated);} 6843uncaughtError.cause=error;handleError(uncaughtError);});},};registry.category("services").add("error",errorService,{sequence:1});return __exports;});; 6844 6845/* /web/static/src/core/errors/error_utils.js */ 6846odoo.define('@web/core/errors/error_utils',async function(require){'use strict';let __exports={};const{_loadJS}=require("@web/core/assets");function combineErrorNames(uncaughtError,originalError){const originalErrorName=getErrorTechnicalName(originalError);const uncaughtErrorName=getErrorTechnicalName(uncaughtError);if(originalErrorName===Error.name){return uncaughtErrorName;}else{return`${uncaughtErrorName} > ${originalErrorName}`;}} 6847__exports.fullTraceback=fullTraceback;function fullTraceback(error){let traceback=formatTraceback(error);let current=error.cause;while(current){traceback+=`\n\nCaused by: ${ 6848 current instanceof Error ? formatTraceback(current) : current 6849 }`;current=current.cause;} 6850return traceback;} 6851__exports.fullAnnotatedTraceback=fullAnnotatedTraceback;async function fullAnnotatedTraceback(error){if(error.annotatedTraceback){return error.annotatedTraceback;} 6852if(error.errorEvent){error.errorEvent.preventDefault();} 6853let traceback;try{traceback=await annotateTraceback(error);let current=error.cause;while(current){traceback+=`\n\nCaused by: ${ 6854 current instanceof Error ? await annotateTraceback(current) : current 6855 }`;current=current.cause;}}catch(e){console.warn("Failed to annotate traceback for error:",error,"failure reason:",e);traceback=fullTraceback(error);} 6856error.annotatedTraceback=traceback;if(error.errorEvent){throw error;} 6857return traceback;} 6858__exports.completeUncaughtError=completeUncaughtError;async function completeUncaughtError(uncaughtError,originalError,annotated=false){uncaughtError.name=combineErrorNames(uncaughtError,originalError);if(annotated){uncaughtError.traceback=await fullAnnotatedTraceback(originalError);}else{uncaughtError.traceback=fullTraceback(originalError);} 6859if(originalError.message){uncaughtError.message=`${uncaughtError.message} > ${originalError.message}`;} 6860uncaughtError.cause=originalError;} 6861__exports.getErrorTechnicalName=getErrorTechnicalName;function getErrorTechnicalName(error){return error.name!==Error.name?error.
6861name:error.constructor.name;} 6862__exports.formatTraceback=formatTraceback;function formatTraceback(error){let traceback=error.stack;const errorName=getErrorTechnicalName(error);const descriptionLine=`${errorName}: ${error.message}`;if(error.stack.split("\n")[0].trim()!==descriptionLine){traceback=`${descriptionLine}\n${error.stack}`.replace(/\n/g,"\n ");} 6863return traceback;} 6864__exports.annotateTraceback=annotateTraceback;async function annotateTraceback(error){const traceback=formatTraceback(error);try{await _loadJS("/web/static/lib/stacktracejs/stacktrace.js");}catch(_e){return traceback;} 6865if(error.stack){const regex=/ line (\d*) > (Function):(\d*)/gm;const subst=`:$1`;error.stack=error.stack.replace(regex,subst);} 6866let frames;try{frames=await StackTrace.fromError(error);}catch(e){console.warn("The following error could not be annotated:",error,e);return traceback;} 6867const lines=traceback.split("\n");if(lines[lines.length-1].trim()===""){lines.splice(-1);} 6868let lineIndex=0;let frameIndex=0;while(frameIndex<frames.length){const line=lines[lineIndex];if(!line.match(/:\d+:\d+\)?$/)){lineIndex++;continue;} 6869const frame=frames[frameIndex];const info=` (${frame.fileName}:${frame.lineNumber})`;lines[lineIndex]=line+info;lineIndex++;frameIndex++;} 6870return lines.join("\n");} 6871return __exports;});; 6872 6873/* /web/static/src/core/file_input/file_input.js */ 6874odoo.define('@web/core/file_input/file_input',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{checkFileSize}=require("@web/core/utils/files");const{Component,onMounted,useRef}=require("@odoo/owl");const FileInput=__exports.FileInput=class FileInput extends Component{setup(){this.http=useService("http");this.fileInputRef=useRef("file-input");onMounted(()=>{if(this.props.autoOpen){this.onTriggerClicked();}});} 6875get httpParams(){const{resId,resModel}=this.props;const params={csrf_token:odoo.csrf_token,ufile:[...this.fileInputRef.el.files],};if(resModel){params.model=resModel;} 6876if(resId!==undefined){params.id=resId;} 6877return params;} 6878async uploadFiles(params){if((params.ufile&¶ms.ufile.length)||params.file){const fileSize=(params.ufile&¶ms.ufile[0].size)||params.file.size;if(!checkFileSize(fileSize,this.env.services.notification)){return null;}} 6879const fileData=await this.http.post(this.props.route,params,"text");const parsedFileData=JSON.parse(fileData);if(parsedFileData.error){throw new Error(parsedFileData.error);} 6880return parsedFileData;} 6881async onFileInputChange(){const parsedFileData=await this.uploadFiles(this.httpParams);if(parsedFileData){this.props.onUpload(parsedFileData);}} 6882async onTriggerClicked(){if(await this.props.beforeOpen()){this.fileInputRef.el.click();}}} 6883FileInput.defaultProps={acceptedFileExtensions:"*",hidden:false,multiUpload:false,onUpload:()=>{},route:"/web/binary/upload_attachment",beforeOpen:async()=>true,};FileInput.props={acceptedFileExtensions:{type:String,optional:true},autoOpen:{type:Boolean,optional:true},hidden:{type:Boolean,optional:true},multiUpload:{type:Boolean,optional:true},onUpload:{type:Function,optional:true},beforeOpen:{type:Function,optional:true},resId:{type:Number,optional:true},resModel:{type:String,optional:true},route:{type:String,optional:true},"*":true,};FileInput.template="web.FileInput";return __exports;});; 6884 6885/* /web/static/src/core/file_upload/file_upload_progress_bar.js */ 6886odoo.define('@web/core/file_upload/file_upload_progress_bar',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{sprintf}=require("@web/core/utils/strings");const{ConfirmationDialog}=require("@web/core/confirmation_dialog/confirmation_dialog");const{Component}=require("@odoo/owl");const FileUploadProgressBar=__exports.FileUploadProgressBar=class FileUploadProgressBar extends Component{setup(){this.dialogService=useService("dialog");} 6887onCancel(){if(!this.props.fileUpload.xhr){return;} 6888this.dialogService.add(ConfirmationDialog,{body:sprintf(this.env._t("Do you really want to cancel the upload of %s?"),this.props.fileUpload.title),confirm:()=>{this.props.fileUpload.xhr.abort();},});}} 6889FileUploadProgressBar.props={fileUpload:{type:Object},};FileUploadProgressBar.template="web.FileUploadProgressBar";return __exports;});; 6890 6891/* /web/static/src/core/file_upload/file_upload_progress_container.js */ 6892odoo.define('@web/core/file_upload/file_upload_progress_container',async function(require){'use strict';let __exports={};const{Component}=require("@odoo/owl");const FileUploadProgressContainer=__exports.FileUploadProgressContainer=class FileUploadProgressContainer extends Component{} 6893FileUploadProgressContainer.template="web.FileUploadProgressContainer";FileUploadProgressContainer.props={Component:{optional:false},shouldDisplay:{type:Function,optional:true},fileUploads:{type:Object},};return __exports;});; 6894 6895/* /web/static/src/core/file_upload/file_upload_progress_record.js */ 6896odoo.define('@web/core/file_upload/file_upload_progress_record',async function(require){'use strict';let __exports={};const{sprintf}=require("@web/core/utils/strings");const{FileUploadProgressBar}=require("@web/core/file_upload/file_upload_progress_bar");const{Component}=require("@odoo/owl");const FileUploadProgressRecord=__exports.FileUploadProgressRecord=class FileUploadProgressRecord extends Component{getProgressTexts(){const fileUpload=this.props.fileUpload;const percent=Math.round(fileUpload.progress*100);if(percent===100){return{left:this.env._t("Processing..."),right:"",};}else{const mbLoaded=Math.round(fileUpload.loaded/1000000);const mbTotal=Math.round(fileUpload.total/1000000);return{left:sprintf(this.env._t("Uploading... (%s%)"),percent),right:sprintf(this.env._t("(%s/%sMB)"),mbLoaded,mbTotal),};}}} 6897FileUploadProgressRecord.components={FileUploadProgressBar,};const FileUploadProgressKanbanRecord=__exports.FileUploadProgressKanbanRecord=class FileUploadProgressKanbanRecord extends FileUploadProgressRecord{} 6898FileUploadProgressKanbanRecord.template="web.FileUploadProgressKanbanRecord";const FileUploadProgressDataRow=__exports.FileUploadProgressDataRow=class FileUploadProgressDataRow extends FileUploadProgressRecord{} 6899FileUploadProgressDataRow.template="web.FileUploadProgressDataRow";return __exports;});; 6900 6901/* /web/static/src/core/file_upload/file_upload_service.js */ 6902odoo.define('@web/core/file_upload/file_upload_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{sprintf}=require("@web/core/utils/strings");const{EventBus,reactive}=require("@odoo/owl");const fileUploadService=__exports.fileUploadService={dependencies:["n
6902otification"],createXhr(){return new window.XMLHttpRequest();},start(env,{notificationService}){const uploads=reactive({});let nextId=1;const bus=new EventBus();const upload=async(route,files,params={})=>{const xhr=this.createXhr();xhr.open("POST",route);const formData=new FormData();formData.append("csrf_token",odoo.csrf_token);for(const file of files){formData.append("ufile",file);} 6903if(params.buildFormData){params.buildFormData(formData);} 6904const upload=reactive({id:nextId++,xhr,data:formData,progress:0,loaded:0,total:0,state:"pending",title:files.length===1?files[0].name:sprintf(env._t("%s Files"),files.length),type:files.length===1?files[0].type:undefined,});uploads[upload.id]=upload;xhr.upload.addEventListener("progress",async(ev)=>{upload.progress=ev.loaded/ev.total;upload.loaded=ev.loaded;upload.total=ev.total;upload.state="loading";});xhr.addEventListener("load",()=>{delete uploads[upload.id];upload.state="loaded";bus.trigger("FILE_UPLOAD_LOADED",{upload});});xhr.addEventListener("error",async()=>{delete uploads[upload.id];upload.state="error";if(params.displayErrorNotification!==undefined&¶ms.displayErrorNotification){notificationService.add(env._t("An error occured while uploading."),{title:env._t("Error"),sticky:true,});} 6905bus.trigger("FILE_UPLOAD_ERROR",{upload});});xhr.addEventListener("abort",async()=>{delete uploads[upload.id];upload.state="abort";bus.trigger("FILE_UPLOAD_ERROR",{upload});});xhr.send(formData);bus.trigger("FILE_UPLOAD_ADDED",{upload});return upload;};return{bus,upload,uploads};},};registry.category("services").add("file_upload",fileUploadService);return __exports;});; 6906 6907/* /web/static/src/core/hotkeys/hotkey_hook.js */ 6908odoo.define('@web/core/hotkeys/hotkey_hook',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{useEffect}=require("@odoo/owl");__exports.useHotkey=useHotkey;function useHotkey(hotkey,callback,options={}){const hotkeyService=useService("hotkey");useEffect(()=>hotkeyService.add(hotkey,callback,options),()=>[]);} 6909return __exports;});; 6910 6911/* /web/static/src/core/hotkeys/hotkey_service.js */ 6912odoo.define('@web/core/hotkeys/hotkey_service',async function(require){'use strict';let __exports={};const{isMacOS}=require("@web/core/browser/feature_detection");const{registry}=require("@web/core/registry");const{browser}=require("@web/core/browser/browser");const{getVisibleElements}=require("@web/core/utils/ui");const ALPHANUM_KEYS="abcdefghijklmnopqrstuvwxyz0123456789".split("");const NAV_KEYS=["arrowleft","arrowright","arrowup","arrowdown","pageup","pagedown","home","end","backspace","enter","tab","delete","space",];const MODIFIERS=["alt","control","shift"];const AUTHORIZED_KEYS=[...ALPHANUM_KEYS,...NAV_KEYS,"escape"];__exports.getActiveHotkey=getActiveHotkey;function getActiveHotkey(ev){if(!ev.key){return"";} 6913if(ev.isComposing){return"";} 6914const hotkey=[];if(isMacOS()?ev.ctrlKey:ev.altKey){hotkey.push("alt");} 6915if(isMacOS()?ev.metaKey:ev.ctrlKey){hotkey.push("control");} 6916if(ev.shiftKey){hotkey.push("shift");} 6917let key=ev.key.toLowerCase();if(ev.code&&ev.code.indexOf("Digit")===0){key=ev.code.slice(-1);} 6918if(!AUTHORIZED_KEYS.includes(key)&&ev.code&&ev.code.indexOf("Key")===0){key=ev.code.slice(-1).toLowerCase();} 6919if(!MODIFIERS.includes(key)){hotkey.push(key);} 6920return hotkey.join("+");} 6921const hotkeyService=__exports.hotkeyService={dependencies:["ui"],overlayModifier:"alt",start(env,{ui}){const registrations=new Map();let nextToken=0;let overlaysVisible=false;addListeners(browser);function addListeners(target){target.addEventListener("keydown",onKeydown);target.addEventListener("keyup",removeHotkeyOverlays);target.addEventListener("blur",removeHotkeyOverlays);target.addEventListener("click",removeHotkeyOverlays);} 6922function onKeydown(event){if(event.code&&event.code.indexOf("Numpad")===0&&/^\d$/.test(event.key)){return;} 6923const hotkey=getActiveHotkey(event);if(!hotkey){return;} 6924const{activeElement,isBlocked}=ui;if(isBlocked){return;} 6925const elementsWithAccessKey=document.querySelectorAll("[accesskey]");for(const el of elementsWithAccessKey){if(el instanceof HTMLElement){el.dataset.hotkey=el.accessKey;el.removeAttribute("accesskey");}} 6926if(!overlaysVisible&&hotkey===hotkeyService.overlayModifier){addHotkeyOverlays(activeElement);event.preventDefault();return;} 6927const singleKey=hotkey.split("+").pop();if(!AUTHORIZED_KEYS.includes(singleKey)){return;} 6928const targetIsEditable=event.target instanceof HTMLElement&&(/input|textarea/i.test(event.target.tagName)||event.target.isContentEditable);const shouldProtectEditable=targetIsEditable&&!event.target.dataset.allowHotkeys&&singleKey!=="escape";const infos={activeElement,hotkey,isRepeated:event.repeat,target:event.target,shouldProtectEditable,};const dispatched=dispatch(infos);
6928if(dispatched){event.preventDefault();event.stopImmediatePropagation();} 6929if(overlaysVisible){removeHotkeyOverlays();event.preventDefault();}} 6930function dispatch(infos){const{activeElement,hotkey,isRepeated,target,shouldProtectEditable}=infos;const reversedRegistrations=Array.from(registrations.values()).reverse();const domRegistrations=getDomRegistrations(hotkey,activeElement);const allRegistrations=reversedRegistrations.concat(domRegistrations);const candidates=allRegistrations.filter((reg)=>reg.hotkey===hotkey&&(reg.allowRepeat||!isRepeated)&&(reg.bypassEditableProtection||!shouldProtectEditable)&&(reg.global||reg.activeElement===activeElement)&&(!reg.validate||reg.validate(target))&&(!reg.area||(target instanceof Node&®.area()&®.area().contains(target))));let winner=candidates.shift();if(winner&&winner.area){for(const candidate of candidates.filter((c)=>Boolean(c.area))){if(candidate.area()&&winner.area().contains(candidate.area())){winner=candidate;}}} 6931if(winner){winner.callback({area:winner.area&&winner.area(),target,});return true;} 6932return false;} 6933function getDomRegistrations(hotkey,activeElement){const overlayModParts=hotkeyService.overlayModifier.split("+");if(!overlayModParts.every((el)=>hotkey.includes(el))){return[];} 6934const cleanHotkey=hotkey.split("+").filter((key)=>!overlayModParts.includes(key)).join("+");const elems=getVisibleElements(activeElement,`[data-hotkey='${cleanHotkey}' i]`);return elems.map((el)=>({hotkey,activeElement,bypassEditableProtection:true,callback:()=>{if(document.activeElement){document.activeElement.blur();} 6935el.focus();browser.setTimeout(()=>el.click());},}));} 6936function addHotkeyOverlays(activeElement){for(const el of getVisibleElements(activeElement,"[data-hotkey]:not(:disabled)")){const hotkey=el.dataset.hotkey;const overlay=document.createElement("div");overlay.classList.add("o_web_hotkey_overlay","position-absolute","top-0","bottom-0","start-0","end-0","d-flex","justify-content-center","align-items-center","m-0","bg-black-50","h6");const overlayKbd=document.createElement("kbd");overlayKbd.className="small";overlayKbd.appendChild(document.createTextNode(hotkey.toUpperCase()));overlay.appendChild(overlayKbd);let overlayParent;if(el.tagName.toUpperCase()==="INPUT"){overlayParent=el.parentElement;}else{overlayParent=el;} 6937if(overlayParent.style.position!=="absolute"){overlayParent.style.position="relative";} 6938overlayParent.appendChild(overlay);} 6939overlaysVisible=true;} 6940function removeHotkeyOverlays(){for(const overlay of document.querySelectorAll(".o_web_hotkey_overlay")){overlay.remove();} 6941overlaysVisible=false;} 6942function registerHotkey(hotkey,callback,options={}){if(!hotkey||hotkey.length===0){throw new Error("You must specify an hotkey when registering a registration.");} 6943if(!callback||typeof callback!=="function"){throw new Error("You must specify a callback function when registering a registration.");} 6944const keys=hotkey.toLowerCase().split("+").filter((k)=>!MODIFIERS.includes(k));if(keys.some((k)=>!AUTHORIZED_KEYS.includes(k))){throw new Error(`You are trying to subscribe for an hotkey ('${hotkey}') 6945 that contains parts not whitelisted: ${keys.join(", ")}`);}else if(keys.length>1){throw new Error(`You are trying to subscribe for an hotkey ('${hotkey}') 6946 that contains more than one single key part: ${keys.join("+")}`);} 6947const token=nextToken++;const registration={hotkey:hotkey.toLowerCase(),callback,activeElement:null,allowRepeat:options&&options.allowRepeat,bypassEditableProtection:options&&options.bypassEditableProtection,global:options&&options.global,area:options&&options.area,validate:options&&options.validate,};Promise.resolve().then(()=>{registration.activeElement=ui.activeElement;});registrations.set(token,registration);return token;} 6948function unregisterHotkey(token){registrations.delete(token);} 6949return{add(hotkey,callback,options={}){const token=registerHotkey(hotkey,callback,options);return()=>{unregisterHotkey(token);};},registerIframe(iframe){addListeners(iframe.contentWindow);},};},};registry.category("services").add("hotkey",hotkeyService);return __exports;});; 6950 6951/* /web/static/src/core/l10n/dates.js */ 6952odoo.define('@web/core/l10n/dates',async function(require){'use strict';let __exports={};const{localization}=require("@web/core/l10n/localization");const{_t}=require("@web/core/l10n/translation");const{memoize}=require("@web/core/utils/functions");const{sprintf}=require("@web/core/utils/strings");const{DateTime,Settings}=luxon;const SERVER_DATE_FORMAT="yyyy-MM-dd";
6952const SERVER_TIME_FORMAT="HH:mm:ss";const SERVER_DATETIME_FORMAT=`${SERVER_DATE_FORMAT} ${SERVER_TIME_FORMAT}`;const alphaRegex=/[a-zA-Z]/g;const nonAlphaRegex=/[^a-zA-Z]/g;const nonDigitsRegex=/[^0-9]/g;const normalizeFormatTable={a:"ccc",A:"cccc",b:"MMM",B:"MMMM",d:"dd",H:"HH",I:"hh",j:"o",m:"MM",M:"mm",p:"a",S:"ss",W:"WW",w:"c",y:"yy",Y:"yyyy",c:"ccc MMM d HH:mm:ss yyyy",x:"MM/dd/yy",X:"HH:mm:ss",};const luxonToMomentFormatTable={c:"d",d:"D",o:"DDDD",a:"A",y:"Y",};const smartDateUnits={d:"days",m:"months",w:"weeks",y:"years",};const smartDateRegex=new RegExp(`^([+-])(\\d+)([${Object.keys(smartDateUnits).join("")}]?)$`);__exports.areDateEquals=areDateEquals;function areDateEquals(d1,d2){return d1 instanceof DateTime&&d2 instanceof DateTime?d1.equals(d2):d1===d2;} 6953function parseSmartDateInput(value){const match=smartDateRegex.exec(value);if(match){let date=DateTime.local();const offset=parseInt(match[2],10);const unit=smartDateUnits[match[3]||"d"];if(match[1]==="+"){date=date.plus({[unit]:offset});}else{date=date.minus({[unit]:offset});} 6954return date;} 6955return false;} 6956function isValidDateTime(dt){return dt&&dt.isValid&&dt.year>=1000&&dt.year<10000;} 6957const stripAlphaDupes=memoize(function stripAlphaDupes(str){return str.replace(alphaRegex,(letter,index,str)=>{return letter===str[index-1]?"":letter;});});const strftimeToLuxonFormat=__exports.strftimeToLuxonFormat=memoize(function strftimeToLuxonFormat(value){const output=[];let inToken=false;for(let index=0;index<value.length;++index){let character=value[index];if(character==="%"&&!inToken){inToken=true;continue;} 6958if(character.match(alphaRegex)){if(inToken&&normalizeFormatTable[character]!==undefined){character=normalizeFormatTable[character];}else{character="'"+character+"'";}} 6959output.push(character);inToken=false;} 6960return output.join("");});const luxonToMomentFormat=__exports.luxonToMomentFormat=memoize(function luxonToMomentFormat(format){return format.replace(alphaRegex,(match)=>{return luxonToMomentFormatTable[match]||match;});});__exports.luxonToMoment=luxonToMoment;function luxonToMoment(dt){if(dt.isValid){const o=dt.toObject();return moment({...o,month:o.month-1});}else{return moment.invalid();}} 6961__exports.momentToLuxon=momentToLuxon;function momentToLuxon(dt){const o=dt.toObject();return DateTime.fromObject({year:o.years,month:o.months+1,day:o.date,hour:o.hours,minute:o.minutes,second:o.seconds,millisecond:o.milliseconds,});} 6962__exports.is24HourFormat=is24HourFormat;function is24HourFormat(format){return(format||localization.timeFormat).indexOf("H")!==-1;} 6963__exports.formatDate=formatDate;function formatDate(value,options={}){if(value===false){return"";} 6964const format=options.format||localization.dateFormat;const numberingSystem=options.numberingSystem||Settings.defaultNumberingSystem||"latn";return value.toFormat(format,{numberingSystem});} 6965__exports.formatDateTime=formatDateTime;function formatDateTime(value,options={}){if(value===false){return"";} 6966const format=options.format||localization.dateTimeFormat;const numberingSystem=options.numberingSystem||Settings.defaultNumberingSystem||"latn";return value.setZone("default").toFormat(format,{numberingSystem});} 6967__exports.parseDate=parseDate;function parseDate(value,options={}){if(!value){return false;} 6968return parseDateTime(value,{format:localization.dateFormat,...options}).startOf("day");} 6969__exports.parseDateTime=parseDateTime;function parseDateTime(value,options={}){if(!value){return false;} 6970const fmt=options.format||localization.dateTimeFormat;const parseOpts={setZone:true,zone:"default",locale:options.locale,numberingSystem:options.numberingSystem||Settings.defaultNumberingSystem||"latn",};if(/[0-9]/.test(value)){parseOpts.numberingSystem="latn";} 6971let result=DateTime.fromFormat(value,fmt,parseOpts);if(!isValidDateTime(result)){result=parseSmartDateInput(value);} 6972if(!isValidDateTime(result)){const fmtWoZero=stripAlphaDupes(fmt);result=DateTime.fromFormat(value,fmtWoZero,parseOpts);} 6973if(!isValidDateTime(result)){const digitList=value.split(nonDigitsRegex).filter(Boolean);const fmtList=fmt.split(nonAlphaRegex).filter(Boolean);const valWoSeps=digitList.join("");let carry=0;const fmtWoSeps=fmtList.map((part,i)=>{const digitLength=(digitList[i]||"").length;const actualPart=part.slice(0,digitLength+carry);carry+=digitLength-actualPart.length;return actualPart;}).join("");result=DateTime.fromFormat(valWoSeps,fmtWoSeps,parseOpts);} 6974if(!isValidDateTime(result)){const valueDigits=value.replace(nonDigitsRegex,"");if(valueDigits.length>4){result=DateTime.fromISO(value,parseOpts);if(!isValidDateTime(result)){result=DateTime.fromSQL(value,parseOpts);}}} 6975if(!isValidDateTime(result)){throw new Error(sprintf(_t("'%s' is not a correct date or datetime"),value));} 6976return result.setZone("default");} 6977__exports.deserializeDate=deserializeDate;function deserializeDate(value){return DateTime.fromSQL(value,{zone:"default",numberingSystem:"latn"});} 6978__exports.deserializeDateTime=deserializeDateTime;function deserializeDateTime(value){return DateTime.fromSQL(value,{zone:"utc",numberingSystem:"latn"}).setZone("default");} 6979const dateCache=new WeakMap();__exports.serializeDate=serializeDate;function serializeDate(value){if(!dateCache.has(value)){dateCache.set(value,value.toFormat(SERVER_DATE_FORMAT,{numberingSystem:"latn"}));} 6980return dateCache.get(value);} 6981const dateTimeCache=new WeakMap();__exports.serializeDateTime=serializeDateTime;function serializeDateTime(value){if(!dateTimeCache.has(value)){dateTimeCache.set(value,value.setZone("utc").toFormat(SERVER_DATETIME_FORMAT,{numberingSystem:"latn"}));} 6982return dateTimeCache.get(value);} 6983return __exports;});; 6984 6985/* /web/static/src/core/l10n/localization.js */ 6986odoo.define('@web/core/l10n/localization',async function(require){'use strict';let __exports={};
6986const notReadyError=new Error("Localization parameters not ready yet. Maybe add 'localization' to your dependencies?");const localization=__exports.localization={dateFormat:notReadyError,dateTimeFormat:notReadyError,timeFormat:notReadyError,decimalPoint:notReadyError,direction:notReadyError,grouping:notReadyError,multiLang:notReadyError,thousandsSep:notReadyError,weekStart:notReadyError,};return __exports;});; 6987 6988/* /web/static/src/core/l10n/localization_service.js */ 6989odoo.define('@web/core/l10n/localization_service',async function(require){'use strict';let __exports={};const{session}=require("@web/session");const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const{strftimeToLuxonFormat}=require("@web/core/l10n/dates");const{localization}=require("@web/core/l10n/localization");const{translatedTerms,_t}=require("@web/core/l10n/translation");const{Settings}=luxon;const NUMBERING_SYSTEMS=[[/^ar-(sa|sy|001)$/i,"arab"],[/^bn/i,"beng"],[/^bo/i,"tibt"],[/^pa-in/i,"guru"],[/^ta/i,"tamldec"],[/.*/i,"latn"],];const localizationService=__exports.localizationService={dependencies:["user"],start:async(env,{user})=>{const locale=document.documentElement.getAttribute("lang")||"";const cacheHashes=session.cache_hashes||{};const translationsHash=cacheHashes.translations||new Date().getTime().toString();const lang=user.lang||locale.replace(/-/g,"_");const translationURL=session.translationURL||"/web/webclient/translations";let url=`${translationURL}/${translationsHash}`;if(lang){url+=`?lang=${lang}`;} 6990const response=await browser.fetch(url);if(!response.ok){throw new Error("Error while fetching translations");} 6991const{lang_parameters:userLocalization,modules:modules,multi_lang:multiLang,}=await response.json();const terms={};for(const addon of Object.keys(modules)){for(const message of modules[addon].messages){terms[message.id]=message.string;}} 6992Object.setPrototypeOf(translatedTerms,terms);env._t=_t;if(lang){const momentJSLangCodesMap={"sr_RS":"sr-cyrl","sr@latin":"sr-Latn-RS",};const locale=momentJSLangCodesMap[lang]||lang.replace(/_/g,"-");Settings.defaultLocale=locale;for(const[re,numberingSystem]of NUMBERING_SYSTEMS){if(re.test(locale)){Settings.defaultNumberingSystem=numberingSystem;break;}}} 6993const dateFormat=strftimeToLuxonFormat(userLocalization.date_format);const timeFormat=strftimeToLuxonFormat(userLocalization.time_format);const dateTimeFormat=`${dateFormat} ${timeFormat}`;const grouping=JSON.parse(userLocalization.grouping);Object.assign(localization,{dateFormat,timeFormat,dateTimeFormat,decimalPoint:userLocalization.decimal_point,direction:userLocalization.direction,grouping,multiLang,thousandsSep:userLocalization.thousands_sep,weekStart:userLocalization.week_start,});},};registry.category("services").add("localization",localizationService);return __exports;});; 6994 6995/* /web/static/src/core/l10n/translation.js */ 6996odoo.define('@web/core/l10n/translation',async function(require){'use strict';let __exports={};const translatedTerms=__exports.translatedTerms={};__exports._t=_t;function _t(term){return translatedTerms[term]||term;} 6997class LazyTranslatedString extends String{valueOf(){const str=super.valueOf();return _t(str);} 6998toString(){return this.valueOf();}} 6999__exports._lt=_lt;function _lt(term){return new LazyTranslatedString(term);} 7000_lt("less than a minute ago");_lt("about a minute ago");_lt("%d minutes ago");_lt("about an hour ago");_lt("%d hours ago");_lt("a day ago");_lt("%d days ago");_lt("about a month ago");_lt("%d months ago");_lt("about a year ago");_lt("%d years ago");__exports.loadLanguages=loadLanguages;async function loadLanguages(orm){if(!loadLanguages.installedLanguages){loadLanguages.installedLanguages=await orm.call("res.lang","get_installed");} 7001return loadLanguages.installedLanguages;} 7002return __exports;});; 7003 7004/* /web/static/src/core/l10n/utils.js */ 7005odoo.define('@web/core/l10n/utils',async function(require){'use strict';let __exports={};__exports.pyToJsLocale=pyToJsLocale;function pyToJsLocale(locale){if(!locale){return"";} 7006const match=locale.match(/^([a-z]+)(_[A-Z\d]+)?(@.+)?$/);if(!match){return locale;} 7007const[,language,territory,modifier]=match;const subtags=[language];if(modifier==="@latin"){subtags.push("Latn");} 7008if(territory){subtags.push(territory.slice(1));} 7009return subtags.join("-");} 7010return __exports;});; 7011 7012/* /web/static/src/core/macro.js */ 7013odoo.define('@web/core/macro',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{isVisible}=require("@web/core/utils/ui");const ACTION_HELPERS=__exports.ACTION_HELPERS={click(el,_step){el.dispatchEvent(new MouseEvent("mouseover"));el.dispatchEvent(new MouseEvent("mouseenter"));el.dispatchEvent(new MouseEvent("mousedown"));el.dispatchEvent(new MouseEvent("mouseup"));el.click();el.dispatchEvent(new MouseEvent("mouseout"));el.dispatchEvent(new MouseEvent("mouseleave"));},text(el,step){this.click(el,step);el.value=step.value;el.dispatchEvent(new InputEvent("input",{bubbles:true}));el.dispatchEvent(new InputEvent("change",{bubbles:true}));},};
7013class TimeoutError extends Error{} 7014class Macro{constructor(descr){this.name=descr.name||"anonymous";this.timeoutDuration=descr.timeout||0;this.timeout=null;this.currentIndex=0;this.interval="interval"in descr?Math.max(16,descr.interval):500;this.isComplete=false;this.steps=descr.steps;this.onStep=descr.onStep||(()=>{});this.onError=descr.onError;this.onTimeout=descr.onTimeout;this.setTimer();} 7015advance(){if(this.isComplete){return;} 7016const step=this.steps[this.currentIndex];const trigger=step.trigger;if(trigger){let el=null;if(typeof trigger==="function"){const result=this.safeCall(trigger);if(result instanceof HTMLElement){el=result;}} 7017if(typeof trigger==="string"){el=document.querySelector(trigger);} 7018if(el&&isVisible(el)){this.advanceStep(el,step);}}else{this.advanceStep(null,step);}} 7019advanceStep(el,step){this.safeCall(this.onStep,el,step);const action=step.action;if(action in ACTION_HELPERS){ACTION_HELPERS[action](el,step);}else if(typeof action==="function"){this.safeCall(action,el);} 7020this.currentIndex++;if(this.currentIndex===this.steps.length){this.isComplete=true;browser.clearTimeout(this.timeout);}else{this.setTimer();this.advance();}} 7021safeCall(fn,...args){if(this.isComplete){return;} 7022try{return fn(...args);}catch(e){this.handleError(e);}} 7023setTimer(){if(this.timeoutDuration){browser.clearTimeout(this.timeout);this.timeout=browser.setTimeout(()=>{if(this.onTimeout){const index=this.currentIndex;const step=this.steps[index];this.safeCall(this.onTimeout,step,index);}else{const error=new TimeoutError("Step timeout");this.handleError(error);}},this.timeoutDuration);}} 7024handleError(error){this.isComplete=true;browser.clearTimeout(this.timeout);if(this.onError){const index=this.currentIndex;const step=this.steps[index];this.onError(error,step,index);}else{console.error(error);}}} 7025const MacroEngine=__exports.MacroEngine=class MacroEngine{constructor(target=document.body){this.isRunning=false;this.timeout=null;this.target=target;this.interval=Infinity;this.macros=new Set();this.observer=new MutationObserver(this.delayedCheck.bind(this));} 7026async activate(descr){await Promise.resolve();const macro=new Macro(descr);this.interval=Math.min(this.interval,macro.interval);this.macros.add(macro);this.start();} 7027start(){if(!this.isRunning){this.isRunning=true;this.observer.observe(this.target,{attributes:true,childList:true,subtree:true,characterData:true,});} 7028this.delayedCheck();} 7029stop(){if(this.isRunning){this.isRunning=false;browser.clearTimeout(this.timeout);this.timeout=null;this.observer.disconnect();}} 7030delayedCheck(){if(this.timeout){browser.clearTimeout(this.timeout);} 7031this.timeout=browser.setTimeout(this.advanceMacros.bind(this),this.interval);} 7032advanceMacros(){const toDelete=[];for(const macro of this.macros){macro.advance();if(macro.isComplete){toDelete.push(macro);}} 7033if(toDelete.length){for(const macro of toDelete){this.macros.delete(macro);} 7034this.interval=Infinity;for(const macro of this.macros){this.interval=Math.min(this.interval,macro.interval);}} 7035if(this.macros.size===0){this.stop();}}} 7036return __exports;});; 7037 7038/* /web/static/src/core/main_components_container.js */ 7039odoo.define('@web/core/main_components_container',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{ErrorHandler}=require("@web/core/utils/components");const{useBus}=require("@web/core/utils/hooks");const{Component,xml}=require("@odoo/owl");const MainComponentsContainer=__exports.MainComponentsContainer=class MainComponentsContainer extends Component{setup(){const mainComponents=registry.category("main_components");this.Components=mainComponents.getEntries();useBus(mainComponents,"UPDATE",()=>{this.Components=mainComponents.getEntries();this.render();});} 7040handleComponentError(error,C){this.Components.splice(this.Components.indexOf(C),1);this.render();Promise.resolve().then(()=>{throw error;});}} 7041MainComponentsContainer.template=xml` 7042<div class="o-main-components-container"> 7043 <t t-foreach="Components" t-as="C" t-key="C[0]"> 7044 <ErrorHandler onError="error => this.handleComponentError(error, C)"> 7045 <t t-component="C[1].Component" t-props="C[1].props"/> 7046 </ErrorHandler> 7047 </t> 7048</div> 7049`;MainComponentsContainer.components={ErrorHandler};return __exports;});; 7050 7051/* /web/static/src/core/model_field_selector/model_field_hook.js */ 7052odoo.define('@web/core/model_field_selector/model_field_hook',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");__exports.useModelField=useModelField;function useModelField(){const view=useService("view");
7052const loadModelFields=(resModel)=>{return view.loadFields(resModel,{attributes:["store","searchable","type","string","relation","selection","related",],});};const loadChain=async(resModel,fieldName)=>{const fieldNameChain=fieldName.length?fieldName.split("."):[];let currentNode={resModel,field:null,};const chain=[currentNode];for(const fieldName of fieldNameChain){const fieldsInfo=await loadModelFields(currentNode.resModel);Object.assign(currentNode,{field:{...fieldsInfo[fieldName],name:fieldName},});if(fieldsInfo[fieldName].relation){currentNode={resModel:fieldsInfo[fieldName].relation,field:null,};chain.push(currentNode);}} 7053return chain;};return{loadModelFields,loadChain,};} 7054return __exports;});; 7055 7056/* /web/static/src/core/model_field_selector/model_field_selector.js */ 7057odoo.define('@web/core/model_field_selector/model_field_selector',async function(require){'use strict';let __exports={};const{useModelField}=require("@web/core/model_field_selector/model_field_hook");const{useUniquePopover}=require("@web/core/model_field_selector/unique_popover_hook");const{ModelFieldSelectorPopover}=require("@web/core/model_field_selector/model_field_selector_popover");const{Component,onWillStart,onWillUpdateProps}=require("@odoo/owl");const ModelFieldSelector=__exports.ModelFieldSelector=class ModelFieldSelector extends Component{setup(){this.popover=useUniquePopover();this.modelField=useModelField();this.chain=[];onWillStart(async()=>{this.chain=await this.loadChain(this.props.resModel,this.props.fieldName);});onWillUpdateProps(async(nextProps)=>{this.chain=await this.loadChain(nextProps.resModel,nextProps.fieldName);});} 7058get fieldNameChain(){return this.getFieldNameChain(this.props.fieldName);} 7059getFieldNameChain(fieldName){return fieldName.length?fieldName.split("."):[];} 7060async loadChain(resModel,fieldName){if("01".includes(fieldName)){return[{resModel,field:{string:fieldName}}];} 7061const fieldNameChain=this.getFieldNameChain(fieldName);let currentNode={resModel,field:null,};const chain=[currentNode];for(const fieldName of fieldNameChain){const fieldsInfo=await this.modelField.loadModelFields(currentNode.resModel);Object.assign(currentNode,{field:{...fieldsInfo[fieldName],name:fieldName},});if(fieldsInfo[fieldName].relation){currentNode={resModel:fieldsInfo[fieldName].relation,field:null,};chain.push(currentNode);}} 7062return chain;} 7063update(chain){this.props.update(chain.join("."));} 7064onFieldSelectorClick(ev){if(this.props.readonly){return;} 7065this.popover.add(ev.currentTarget,this.constructor.components.Popover,{chain:this.chain,update:this.update.bind(this),showSearchInput:this.props.showSearchInput,isDebugMode:this.props.isDebugMode,loadChain:this.loadChain.bind(this),filter:this.props.filter,followRelations:this.props.followRelations,},{closeOnClickAway:true,popoverClass:"o_popover_field_selector",});}} 7066Object.assign(ModelFieldSelector,{template:"web._ModelFieldSelector",components:{Popover:ModelFieldSelectorPopover,},props:{fieldName:String,resModel:String,readonly:{type:Boolean,optional:true},showSearchInput:{type:Boolean,optional:true},isDebugMode:{type:Boolean,optional:true},update:{type:Function,optional:true},filter:{type:Function,optional:true},followRelations:{type:Boolean,optional:true},},defaultProps:{readonly:true,isDebugMode:false,showSearchInput:true,update:()=>{},filter:()=>true,followRelations:true,},});return __exports;});; 7067 7068/* /web/static/src/core/model_field_selector/model_field_selector_popover.js */ 7069odoo.define('@web/core/model_field_selector/model_field_selector_popover',async function(require){'use strict';let __exports={};const{sortBy}=require("@web/core/utils/arrays");const{useModelField}=require("@web/core/model_field_selector/model_field_hook");const{fuzzyLookup}=require("@web/core/utils/search");const{useAutofocus}=require("@web/core/utils/hooks");const{Component,onWillStart}=require("@odoo/owl");const ModelFieldSelectorPopover=__exports.ModelFieldSelectorPopover=class ModelFieldSelectorPopover extends Component{setup(){this.chain=Array.from(this.props.chain);this.modelField=useModelField();this.unfilteredFields={};this.fields={};this.fieldKeys=[];this.currentActiveFieldId=0;this.searchValue="";this.defaultValue="";this.isDefaultValueVisible=false;this.fullFieldName=this.fieldNameChain.join(".");if(!this.env.isSmall){useAutofocus();useAutofocus({refName:'autofocusDefaultValue',selectAll:true});} 7070onWillStart(async()=>{await this.loadFields();});} 7071get currentActiveField(){return this.fieldKeys[this.currentActiveFieldId];} 7072get currentNode(){return this.chain[this.chain.length-1];} 7073get currentFieldName(){const nodes=this.chain.filter((node)=>node.field);return nodes.length?nodes[nodes.length-1].field.string:"";} 7074get fieldNameChain(){return this.chain.filter((node)=>node.field).map((node)=>node.field.name);} 7075async loadFields(){this.unfilteredFields=await this.modelField.loadModelFields(this.currentNode.resModel);this.fields={...this.unfilteredFields};this.fieldKeys=this.sortedKeys(this.fields);for(let key of this.fieldKeys){const field=this.fields[key];if(!field.searchable||!this.props.filter(field)){delete this.fields[key];}} 7076this.fieldKeys=this.sortedKeys(this.fields);} 7077sortedKeys(obj){const keys=Object.keys(obj);return sortBy(keys,(key)=>obj[key].string);}
7078async update(){const fieldNameChain=this.fieldNameChain;this.fullFieldName=fieldNameChain.join(".");await this.props.update(fieldNameChain);await this.loadFields();this.render();} 7079async onInputKeydown(ev){switch(ev.key){case"ArrowUp":ev.preventDefault();ev.stopPropagation();if(this.currentActiveFieldId>0){this.currentActiveFieldId--;await this.render();} 7080break;case"ArrowDown":ev.preventDefault();ev.stopPropagation();if(this.currentActiveFieldId<this.fieldKeys.length-1){this.currentActiveFieldId++;await this.render();} 7081break;case"ArrowLeft":ev.preventDefault();ev.stopPropagation();this.onPreviousBtnClick();break;case"Escape":ev.preventDefault();ev.stopPropagation();this.props.close();break;case"Enter":case"ArrowRight":ev.preventDefault();ev.stopPropagation();if(this.isDefaultValueVisible){this.selectDefaultValue(true);}else{const field={...this.fields[this.currentActiveField],name:this.currentActiveField} 7082this.onFieldSelected(field);} 7083break;}} 7084onSearch(ev){this.searchValue=ev.target.value;let fieldKeys=this.sortedKeys(this.fields);if(this.searchValue){fieldKeys=fuzzyLookup(this.searchValue,fieldKeys,(key)=>this.fields[key].string);} 7085this.fieldKeys=fieldKeys;this.render();} 7086onDefaultValue(ev){this.defaultValue=ev.target.value;this.render();} 7087onPreviousBtnClick(){this.searchValue="";if(this.currentNode.field===null){this.chain.pop();} 7088this.currentNode.field=null;this.update();} 7089onFieldSelected(field){this.searchValue="";this.currentActiveFieldId=0;this.currentNode.field=field;if(field.relation&&this.props.followRelations){this.chain.push({resModel:field.relation,field:null,});this.update();}else if(this.props.needDefaultValue){this.isDefaultValueVisible=true;this.render();this.update();}else{this.update();this.props.close();this.props.validate(this.fieldNameChain,this.defaultValue);}} 7090selectDefaultValue(acceptDefaultValue){if(!acceptDefaultValue){this.defaultValue="";} 7091this.props.close();this.update();this.props.validate(this.fieldNameChain,this.defaultValue);} 7092async onFieldNameChange(ev){this.fullFieldName=ev.target.value.replace(/\s+/g,"");const{resModel}=this.props.chain[0];try{this.chain=await this.props.loadChain(resModel,this.fullFieldName);this.update();}catch(_error){this.chain=[{resModel,field:null}];await this.props.update([]);this.render();}}} 7093ModelFieldSelectorPopover.defaultProps={validate:()=>{},needDefaultValue:false,isDebugMode:false,followRelations:true,};ModelFieldSelectorPopover.props={chain:Array,update:Function,showSearchInput:Boolean,isDebugMode:{type:Boolean,optional:true},loadChain:Function,filter:Function,close:Function,followRelations:{type:Boolean,optional:true},needDefaultValue:{type:Boolean,optional:true},validate:{type:Function,optional:true},};ModelFieldSelectorPopover.template="web.ModelFieldSelectorPopover";return __exports;});; 7094 7095/* /web/static/src/core/model_field_selector/unique_popover_hook.js */ 7096odoo.define('@web/core/model_field_selector/unique_popover_hook',async function(require){'use strict';let __exports={};const{usePopover}=require("@web/core/popover/popover_hook");__exports.useUniquePopover=useUniquePopover;function useUniquePopover(){const popover=usePopover();let remove=null;return Object.assign(Object.create(popover),{add(target,component,props,options){if(remove){remove();} 7097remove=popover.add(target,component,props,options);return()=>{remove();remove=null;};},});} 7098return __exports;});; 7099 7100/* /web/static/src/core/model_selector/model_selector.js */ 7101odoo.define('@web/core/model_selector/model_selector',async function(require){'use strict';let __exports={};const{AutoComplete}=require("@web/core/autocomplete/autocomplete");const{useService}=require("@web/core/utils/hooks");const{fuzzyLookup}=require("@web/core/utils/search");const{_t}=require("@web/core/l10n/translation");const{Component,onWillStart}=require("@odoo/owl");const ModelSelector=__exports.ModelSelector=class ModelSelector extends Component{setup(){this.orm=useService("orm");onWillStart(async()=>{if(!this.props.models){this.models=await this._fetchAvailableModels();}else{this.models=await this.orm.call("ir.model","display_name_for",[this.props.models,]);} 7102this.models=this.models.map((record)=>({label:record.display_name,technical:record.model,classList:{[`o_model_selector_${record.model}`]:1,},}));});} 7103get placeholder(){return _t("Search a Model...");} 7104get sources(){return[this.optionsSource];} 7105get optionsSource(){return{placeholder:_t("Loading..."),options:this.loadOptionsSource.bind(this),};} 7106onSelect(option){this.props.onModelSelected({label:option.label,technical:option.technical,});} 7107filterModels(name){if(!name){return this.models.slice(0,8);} 7108return fuzzyLookup(name,this.models,(model)=>model.technical+model.label).slice(0,8);} 7109loadOptionsSource(request){const options=this.filterModels(request);if(!options.length){options.push({label:_t("No records"),classList:"o_m2o_no_result",unselectable:true,});} 7110return options;} 7111async _fetchAvailableModels(){const result=await this.orm.call("ir.model","get_available_models");return result||[];}} 7112ModelSelector.template="web.ModelSelector";ModelSelector.components={AutoComplete};ModelSelector.props={onModelSelected:Function,id:{type:String,optional:true},value:{type:String,optional:true},models:{type:Array,optional:true},};return __exports;});; 7113 7114/* /web/static/src/core/network/download.js */ 7115odoo.define('@web/core/network/download',async function(require){'use strict';let __exports={};const{_lt}=require("@web/core/l10n/translation");const{makeErrorFromResponse,ConnectionLostError}=require("@web/core/network/rpc_service");const{browser}=require("@web/core/browser/browser");const HEX_ESCAPE_REPLACE_REGEXP=/%([0-9A-Fa-f]{2})/g;const NON_LATIN1_REGEXP=/[^\x20-\x7e\xa0-\xff]/g;
7115const QESC_REGEXP=/\\([\u0000-\u007f])/g;const PARAM_REGEXP=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;const EXT_VALUE_REGEXP=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;const DISPOSITION_TYPE_REGEXP=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function decodefield(str){const match=EXT_VALUE_REGEXP.exec(str);if(!match){throw new TypeError("invalid extended field value");} 7116const charset=match[1].toLowerCase();const encoded=match[2];switch(charset){case"iso-8859-1":return encoded.replace(HEX_ESCAPE_REPLACE_REGEXP,pdecode).replace(NON_LATIN1_REGEXP,"?");case"utf-8":return decodeURIComponent(encoded);default:throw new TypeError("unsupported charset in extended field");}} 7117function parse(string){if(!string||typeof string!=="string"){throw new TypeError("argument string is required");} 7118let match=DISPOSITION_TYPE_REGEXP.exec(string);if(!match){throw new TypeError("invalid type format");} 7119let index=match[0].length;const type=match[1].toLowerCase();let key;const names=[];const params={};let value;index=PARAM_REGEXP.lastIndex=match[0].substr(-1)===";"?index-1:index;while((match=PARAM_REGEXP.exec(string))){if(match.index!==index){throw new TypeError("invalid parameter format");} 7120index+=match[0].length;key=match[1].toLowerCase();value=match[2];if(names.indexOf(key)!==-1){throw new TypeError("invalid duplicate parameter");} 7121names.push(key);if(key.indexOf("*")+1===key.length){key=key.slice(0,-1);value=decodefield(value);params[key]=value;continue;} 7122if(typeof params[key]==="string"){continue;} 7123if(value[0]==='"'){value=value.substr(1,value.length-2).replace(QESC_REGEXP,"$1");} 7124params[key]=value;} 7125if(index!==-1&&index!==string.length){throw new TypeError("invalid parameter format");} 7126return new ContentDisposition(type,params);} 7127function pdecode(str,hex){return String.fromCharCode(parseInt(hex,16));} 7128function ContentDisposition(type,parameters){this.type=type;this.parameters=parameters;} 7129function _download(data,filename,mimetype){let self=window,defaultMime="application/octet-stream",mimeType=mimetype||defaultMime,payload=data,url=!filename&&!mimetype&&payload,anchor=document.createElement("a"),toString=function(a){return String(a);},myBlob=self.Blob||self.MozBlob||self.WebKitBlob||toString,fileName=filename||"download",blob,reader;myBlob=myBlob.call?myBlob.bind(self):Blob;if(String(this)==="true"){payload=[payload,mimeType];mimeType=payload[0];payload=payload[1];} 7130if(url&&url.length<2048){fileName=url.split("/").pop().split("?")[0];anchor.href=url;if(anchor.href.indexOf(url)!==-1){let ajax=new XMLHttpRequest();ajax.open("GET",url,true);configureBlobDownloadXHR(ajax);setTimeout(()=>{ajax.send();},0);return ajax;}} 7131if(/^data:[\w+\-]+\/[\w+\-]+[,;]/.test(payload)){if(payload.length>1024*1024*1.999&&myBlob!==toString){payload=dataUrlToBlob(payload);mimeType=payload.type||defaultMime;}else{return navigator.msSaveBlob?navigator.msSaveBlob(dataUrlToBlob(payload),fileName):saver(payload);}} 7132blob=payload instanceof myBlob?payload:new myBlob([payload],{type:mimeType});function dataUrlToBlob(strUrl){let parts=strUrl.split(/[:;,]/),type=parts[1],decoder=parts[2]==="base64"?atob:decodeURIComponent,binData=decoder(parts.pop()),mx=binData.length,i=0,uiArr=new Uint8Array(mx);for(i;i<mx;++i){uiArr[i]=binData.charCodeAt(i);} 7133return new myBlob([uiArr],{type});} 7134function saver(url,winMode){if("download"in anchor){anchor.href=url;anchor.setAttribute("download",fileName);anchor.className="download-js-link";anchor.innerText=_lt("downloading...");anchor.style.display="none";document.body.appendChild(anchor);setTimeout(()=>{anchor.click();document.body.removeChild(anchor);if(winMode===true){setTimeout(()=>{self.URL.revokeObjectURL(anchor.href);},250);}},66);return true;} 7135if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)){url=url.replace(/^data:([\w\/\-+]+)/,defaultMime);if(!window.open(url)){if(confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")){location.href=url;}} 7136return true;} 7137let f=document.createElement("iframe");document.body.appendChild(f);if(!winMode){url=`data:${url.replace(/^data:([\w\/\-+]+)/, defaultMime)}`;} 7138f.src=url;setTimeout(()=>{document.body.removeChild(f);},333);} 7139if(navigator.msSaveBlob){return navigator.msSaveBlob(blob,fileName);} 7140if(self.URL){saver(self.URL.createObjectURL(blob),true);}else{if(typeof blob==="string"||blob.constructor===toString){try{return saver(`data:${mimeType};base64,${self.btoa(blob)}`);}catch(_y){return saver(`data:${mimeType},${encodeURIComponent(blob)}`);}} 7141reader=new FileReader();reader.onload=function(){saver(this.result);};
7141reader.readAsDataURL(blob);} 7142return true;} 7143__exports.downloadFile=downloadFile;function downloadFile(data,filename,mimetype){return downloadFile._download(data,filename,mimetype)} 7144downloadFile._download=_download;__exports.download=download;function download(options){return download._download(options);} 7145download._download=(options)=>{return new Promise((resolve,reject)=>{const xhr=new browser.XMLHttpRequest();let data;if(Object.prototype.hasOwnProperty.call(options,"form")){xhr.open(options.form.method,options.form.action);data=new FormData(options.form);}else{xhr.open("POST",options.url);data=new FormData();Object.entries(options.data).forEach((entry)=>{const[key,value]=entry;data.append(key,value);});} 7146data.append("token","dummy-because-api-expects-one");if(odoo.csrf_token){data.append("csrf_token",odoo.csrf_token);} 7147configureBlobDownloadXHR(xhr,{onSuccess:resolve,onFailure:reject,});xhr.send(data);});};__exports.configureBlobDownloadXHR=configureBlobDownloadXHR;function configureBlobDownloadXHR(xhr,{onSuccess=()=>{},onFailure=()=>{}}={}){xhr.responseType="blob";xhr.onload=()=>{const mimetype=xhr.response.type;const header=(xhr.getResponseHeader("Content-Disposition")||"").replace(/;$/,"");const filename=header?parse(header).parameters.filename:null;if(xhr.status===200&&(mimetype!=="text/html"||filename)){_download(xhr.response,filename,mimetype);onSuccess(filename);}else if(xhr.status===502){onFailure(new ConnectionLostError());}else{const decoder=new FileReader();decoder.onload=()=>{const contents=decoder.result;const doc=new DOMParser().parseFromString(contents,"text/html");const nodes=doc.body.children.length===0?[doc.body]:doc.body.children;let error;try{const node=nodes[1]||nodes[0];error=JSON.parse(node.textContent);}catch{error={message:"Arbitrary Uncaught Python Exception",data:{debug:`${xhr.status}`+`\n`+`${nodes.length > 0 ? nodes[0].textContent : ""} 7148 ${nodes.length > 1 ? nodes[1].textContent : ""}`,},};} 7149error=makeErrorFromResponse(error);onFailure(error);};decoder.readAsText(xhr.response);}};xhr.onerror=()=>{onFailure(new ConnectionLostError());};} 7150return __exports;});; 7151 7152/* /web/static/src/core/network/http_service.js */ 7153odoo.define('@web/core/network/http_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");function checkResponseStatus(response){if(response.status===502){throw new Error("Failed to fetch");}} 7154const httpService=__exports.httpService={start(){return{async get(route,readMethod="json"){const response=await fetch(route,{method:"GET"});checkResponseStatus(response);return response[readMethod]();},async post(route,params={},readMethod="json"){const formData=new FormData();for(const key in params){const value=params[key];if(Array.isArray(value)&&value.length){for(const val of value){formData.append(key,val);}}else{formData.append(key,value);}} 7155const info={body:formData,method:"POST",};const response=await fetch(route,info);checkResponseStatus(response);return response[readMethod]();},};},};registry.category("services").add("http",httpService);return __exports;});; 7156 7157/* /web/static/src/core/network/rpc_service.js */ 7158odoo.define('@web/core/network/rpc_service',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const RPCError=__exports.RPCError=class RPCError extends Error{constructor(){super(...arguments);this.name="RPC_ERROR";this.type="server";this.code=null;this.data=null;this.exceptionName=null;this.subType=null;}} 7159const ConnectionLostError=__exports.ConnectionLostError=class ConnectionLostError extends Error{} 7160const ConnectionAbortedError=__exports.ConnectionAbortedError=class ConnectionAbortedError extends Error{} 7161const HTTPError=__exports.HTTPError=class HTTPError extends Error{} 7162__exports.makeErrorFromResponse=makeErrorFromResponse;function makeErrorFromResponse(reponse){const{code,data:errorData,message,type:subType}=reponse;const error=new RPCError();error.exceptionName=errorData.name;error.subType=subType;error.data=errorData;error.message=message;error.code=code;return error;} 7163__exports.jsonrpc=jsonrpc;function jsonrpc(env,rpcId,url,params,settings={}){const bus=env.bus;const XHR=browser.XMLHttpRequest;const data={id:rpcId,jsonrpc:"2.0",method:"call",params:params,};const request=settings.xhr||new XHR();let rejectFn;const promise=new Promise((resolve,reject)=>{rejectFn=reject;if(!settings.silent){bus.trigger("RPC:REQUEST",data.id);} 7164request.addEventListener("load",()=>{if(request.status===502){if(!settings.silent){bus.trigger("RPC:RESPONSE",data.id);} 7165reject(new ConnectionLostError());return;} 7166let params;try{params=JSON.parse(request.response);}catch(_){if(!settings.silent){bus.trigger("RPC:RESPONSE",data.id);} 7167return reject(new ConnectionLostError());} 7168const{error:responseError,result:responseResult}=params;if(!settings.silent){bus.trigger("RPC:RESPONSE",data.id);} 7169if(!responseError){return resolve(responseResult);} 7170const error=makeErrorFromResponse(responseError);reject(error);});request.addEventListener("error",()=>{if(!settings.silent){bus.trigger("RPC:RESPONSE",data.id);} 7171reject(new ConnectionLostError());});request.open("POST",url);const headers=settings.headers||{};headers["Content-Type"]="application/json";for(let[header,value]of Object.entries(headers)){request.setRequestHeader(header,value);} 7172request.send(JSON.stringify(data));});promise.abort=function(rejectError=true){if(request.abort){request.abort();} 7173if(!settings.silent){bus.trigger("RPC:RESPONSE",data.id);} 7174if(rejectError){rejectFn(new ConnectionAbortedError("XmlHttpRequestError abort"));}};return promise;} 7175const rpcService=__exports.rpcService={async:true,start(env){let rpcId=0;return function rpc(route,params={},settings){return jsonrpc(env,rpcId++,route,params,settings);};},};registry.category("services").add("rpc",rpcService);return __exports;});; 7176 7177/* /web/static/src/core/notebook/notebook.js */ 7178odoo.define('@web/core/notebook/notebook',async function(require){'use strict';let __exports={};const{scrollTo}=require("@web/core/utils/scrolling");const{Component,onWillDestroy,onWillUpdateProps,useEffect,useRef,useState}=require("@odoo/owl");const Notebook=__exports.Notebook=class Notebook extends Component{setup(){this.activePane=useRef("activePane");this.anchorTarget=null;this.pages=this.computePages(this.props);this.state=useState({currentPage:null});this.state.currentPage=this.computeActivePage(this.props.defaultPage,true);const onAnchorClicked=this.onAnchorClicked.bind(this);this.env.bus.addEventListener("SCROLLER:ANCHOR_LINK_CLICKED",onAnchorClicked);useEffect(()=>{this.props.onPageUpdate(this.state.currentPage);if(this.anchorTarget){const matchingEl=this.activePane.el.querySelector(`#${this.anchorTarget}`);scrollTo(matchingEl,{isAnchor:true});this.anchorTarget=null;}},()=>[this.state.currentPage]);onWillUpdateProps((nextProps)=>{const activateDefault=this.props.defaultPage!==nextProps.defaultPage||!this.defaultVisible;this.pages=this.computePages(nextProps);this.state.currentPage=this.computeActivePage(nextProps.defaultPage,activateDefault);});onWillDestroy(()=>{this.env.bus.removeEventListener("SCROLLER:ANCHOR_LINK_CLICKED",onAnchorClicked);});} 7179get navItems(){return this.pages.filter((e)=>
7179e[1].isVisible);} 7180get page(){const page=this.pages.find((e)=>e[0]===this.state.currentPage)[1];return page.Component&&page;} 7181onAnchorClicked(ev){if(!this.props.anchors){return;} 7182const id=ev.detail.detail.id.substring(1);if(this.props.anchors[id]){if(this.state.currentPage!==this.props.anchors[id].target){ev.preventDefault();ev.detail.detail.originalEv.preventDefault();this.anchorTarget=id;this.state.currentPage=this.props.anchors[id].target;}}} 7183activatePage(pageIndex){this.state.currentPage=pageIndex;} 7184computePages(props){if(!props.slots&&!props.pages){return[];} 7185if(props.pages){for(const page of props.pages){page.isVisible=true;}} 7186const pages=[];const pagesWithIndex=[];for(const[k,v]of Object.entries({...props.slots,...props.pages})){const id=v.id||k;if(v.index){pagesWithIndex.push([id,v]);}else{pages.push([id,v]);}} 7187for(const page of pagesWithIndex){pages.splice(page[1].index,0,page);} 7188return pages;} 7189computeActivePage(defaultPage,activateDefault){if(!this.pages.length){return null;} 7190const pages=this.pages.filter((e)=>e[1].isVisible).map((e)=>e[0]);if(defaultPage){if(!pages.includes(defaultPage)){this.defaultVisible=false;}else{this.defaultVisible=true;if(activateDefault){return defaultPage;}}} 7191const current=this.state.currentPage;if(!current||(current&&!pages.includes(current))){return pages[0];} 7192return current;}} 7193Notebook.template="web.Notebook";Notebook.defaultProps={className:"",orientation:"horizontal",onPageUpdate:()=>{},};Notebook.props={slots:{type:Object,optional:true},pages:{type:Object,optional:true},class:{optional:true},className:{type:String,optional:true},anchors:{type:Object,optional:true},defaultPage:{type:String,optional:true},orientation:{type:String,optional:true},onPageUpdate:{type:Function,optional:true},};return __exports;});; 7194 7195/* /web/static/src/core/notifications/notification.js */ 7196odoo.define('@web/core/notifications/notification',async function(require){'use strict';let __exports={};const{Component}=require("@odoo/owl");const Notification=__exports.Notification=class Notification extends Component{} 7197Notification.template="web.NotificationWowl";Notification.props={message:{validate:(m)=>{return(typeof m==="string"||(typeof m==="object"&&typeof m.toString==="function"));},},title:{type:[String,Boolean,{toString:Function}],optional:true},type:{type:String,optional:true,validate:(t)=>["warning","danger","success","info"].includes(t),},className:{type:String,optional:true},buttons:{type:Array,element:{type:Object,shape:{name:{type:String},icon:{type:String,optional:true},primary:{type:Boolean,optional:true},onClick:Function,},},optional:true,},close:{type:Function},};Notification.defaultProps={buttons:[],className:"",type:"warning",};return __exports;});; 7198 7199/* /web/static/src/core/notifications/notification_container.js */ 7200odoo.define('@web/core/notifications/notification_container',async function(require){'use strict';let __exports={};const{Notification}=require("@web/core/notifications/notification");const{Transition}=require("@web/core/transition");const{Component,xml,useState}=require("@odoo/owl");const NotificationContainer=__exports.NotificationContainer=class NotificationContainer extends Component{setup(){this.notifications=useState(this.props.notifications);}} 7201NotificationContainer.template=xml` 7202 <div class="o_notification_manager"> 7203 <t t-foreach="notifications" t-as="notification" t-key="notification"> 7204 <Transition leaveDuration="0" name="'o_notification_fade'" t-slot-scope="transition"> 7205 <Notification t-props="notification_value.props" className="(notification_value.props.className || '') + ' ' + transition.className"/> 7206 </Transition> 7207 </t> 7208 </div>`;NotificationContainer.components={Notification,Transition};return __exports;});; 7209 7210/* /web/static/src/core/notifications/notification_service.js */ 7211odoo.define('@web/core/notifications/notification_service',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const{NotificationContainer}=require("@web/core/notifications/notification_container");const{reactive}=require("@odoo/owl");const AUTOCLOSE_DELAY=4000;const notificationService=__exports.notificationService={start(){let notifId=0;const notifications=reactive({});registry.category("main_components").add("NotificationContainer",{Component:NotificationContainer,props:{notifications},});function add(message,options={}){const id=++notifId;const closeFn=()=>close(id);const props=Object.assign({},options,{message,close:closeFn});const sticky=props.sticky;delete props.sticky;delete props.onClose;const notification={id,props,onClose:options.onClose,};notifications[id]=notification;if(!sticky){browser.setTimeout(closeFn,AUTOCLOSE_DELAY);} 7212return closeFn;}
7213function close(id){if(notifications[id]){const notification=notifications[id];if(notification.onClose){notification.onClose();} 7214delete notifications[id];}} 7215return{add};},};registry.category("services").add("notification",notificationService);return __exports;});; 7216 7217/* /web/static/src/core/orm_service.js */ 7218odoo.define('@web/core/orm_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const x2ManyCommands=__exports.x2ManyCommands={CREATE:0,create(virtualID,values){delete values.id;return[x2ManyCommands.CREATE,virtualID||false,values];},UPDATE:1,update(id,values){delete values.id;return[x2ManyCommands.UPDATE,id,values];},DELETE:2,delete(id){return[x2ManyCommands.DELETE,id,false];},FORGET:3,forget(id){return[x2ManyCommands.FORGET,id,false];},LINK_TO:4,linkTo(id){return[x2ManyCommands.LINK_TO,id,false];},DELETE_ALL:5,deleteAll(){return[x2ManyCommands.DELETE_ALL,false,false];},REPLACE_WITH:6,replaceWith(ids){return[x2ManyCommands.REPLACE_WITH,false,ids];},};function validateModel(value){if(typeof value!=="string"||value.length===0){throw new Error(`Invalid model name: ${value}`);}} 7219function validatePrimitiveList(name,type,value){if(!Array.isArray(value)||value.some((val)=>typeof val!==type)){throw new Error(`Invalid ${name} list: ${value}`);}} 7220function validateObject(name,obj){if(typeof obj!=="object"||obj===null||Array.isArray(obj)){throw new Error(`${name} should be an object`);}} 7221function validateArray(name,array){if(!Array.isArray(array)){throw new Error(`${name} should be an array`);}} 7222const ORM=__exports.ORM=class ORM{constructor(rpc,user){this.rpc=rpc;this.user=user;this._silent=false;} 7223get silent(){return Object.assign(Object.create(this),{_silent:true});} 7224call(model,method,args=[],kwargs={}){validateModel(model);const url=`/web/dataset/call_kw/${model}/${method}`;const fullContext=Object.assign({},this.user.context,kwargs.context||{});const fullKwargs=Object.assign({},kwargs,{context:fullContext});const params={model,method,args,kwargs:fullKwargs,};return this.rpc(url,params,{silent:this._silent});} 7225create(model,records,kwargs={}){validateArray("records",records);for(const record of records){validateObject("record",record);} 7226return this.call(model,"create",records,kwargs);} 7227nameGet(model,ids,kwargs={}){validatePrimitiveList("ids","number",ids);if(!ids.length){return Promise.resolve([]);} 7228return this.call(model,"name_get",[ids],kwargs);} 7229read(model,ids,fields,kwargs={}){validatePrimitiveList("ids","number",ids);if(fields){validatePrimitiveList("fields","string",fields);} 7230if(!ids.length){return Promise.resolve([]);} 7231return this.call(model,"read",[ids,fields],kwargs);} 7232readGroup(model,domain,fields,groupby,kwargs={}){validateArray("domain",domain);validatePrimitiveList("fields","string",fields);validatePrimitiveList("groupby","string",groupby);return this.call(model,"read_group",[],{...kwargs,domain,fields,groupby});} 7233search(model,domain,kwargs={}){validateArray("domain",domain);return this.call(model,"search",[domain],kwargs);} 7234searchRead(model,domain,fields,kwargs={}){validateArray("domain",domain);if(fields){validatePrimitiveList("fields","string",fields);} 7235return this.call(model,"search_read",[],{...kwargs,domain,fields});} 7236searchCount(model,domain,kwargs={}){validateArray("domain",domain);return this.call(model,"search_count",[domain],kwargs);} 7237unlink(model,ids,kwargs={}){validatePrimitiveList("ids","number",ids);if(!ids.length){return true;} 7238return this.call(model,"unlink",[ids],kwargs);} 7239webReadGroup(model,domain,fields,groupby,kwargs={}){validateArray("domain",domain);validatePrimitiveList("fields","string",fields);validatePrimitiveList("groupby","string",groupby);return this.call(model,"web_read_group",[],{...kwargs,groupby,domain,fields,});} 7240webSearchRead(model,domain,fields,kwargs={}){validateArray("domain",domain);validatePrimitiveList("fields","string",fields);return this.call(model,"web_search_read",[],{...kwargs,domain,fields});} 7241write(model,ids,data,kwargs={}){validatePrimitiveList("ids","number",ids);validateObject("data",data);return this.call(model,"write",[ids,data],kwargs);}} 7242const ormService=__exports.ormService={dependencies:["rpc","user"],async:["call","create","nameGet","read","readGroup","search","searchRead","unlink","webSearchRead","write",],start(env,{rpc,user}){return new ORM(rpc,user);},};registry.category("services").add("orm",ormService);return __exports;});; 7243 7244/* /web/static/src/core/pager/pager.js */ 7245odoo.define('@web/core/pager/pager',async function(require){'use strict';let __exports={};const{useAutofocus}=require("@web/core/utils/hooks");const{clamp}=require("@web/core/utils/numbers");const{Component,useExternalListener,useState}=require("@odoo/owl");const Pager=__exports.Pager=class Pager extends Component{setup(){this.state=useState({isEditing:false,isDisabled:false,});this.inputRef=useAutofocus();useExternalListener(document,"mousedown",this.onClickAway,{capture:true});} 7246get minimum(){return this.props.offset+1;} 7247get maximum(){return Math.min(this.props.offset+this.props.limit,this.props.total);} 7248get value(){const parts=[this.minimum];if(this.props.limit>1){parts.push(this.maximum);} 7249return parts.join("-");} 7250get isSinglePage(){return!this.props.updateTotal&&this.minimum===1&&this.maximum===this.props.total;} 7251async navigate(direction){let minimum=this.props.offset+this.props.limit*direction;let total=this.props.total;if(this.props.updateTotal&&minimum<0){total=await this.props.updateTotal();} 7252if(minimum>=total){if(!this.props.updateTotal){minimum=0;}}else if(minimum<0&&this.props.limit===1){minimum=total-1;}else if(minimum<0&&this.props.limit>1){minimum=total-(total%this.props.limit||this.props.limit);} 7253this.update(minimum,this.props.limit,true);} 7254async parse(value){let[minimum,maximum]=value.trim().split(/\s*[-\s,;]\s*/);minimum=parseInt(minimum,10);maximum=maximum?parseInt(maximum,10):minimum;if(this.props.updateTotal){return{minimum:minimum-1,maximum};} 7255return{minimum:clamp(minimum,1,this.props.total)-1,maximum:clamp(maximum,1,this.props.total),};} 7256async setValue(value){const{minimum,maximum}=await this.parse(value);if(!isNaN(minimum)&&!isNaN(maximum)&&minimum<maximum){this.update(minimum,maximum-minimum);}} 7257async update(offset,limit,hasNavigated){this.state.isDisabled=true;await this.props.onUpdate({offset,limit},hasNavigated);this.state.isDisabled=false;this.state.isEditing=false;} 7258async updateTotal(){if(!this.state.isDisabled){this.state.isDisabled=true;await this.props.updateTotal();this.state.isDisabled=false;}} 7259onClickAway(ev){if(ev.target!==this.inputRef.el){this.state.isEditing=false;}} 7260onInputBlur(){this.state.isEditing=false;} 7261onInputChange(ev){this.setValue(ev.target.value);if(!this.state.isDisabled){ev.preventDefault();}} 7262onInputKeydown(ev){switch(ev.key){case"Enter":ev.preventDefault();ev.stopPropagation();this.setValue(ev.currentTarget.value);break;case"Escape":ev.preventDefault();ev.stopPropagation();this.state.isEditing=false;break;}} 7263onValueClick(){if(this.props.isEditable&&!this.state.isEditing&&!this.state.isDisabled){if(this.inputRef.el){this.inputRef.el.focus();} 7264this.state.isEditing=true;}}} 7265Pager.template="web.Pager";Pager.defaultProps={isEditable:true,withAccessKey:true,};Pager.props={offset:Number,limit:Number,total:Number,onUpdate:Function,isEditable:{type:Boolean,optional:true},withAccessKey:{type:Boolean,optional:true},updateTotal:{type:Function,optional:true},};return __exports;});; 7266 7267/* /web/static/src/core/popover/popover.js */ 7268odoo.define('@web/core/popover/popover',async function(require){'use strict';let __exports={};const{usePosition}=require("@web/core/position_hook");const{Component}=require("@odoo/owl");const Popover=__exports.Popover=class Popover extends Component{setup(){usePosition(this.props.target,{onPositioned:this.props.onPositioned||this.onPositioned.bind(this),position:this.props.position,});} 7269onPositioned(el,{direction,variant}){const position=`${direction[0]}${variant[0]}`;const directionMap={top:"top",bottom:"bottom",left:"start",right:"end",};el.classList=["o_popover popover mw-25 shadow-sm",`bs-popover-${directionMap[direction]}`,`o-popover-${direction}`,`o-popover--${position}`,].join(" ");if(this.props.popoverClass){el.classList.add(...this.props.popoverClass.split(" "));} 7270const arrowEl=el.firstElementChild;arrowEl.className="popover-arrow";switch(position){case"tm":case"bm":arrowEl.classList.add("start-0","end-0","mx-auto");break;case"lm":case"rm":arrowEl.classList.add("top-0","bottom-0","my-auto");break;
7270case"ts":case"bs":arrowEl.classList.add("end-auto");break;case"te":case"be":arrowEl.classList.add("start-auto");break;case"ls":case"rs":arrowEl.classList.add("bottom-auto");break;case"le":case"re":arrowEl.classList.add("top-auto");break;}}} 7271Popover.template="web.PopoverWowl";Popover.defaultProps={position:"bottom",};Popover.props={id:{optional:true,type:Number,},popoverClass:{optional:true,type:String,},position:{type:String,validate:(p)=>["top","bottom","left","right"].includes(p),optional:true,},onPositioned:{type:Function,optional:true,},target:{validate:(el)=>el&&typeof el==="object"&&(el instanceof HTMLElement||(el.ownerDocument&&el instanceof el.ownerDocument.defaultView.HTMLElement)),},slots:{type:Object,optional:true,shape:{default:{optional:true},},},};return __exports;});; 7272 7273/* /web/static/src/core/popover/popover_container.js */ 7274odoo.define('@web/core/popover/popover_container',async function(require){'use strict';let __exports={};const{Popover}=require("@web/core/popover/popover");const{Component,onWillDestroy,useExternalListener,useState,xml}=require("@odoo/owl");class PopoverController extends Component{setup(){this.state=useState({displayed:false});if(this.target.isConnected){useExternalListener(window,"click",this.onClickAway,{capture:true});const targetObserver=new MutationObserver(this.onTargetMutate.bind(this));targetObserver.observe(this.target.parentElement,{childList:true});onWillDestroy(()=>{targetObserver.disconnect();});}else{this.onTargetMutate();}} 7275get popoverProps(){return{id:this.props.id,target:this.target,position:this.props.position,popoverClass:this.props.popoverClass,onPositioned:this.props.onPositioned,};} 7276get popoverComponentProps(){return{close:this.props.close,...this.props.props,};} 7277get target(){if(typeof this.props.target==="string"){return document.querySelector(this.props.target);}else{return this.props.target;}} 7278onClickAway(ev){if(this.target.contains(ev.target)||ev.target.closest(`.o_popover[popover-id="${this.props.id}"]`)){return;} 7279if(this.props.preventClose&&this.props.preventClose(ev)){return;} 7280if(this.props.closeOnClickAway){this.props.close();}} 7281onTargetMutate(){const target=this.target;if(!target||!target.parentElement){this.props.close();}}} 7282PopoverController.components={Popover};PopoverController.defaultProps={alwaysDisplayed:false,closeOnClickAway:true,};PopoverController.template=xml` 7283 <Popover t-props="popoverProps"> 7284 <t t-component="props.Component" t-props="popoverComponentProps"/> 7285 </Popover> 7286`;const PopoverContainer=__exports.PopoverContainer=class PopoverContainer extends Component{setup(){this.props.bus.addEventListener("UPDATE",this.render.bind(this));}} 7287PopoverContainer.components={PopoverController};PopoverContainer.template=xml` 7288 <div class="o_popover_container"> 7289 <t t-foreach="Object.values(props.popovers)" t-as="popover" t-key="popover.id"> 7290 <PopoverController t-props="popover" /> 7291 </t> 7292 </div> 7293`;return __exports;});; 7294 7295/* /web/static/src/core/popover/popover_hook.js */ 7296odoo.define('@web/core/popover/popover_hook',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{onWillUnmount,status,useComponent}=require("@odoo/owl");__exports.usePopover=usePopover;function usePopover(){const removeFns=new Set();const service=useService("popover");const component=useComponent();onWillUnmount(function(){for(const removeFn of removeFns){removeFn();} 7297removeFns.clear();});return{add(target,Component,props,options={}){const newOptions=Object.create(options);newOptions.onClose=function(){removeFns.delete(removeFn);if(options.onClose&&status(component)!=="destroyed"){options.onClose();}};const removeFn=service.add(target,Component,props,newOptions);removeFns.add(removeFn);return removeFn;},};} 7298return __exports;});; 7299 7300/* /web/static/src/core/popover/popover_service.js */ 7301odoo.define('@web/core/popover/popover_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{PopoverContainer}=require("@web/core/popover/popover_container");const{EventBus}=require("@odoo/owl");const popoverService=__exports.popoverService={start(){let nextId=0;const popovers={};const bus=new EventBus();registry.category("main_components").add("PopoverContainer",{Component:PopoverContainer,props:{bus,popovers}});function add(target,Component,props,options={}){const id=++nextId;const closeFn=()=>close(id);const popover={id,target,Component,props,close:closeFn,onClose:options.onClose,position:options.position,onPositioned:options.onPositioned,popoverClass:options.popoverClass,closeOnClickAway:options.closeOnClickAway,preventClose:options.preventClose,};popovers[id]=popover;bus.trigger("UPDATE");return closeFn;}
7302function close(id){if(id in popovers){const popover=popovers[id];if(popover.onClose){popover.onClose();} 7303delete popovers[id];bus.trigger("UPDATE");}} 7304return{add};},};registry.category("services").add("popover",popoverService);return __exports;});; 7305 7306/* /web/static/src/core/position_hook.js */ 7307odoo.define('@web/core/position_hook',async function(require){'use strict';let __exports={};const{throttleForAnimation}=require("@web/core/utils/timing");const{EventBus,onWillDestroy,onWillUnmount,useChildSubEnv,useComponent,useEffect,useExternalListener,useRef,}=require("@odoo/owl");const{localization}=require("@web/core/l10n/localization");const DIRECTIONS={t:"top",r:"right",b:"bottom",l:"left"};const VARIANTS={s:"start",m:"middle",e:"end"};const DIRECTION_FLIP_ORDER={top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"};const VARIANT_FLIP_ORDER={start:"sme",middle:"mse",end:"ems"};const DEFAULTS={popper:"popper",margin:0,position:"bottom",};function getBestPosition(reference,popper,{container,margin,position}){const[directionKey,variantKey="middle"]=position.split("-");const directions=DIRECTION_FLIP_ORDER[directionKey];const variants=VARIANT_FLIP_ORDER[variantKey];const popperStyle=getComputedStyle(popper);const{marginTop,marginLeft,marginRight,marginBottom}=popperStyle;const popMargins={top:parseFloat(marginTop),left:parseFloat(marginLeft),right:parseFloat(marginRight),bottom:parseFloat(marginBottom),};const popBox=popper.getBoundingClientRect();const refBox=reference.getBoundingClientRect();const contBox=container.getBoundingClientRect();const containerIsHTMLNode=container===document.firstElementChild;const directionsData={t:refBox.top-popMargins.bottom-margin-popBox.height,b:refBox.bottom+popMargins.top+margin,r:refBox.right+popMargins.left+margin,l:refBox.left-popMargins.right-margin-popBox.width,};const variantsData={vs:refBox.left+popMargins.left,vm:refBox.left+refBox.width/2-popBox.width/2,ve:refBox.right-popMargins.right-popBox.width,hs:refBox.top+popMargins.top,hm:refBox.top+refBox.height/2-popBox.height/2,he:refBox.bottom-popMargins.bottom-popBox.height,};function getPositioningData(d=directions[0],v=variants[0],containerRestricted=false){const vertical=["t","b"].includes(d);
7307const variantPrefix=vertical?"v":"h";const directionValue=directionsData[d];const variantValue=variantsData[variantPrefix+v];if(containerRestricted){const[directionSize,variantSize]=vertical?[popBox.height,popBox.width]:[popBox.width,popBox.height];let[directionMin,directionMax]=vertical?[contBox.top,contBox.bottom]:[contBox.left,contBox.right];let[variantMin,variantMax]=vertical?[contBox.left,contBox.right]:[contBox.top,contBox.bottom];if(containerIsHTMLNode){if(vertical){directionMin+=container.scrollTop;directionMax+=container.scrollTop;}else{variantMin+=container.scrollTop;variantMax+=container.scrollTop;}} 7308const directionOverflow=Math.ceil(directionValue)<Math.floor(directionMin)||Math.floor(directionValue+directionSize)>Math.ceil(directionMax);const variantOverflow=Math.ceil(variantValue)<Math.floor(variantMin)||Math.floor(variantValue+variantSize)>Math.ceil(variantMax);if(directionOverflow||variantOverflow){return null;}} 7309const positioning=vertical?{top:directionValue,left:variantValue,}:{top:variantValue,left:directionValue,};return{top:positioning.top-popBox.top,left:positioning.left-popBox.left,direction:DIRECTIONS[d],variant:VARIANTS[v],};} 7310for(const d of directions){for(const v of variants){const match=getPositioningData(d,v,true);if(match){return match;}}} 7311return getPositioningData();} 7312__exports.reposition=reposition;function reposition(reference,popper,options){options={container:document.documentElement,...options,};popper.style.position="fixed";popper.style.top="0px";popper.style.left="0px";const position=getBestPosition(reference,popper,options);const{top,left}=position;popper.style.top=`${top}px`;popper.style.left=`${left}px`;if(options.onPositioned){options.onPositioned(popper,position);}} 7313const POSITION_BUS=Symbol("position-bus");__exports.usePosition=usePosition;function usePosition(reference,options){options={...DEFAULTS,...options};const{popper,position}=options;let[directionKey,variantKey="middle"]=position.split("-");if(localization.direction==="rtl"){if(["bottom","top"].includes(directionKey)){if(variantKey!=="middle"){variantKey=variantKey==="start"?"end":"start";}}else{directionKey=directionKey==="left"?"right":"left";} 7314options.position=[directionKey,variantKey].join("-");} 7315const popperRef=useRef(popper);const getReference=typeof reference==="function"?reference:()=>reference;const update=()=>{const ref=getReference();if(popperRef.el&&ref){reposition(ref,popperRef.el,options);}};const component=useComponent();const bus=component.env[POSITION_BUS]||new EventBus();bus.on("update",component,update);onWillDestroy(()=>bus.off("update",component));useEffect(()=>bus.trigger("update"));if(!(POSITION_BUS in component.env)){useChildSubEnv({[POSITION_BUS]:bus});const throttledUpdate=throttleForAnimation(()=>bus.trigger("update"));useExternalListener(document,"scroll",throttledUpdate,{capture:true});useExternalListener(document,"load",throttledUpdate,{capture:true});useExternalListener(window,"resize",throttledUpdate);onWillUnmount(throttledUpdate.cancel);}} 7316return __exports;});; 7317 7318/* /web/static/src/core/py_js/py.js */ 7319odoo.define('@web/core/py_js/py',async function(require){'use strict';let __exports={};const{evaluate}=require("@web/core/py_js/py_interpreter");const{parse}=require("@web/core/py_js/py_parser");const{tokenize}=require("@web/core/py_js/py_tokenizer");{const{evaluate}=require("@web/core/py_js/py_interpreter");Object.assign(__exports,{evaluate})};{const{parse}=require("@web/core/py_js/py_parser");Object.assign(__exports,{parse})};{const{tokenize}=require("@web/core/py_js/py_tokenizer");Object.assign(__exports,{tokenize})};{const{formatAST}=require("@web/core/py_js/py_utils");Object.assign(__exports,{formatAST})};__exports.parseExpr=parseExpr;function parseExpr(expr){const tokens=tokenize(expr);return parse(tokens);} 7320__exports.evaluateExpr=evaluateExpr;function evaluateExpr(expr,context={}){const ast=parseExpr(expr);return evaluate(ast,context);} 7321return __exports;});; 7322 7323/* /web/static/src/core/py_js/py_builtin.js */ 7324odoo.define('@web/core/py_js/py_builtin',async function(require){'use strict';let __exports={};const{PyDate,PyDateTime,PyRelativeDelta,PyTime,PyTimeDelta}=require("@web/core/py_js/py_date");const BUILTINS=__exports.BUILTINS={bool(value){switch(typeof value){case"number":return value!==0;case"string":return value!=="";case"boolean":return value;case"object":if(value===null){return false;} 7325if(value.isTrue){return value.isTrue();} 7326return true;} 7327return true;},time:{strftime(format){return PyDateTime.now().strftime(format);},},context_today(){return PyDate.today();},get current_date(){return this.today;},get today(){return PyDate.today().strftime("%Y-%m-%d");},get now(){return PyDateTime.now().strftime("%Y-%m-%d %H:%M:%S");},datetime:{time:PyTime,timedelta:PyTimeDelta,datetime:PyDateTime,date:PyDate,}
7327,relativedelta:PyRelativeDelta,true:true,false:false,};return __exports;});; 7328 7329/* /web/static/src/core/py_js/py_date.js */ 7330odoo.define('@web/core/py_js/py_date',async function(require){'use strict';let __exports={};const{parseArgs}=require("@web/core/py_js/py_parser");const AssertionError=__exports.AssertionError=class AssertionError extends Error{} 7331const ValueError=__exports.ValueError=class ValueError extends Error{} 7332const NotSupportedError=__exports.NotSupportedError=class NotSupportedError extends Error{} 7333function fmt2(n){return String(n).padStart(2,"0");} 7334function fmt4(n){return String(n).padStart(4,"0");} 7335function divmod(a,b,fn){let mod=a%b;if((mod>0&&b<0)||(mod<0&&b>0)){mod+=b;} 7336return fn(Math.floor(a/b),mod);} 7337function assert(bool,message="AssertionError"){if(!bool){throw new AssertionError(message);}} 7338const DAYS_IN_MONTH=[null,31,28,31,30,31,30,31,31,30,31,30,31];const DAYS_BEFORE_MONTH=[null];for(let dbm=0,i=1;i<DAYS_IN_MONTH.length;++i){DAYS_BEFORE_MONTH.push(dbm);dbm+=DAYS_IN_MONTH[i];} 7339function daysInMonth(year,month){if(month===2&&isLeap(year)){return 29;} 7340return DAYS_IN_MONTH[month];} 7341function isLeap(year){return year%4===0&&(year%100!==0||year%400===0);} 7342function daysBeforeYear(year){const y=year-1;return y*365+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400);} 7343function daysBeforeMonth(year,month){const postLeapFeb=month>2&&isLeap(year);return DAYS_BEFORE_MONTH[month]+(postLeapFeb?1:0);} 7344function ymd2ord(year,month,day){const dim=daysInMonth(year,month);if(!(1<=day&&day<=dim)){throw new ValueError(`day must be in 1..${dim}`);} 7345return daysBeforeYear(year)+daysBeforeMonth(year,month)+day;} 7346const DI400Y=daysBeforeYear(401);const DI100Y=daysBeforeYear(101);const DI4Y=daysBeforeYear(5);function ord2ymd(n){--n;let n400,n100,n4,n1,n0;divmod(n,DI400Y,function(_n400,n){n400=_n400;divmod(n,DI100Y,function(_n100,n){n100=_n100;divmod(n,DI4Y,function(_n4,n){n4=_n4;divmod(n,365,function(_n1,n){n1=_n1;n0=n;});});});});n=n0;const year=n400*400+1+n100*100+n4*4+n1;if(n1==4||n100==100){assert(n0===0);return{year:year-1,month:12,day:31,};} 7347const leapyear=n1===3&&(n4!==24||n100==3);assert(leapyear==isLeap(year));let month=(n+50)>>5;let preceding=DAYS_BEFORE_MONTH[month]+(month>2&&leapyear?1:0);if(preceding>n){--month;preceding-=DAYS_IN_MONTH[month]+(month===2&&leapyear?1:0);} 7348n-=preceding;return{year:year,month:month,day:n+1,};} 7349function tmxxx(year,month,day,hour,minute,second,microsecond){hour=hour||0;minute=minute||0;second=second||0;microsecond=microsecond||0;if(microsecond<0||microsecond>999999){divmod(microsecond,1000000,function(carry,ms){microsecond=ms;second+=carry;});} 7350if(second<0||second>59){divmod(second,60,function(carry,s){second=s;minute+=carry;});} 7351if(minute<0||minute>59){divmod(minute,60,function(carry,m){minute=m;hour+=carry;});} 7352if(hour<0||hour>23){divmod(hour,24,function(carry,h){hour=h;day+=carry;});} 7353if(month<1||month>12){divmod(month-1,12,function(carry,m){month=m+1;year+=carry;});} 7354const dim=daysInMonth(year,month);if(day<1||day>dim){if(day===0){--month;if(month>0){day=daysInMonth(year,month);}else{--year;month=12;day=31;}}else if(day==dim+1){++month;day=1;if(month>12){month=1;++year;}}else{const r=ord2ymd(ymd2ord(year,month,1)+(day-1));year=r.year;month=r.month;day=r.day;}} 7355return{year:year,month:month,day:day,hour:hour,minute:minute,second:second,microsecond:microsecond,};} 7356const PyDate=__exports.PyDate=class PyDate{static today(){return this.convertDate(new Date());} 7357static convertDate(date){const year=date.getFullYear();const month=date.getMonth()+1;const day=date.getDate();return new PyDate(year,month,day);} 7358constructor(year,month,day){this.year=year;this.month=month;this.day=day;} 7359static create(...args){const{year,month,day}=parseArgs(args,["year","month","day"]);return new PyDate(year,month,day);} 7360add(timedelta){const s=tmxxx(this.year,this.month,this.day+timedelta.days);return new PyDate(s.year,s.month,s.day);} 7361isEqual(other){if(!(other instanceof PyDate)){return false;} 7362return this.year===other.year&&this.month===other.month&&this.day===other.day;} 7363strftime(format){return format.replace(/%([A-Za-z])/g,(m,c)=>{switch(c){case"Y":return fmt4(this.year);case"m":return fmt2(this.month);case"d":return fmt2(this.day);} 7364throw new ValueError(`No known conversion for ${m}`);});} 7365substract(other){if(other instanceof PyTimeDelta){return this.add(other.negate());}
7366if(other instanceof PyDate){return PyTimeDelta.create(this.toordinal()-other.toordinal());} 7367throw new NotSupportedError();} 7368toJSON(){return this.strftime("%Y-%m-%d");} 7369toordinal(){return ymd2ord(this.year,this.month,this.day);}} 7370const PyDateTime=__exports.PyDateTime=class PyDateTime{static now(){return this.convertDate(new Date());} 7371static convertDate(date){const year=date.getFullYear();const month=date.getMonth()+1;const day=date.getDate();const hour=date.getHours();const minute=date.getMinutes();const second=date.getSeconds();return new PyDateTime(year,month,day,hour,minute,second,0);} 7372static create(...args){const namedArgs=parseArgs(args,["year","month","day","hour","minute","second","microsecond",]);const year=namedArgs.year;const month=namedArgs.month;const day=namedArgs.day;const hour=namedArgs.hour||0;const minute=namedArgs.minute||0;const second=namedArgs.second||0;const ms=namedArgs.micro/1000||0;return new PyDateTime(year,month,day,hour,minute,second,ms);} 7373static combine(...args){const{date,time}=parseArgs(args,["date","time"]);return PyDateTime.create(date.year,date.month,date.day,time.hour,time.minute,time.second);} 7374constructor(year,month,day,hour,minute,second,microsecond){this.year=year;this.month=month;this.day=day;this.hour=hour;this.minute=minute;this.second=second;this.microsecond=microsecond;} 7375add(timedelta){const s=tmxxx(this.year,this.month,this.day+timedelta.days,this.hour,this.minute,this.second+timedelta.seconds,this.microsecond+timedelta.microseconds);return new PyDateTime(s.year,s.month,s.day,s.hour,s.minute,s.second,s.microsecond);} 7376isEqual(other){if(!(other instanceof PyDateTime)){return false;} 7377return(this.year===other.year&&this.month===other.month&&this.day===other.day&&this.hour===other.hour&&this.minute===other.minute&&this.second===other.second&&this.microsecond===other.microsecond);} 7378strftime(format){return format.replace(/%([A-Za-z])/g,(m,c)=>{switch(c){case"Y":return fmt4(this.year);case"m":return fmt2(this.month);case"d":return fmt2(this.day);case"H":return fmt2(this.hour);case"M":return fmt2(this.minute);case"S":return fmt2(this.second);} 7379throw new ValueError(`No known conversion for ${m}`);});} 7380substract(timedelta){return this.add(timedelta.negate());} 7381toJSON(){return this.strftime("%Y-%m-%d %H:%M:%S");} 7382to_utc(){const d=new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second);const timedelta=PyTimeDelta.create({minutes:d.getTimezoneOffset()});return this.add(timedelta);}} 7383const PyTime=__exports.PyTime=class PyTime extends PyDate{static create(...args){const namedArgs=parseArgs(args,["hour","minute","second"]);const hour=namedArgs.hour||0;const minute=namedArgs.minute||0;const second=namedArgs.second||0;return new PyTime(hour,minute,second);} 7384constructor(hour,minute,second){const now=new Date();const year=now.getFullYear();const month=now.getMonth();const day=now.getDate();super(year,month,day);this.hour=hour;this.minute=minute;this.second=second;} 7385strftime(format){return format.replace(/%([A-Za-z])/g,(m,c)=>{switch(c){case"Y":return fmt4(this.year);case"m":return fmt2(this.month+1);case"d":return fmt2(this.day);case"H":return fmt2(this.hour);case"M":return fmt2(this.minute);case"S":return fmt2(this.second);} 7386throw new ValueError(`No known conversion for ${m}`);});} 7387toJSON(){return this.strftime("%H:%M:%S");}} 7388const DAYS_IN_YEAR=[31,59,90,120,151,181,212,243,273,304,334,366];const TIME_PERIODS=["hour","minute","second"];const PERIODS=["year","month","day",...TIME_PERIODS];const RELATIVE_KEYS="years months weeks days hours minutes seconds microseconds leapdays".split(" ");const ABSOLUTE_KEYS="year month day hour minute second microsecond weekday nlyearday yearday".split(" ");const argsSpec=["dt1","dt2"];const PyRelativeDelta=__exports.PyRelativeDelta=class PyRelativeDelta{static create(...args){const params=parseArgs(args,argsSpec);if("dt1"in params){throw new Error("relativedelta(dt1, dt2) is not supported for now");} 7389for(const period of PERIODS){if(period in params){const val=params[period];assert(val>=0,`${period} ${val} is out of range`);}} 7390for(const key of RELATIVE_KEYS){params[key]=params[key]||0;} 7391for(const key of ABSOLUTE_KEYS){params[key]=key in params?params[key]:null;} 7392params.days+=7*params.weeks;let yearDay=0;if(params.nlyearday){yearDay=params.nlyearday;}else if(params.yearday){yearDay=params.yearday;if(yearDay>59){params.leapDays=-1;}} 7393if(yearDay){for(let monthIndex=0;monthIndex<DAYS_IN_YEAR.length;monthIndex++){if(yearDay<=DAYS_IN_YEAR[monthIndex]){params.month=monthIndex+1;if(monthIndex===0){params.day=yearDay;}else{params.day=yearDay-DAYS_IN_YEAR[monthIndex-1];} 7394break;}}} 7395return new PyRelativeDelta(params);} 7396static add(date,delta){if(!(date instanceof PyDate||date instanceof PyDateTime)){throw new NotSupportedError();} 7397const s=tmxxx((delta.year||date.year)+delta.years,(delta.month||date.month)+delta.months,delta.day||date.day,delta.hour||date.hour||0,delta.minute||date.minute||0,delta.second||date.seconds||0,delta.microseconds||date.microseconds||0);const newDateTime=new PyDateTime(s.year,s.month,s.day,s.hour,s.minute,s.second,s.microsecond);let leapDays=0;if(delta.leapDays&&newDateTime.month>2&&isLeap(newDateTime.year)){leapDays=delta.leapDays;}
7398const temp=newDateTime.add(PyTimeDelta.create({days:delta.days+leapDays,hours:delta.hours,minutes:delta.minutes,seconds:delta.seconds,microseconds:delta.microseconds,}));const hasTime=Boolean(temp.hour||temp.minute||temp.second||temp.microsecond);const returnDate=!hasTime&&date instanceof PyDate?new PyDate(temp.year,temp.month,temp.day):temp;if(delta.weekday!==null){const wantedDow=delta.weekday+1;const _date=new Date(returnDate.year,returnDate.month-1,returnDate.day);const days=(7-_date.getDay()+wantedDow)%7;return returnDate.add(new PyTimeDelta(days,0,0));} 7399return returnDate;} 7400static substract(date,delta){return PyRelativeDelta.add(date,delta.negate());} 7401constructor(params={},sign=+1){this.years=sign*params.years;this.months=sign*params.months;this.days=sign*params.days;this.hours=sign*params.hours;this.minutes=sign*params.minutes;this.seconds=sign*params.seconds;this.microseconds=sign*params.microseconds;this.leapDays=params.leapDays;this.year=params.year;this.month=params.month;this.day=params.day;this.hour=params.hour;this.minute=params.minute;this.second=params.second;this.microsecond=params.microsecond;this.weekday=params.weekday;} 7402negate(){return new PyRelativeDelta(this,-1);} 7403isEqual(other){throw new NotSupportedError();}} 7404const TIME_DELTA_KEYS="weeks days hours minutes seconds milliseconds microseconds".split(" ");function modf(x){const mod=x%1;return[mod<0?mod+1:mod,Math.floor(x)];} 7405const PyTimeDelta=__exports.PyTimeDelta=class PyTimeDelta{static create(...args){const namedArgs=parseArgs(args,["days","seconds","microseconds"]);for(const key of TIME_DELTA_KEYS){namedArgs[key]=namedArgs[key]||0;} 7406let d=0;let s=0;let us=0;const days=namedArgs.days+namedArgs.weeks*7;let seconds=namedArgs.seconds+60*namedArgs.minutes+3600*namedArgs.hours;let microseconds=namedArgs.microseconds+1000*namedArgs.milliseconds;const[dFrac,dInt]=modf(days);d=dInt;let daysecondsfrac=0;if(dFrac){const[dsFrac,dsInt]=modf(dFrac*24*3600);s=dsInt;daysecondsfrac=dsFrac;} 7407const[sFrac,sInt]=modf(seconds);seconds=sInt;const secondsfrac=sFrac+daysecondsfrac;divmod(seconds,24*3600,(days,seconds)=>{d+=days;s+=seconds;});microseconds+=secondsfrac*1e6;divmod(microseconds,1000000,(seconds,microseconds)=>{divmod(seconds,24*3600,(days,seconds)=>{d+=days;s+=seconds;us+=Math.round(microseconds);});});return new PyTimeDelta(d,s,us);} 7408constructor(days,seconds,microseconds){this.days=days;this.seconds=seconds;this.microseconds=microseconds;}
7409add(other){return PyTimeDelta.create({days:this.days+other.days,seconds:this.seconds+other.seconds,microseconds:this.microseconds+other.microseconds,});} 7410divide(n){const us=(this.days*24*3600+this.seconds)*1e6+this.microseconds;return PyTimeDelta.create({microseconds:Math.floor(us/n)});} 7411isEqual(other){if(!(other instanceof PyTimeDelta)){return false;} 7412return(this.days===other.days&&this.seconds===other.seconds&&this.microseconds===other.microseconds);} 7413isTrue(){return this.days!==0||this.seconds!==0||this.microseconds!==0;} 7414multiply(n){return PyTimeDelta.create({days:n*this.days,seconds:n*this.seconds,microseconds:n*this.microseconds,});} 7415negate(){return PyTimeDelta.create({days:-this.days,seconds:-this.seconds,microseconds:-this.microseconds,});} 7416substract(other){return PyTimeDelta.create({days:this.days-other.days,seconds:this.seconds-other.seconds,microseconds:this.microseconds-other.microseconds,});} 7417total_seconds(){return this.days*86400+this.seconds+this.microseconds/1000000;}} 7418return __exports;});; 7419 7420/* /web/static/src/core/py_js/py_interpreter.js */ 7421odoo.define('@web/core/py_js/py_interpreter',async function(require){'use strict';let __exports={};const{BUILTINS}=require("@web/core/py_js/py_builtin");const{NotSupportedError,PyDate,PyDateTime,PyRelativeDelta,PyTime,PyTimeDelta,}=require("@web/core/py_js/py_date");const{PY_DICT,toPyDict}=require("@web/core/py_js/py_utils");const{parseArgs}=require("@web/core/py_js/py_parser");const EvaluationError=__exports.EvaluationError=class EvaluationError extends Error{} 7422const isTrue=BUILTINS.bool;function applyUnaryOp(ast,context){const value=evaluate(ast.right,context);switch(ast.op){case"-":if(value instanceof Object&&value.negate){return value.negate();} 7423return-value;case"+":return value;case"not":return!isTrue(value);} 7424throw new EvaluationError(`Unknown unary operator: ${ast.op}`);} 7425function pytypeIndex(val){switch(typeof val){case"object":return val===null?1:Array.isArray(val)?5:3;case"number":return 2;case"string":return 4;} 7426throw new EvaluationError(`Unknown type: ${typeof val}`);} 7427function isConstructor(obj){return!!obj.prototype&&!!obj.prototype.constructor.name;} 7428function isLess(left,right){if(typeof left==="number"&&typeof right==="number"){return left<right;} 7429if(typeof left==="boolean"){left=left?1:0;} 7430if(typeof right==="boolean"){right=right?1:0;} 7431const leftIndex=pytypeIndex(left);const rightIndex=pytypeIndex(right);if(leftIndex===rightIndex){return left<right;} 7432return leftIndex<rightIndex;} 7433function isEqual(left,right){if(typeof left!==typeof right){if(typeof left==="boolean"&&typeof right==="number"){return right===(left?1:0);} 7434if(typeof left==="number"&&typeof right==="boolean"){return left===(right?1:0);} 7435return false;} 7436if(left instanceof Object&&left.isEqual){return left.isEqual(right);} 7437return left===right;} 7438function isIn(left,right){if(Array.isArray(right)){return right.includes(left);} 7439if(typeof right==="string"&&typeof left==="string"){return right.includes(left);} 7440return false;} 7441function applyBinaryOp(ast,context){const left=evaluate(ast.left,context);const right=evaluate(ast.right,context);switch(ast.op){case"+":{const relativeDeltaOnLeft=left instanceof PyRelativeDelta;const relativeDeltaOnRight=right instanceof PyRelativeDelta;if(relativeDeltaOnLeft||relativeDeltaOnRight){const date=relativeDeltaOnLeft?right:left;const delta=relativeDeltaOnLeft?left:right;return PyRelativeDelta.add(date,delta);} 7442const timeDeltaOnLeft=left instanceof PyTimeDelta;const timeDeltaOnRight=right instanceof PyTimeDelta;if(timeDeltaOnLeft&&timeDeltaOnRight){return left.add(right);} 7443if(timeDeltaOnLeft){if(right instanceof PyDate||right instanceof PyDateTime){return right.add(left);}else{throw new NotSupportedError();}} 7444if(timeDeltaOnRight){if(left instanceof PyDate||left instanceof PyDateTime){return left.add(right);}else{throw new NotSupportedError();}} 7445return left+right;} 7446case"-":{const isRightDelta=right instanceof PyRelativeDelta;if(isRightDelta){return PyRelativeDelta.substract(left,right);} 7447const timeDeltaOnRight=right instanceof PyTimeDelta;if(timeDeltaOnRight){if(left instanceof PyTimeDelta){return left.substract(right);}else if(left instanceof PyDate||left instanceof PyDateTime){return left.substract(right);}else{throw new NotSupportedError();}} 7448if(left instanceof PyDate){return left.substract(right);} 7449return left-right;} 7450case"*":{const timeDeltaOnLeft=left instanceof PyTimeDelta;const timeDeltaOnRight=right instanceof PyTimeDelta;if(timeDeltaOnLeft||timeDeltaOnRight){const number=timeDeltaOnLeft?right:left;const delta=timeDeltaOnLeft?left:right;return delta.multiply(number);} 7451return left*right;} 7452case"/":return left/right;case"%":return left%right;
7452case"//":if(left instanceof PyTimeDelta){return left.divide(right);} 7453return Math.floor(left/right);case"**":return left**right;case"==":return isEqual(left,right);case"<>":case"!=":return!isEqual(left,right);case"<":return isLess(left,right);case">":return isLess(right,left);case">=":return isEqual(left,right)||isLess(right,left);case"<=":return isEqual(left,right)||isLess(left,right);case"in":return isIn(left,right);case"not in":return!isIn(left,right);} 7454throw new EvaluationError(`Unknown binary operator: ${ast.op}`);} 7455const DICT={get(...args){const{key,defValue}=parseArgs(args,["key","defValue"]);if(key in this){return this[key];}else if(defValue){return defValue;} 7456return null;},};function methods(_class){return Object.getOwnPropertyNames(_class.prototype).map((prop)=>_class.prototype[prop]);} 7457const allowedFns=__exports.allowedFns=new Set([BUILTINS.time.strftime,BUILTINS.bool,BUILTINS.context_today,BUILTINS.datetime.datetime.now,BUILTINS.datetime.datetime.combine,BUILTINS.datetime.date.today,...methods(BUILTINS.relativedelta),...Object.values(BUILTINS.datetime).flatMap((obj)=>methods(obj)),...Object.values(DICT),]);const unboundFn=Symbol("unbound function");__exports.evaluate=evaluate;function evaluate(ast,context={}){const dicts=new Set();let pyContext;const evalContext=Object.create(context);
7457Object.defineProperty(evalContext,"context",{get(){if(!pyContext){pyContext=toPyDict(context);} 7458return pyContext;},});function _innerEvaluate(ast){switch(ast.type){case 0:case 1:return ast.value;case 5:if(ast.value in evalContext){return evalContext[ast.value];}else if(ast.value in BUILTINS){return BUILTINS[ast.value];}else{throw new EvaluationError(`Name '${ast.value}' is not defined`);} 7459case 3:return null;case 2:return ast.value;case 6:return applyUnaryOp(ast,evalContext);case 7:return applyBinaryOp(ast,evalContext);case 14:{const left=_evaluate(ast.left);if(ast.op==="and"){return isTrue(left)?_evaluate(ast.right):left;}else{return isTrue(left)?left:_evaluate(ast.right);}} 7460case 4:case 10:return ast.value.map(_evaluate);case 11:{const dict={};for(const key in ast.value){dict[key]=_evaluate(ast.value[key]);} 7461dicts.add(dict);return dict;} 7462case 8:{const fnValue=_evaluate(ast.fn);const args=ast.args.map(_evaluate);const kwargs={};for(const kwarg in ast.kwargs){kwargs[kwarg]=_evaluate(ast.kwargs[kwarg]);} 7463if(fnValue===PyDate||fnValue===PyDateTime||fnValue===PyTime||fnValue===PyRelativeDelta||fnValue===PyTimeDelta){return fnValue.create(...args,kwargs);} 7464return fnValue(...args,kwargs);} 7465case 12:{const dict=_evaluate(ast.target);const key=_evaluate(ast.key);return dict[key];} 7466case 13:{if(isTrue(_evaluate(ast.condition))){return _evaluate(ast.ifTrue);}else{return _evaluate(ast.ifFalse);}} 7467case 15:{const left=_evaluate(ast.obj);let result;if(dicts.has(left)||Object.isPrototypeOf.call(PY_DICT,left)){result=DICT[ast.key];}else{result=left[ast.key];} 7468if(typeof result==="function"){if(!isConstructor(result)){const bound=result.bind(left);bound[unboundFn]=result;return bound;}} 7469return result;}} 7470throw new EvaluationError(`AST of type ${ast.type} cannot be evaluated`);} 7471function _evaluate(ast){const val=_innerEvaluate(ast);if(typeof val==="function"&&!allowedFns.has(val)&&!allowedFns.has(val[unboundFn])){throw new Error("Invalid Function Call");} 7472return val;} 7473return _evaluate(ast);} 7474return __exports;});; 7475 7476/* /web/static/src/core/py_js/py_parser.js */ 7477odoo.define('@web/core/py_js/py_parser',async function(require){'use strict';let __exports={};const{binaryOperators,comparators}=require("@web/core/py_js/py_tokenizer");const ParserError=__exports.ParserError=class ParserError extends Error{} 7478const chainedOperators=new Set(comparators);const infixOperators=new Set(binaryOperators.concat(comparators));__exports.bp=bp;function bp(symbol){switch(symbol){case"=":return 10;case"if":return 20;case"in":case"not in":case"is":case"is not":case"<":case"<=":case">":case">=":case"<>":case"==":case"!=":return 60;case"or":return 30;case"and":return 40;case"not":return 50;case"|":return 70;case"^":return 80;case"&":return 90;case"<<":case">>":return 100;case"+":case"-":return 110;case"*":case"/":case"//":case"%":return 120;case"**":return 140;case".":case"(":case"[":return 150;} 7479return 0;} 7480function bindingPower(token){return token.type===2?bp(token.value):0;} 7481function isSymbol(token,value){return token.type===2&&token.value===value;} 7482function parsePrefix(current,tokens){switch(current.type){case 0:return{type:0,value:current.value};case 1:return{type:1,value:current.value};case 4:if(current.value==="None"){return{type:3};}else{return{type:2,value:current.value==="True"};} 7483case 3:return{type:5,value:current.value};case 2:switch(current.value){case"-":case"+":case"~":return{type:6,op:current.value,right:_parse(tokens,130),};case"not":return{type:6,op:current.value,right:_parse(tokens,50),};case"(":{const content=[];let isTuple=false;while(tokens[0]&&!isSymbol(tokens[0],")")){content.push(_parse(tokens,0));if(tokens[0]){if(tokens[0]&&isSymbol(tokens[0],",")){isTuple=true;tokens.shift();}else if(!isSymbol(tokens[0],")")){throw new ParserError("parsing error");}}else{throw new ParserError("parsing error");}} 7484if(!tokens[0]||!isSymbol(tokens[0],")")){throw new ParserError("parsing error");} 7485tokens.shift();isTuple=isTuple||content.length===0;return isTuple?{type:10,value:content}:content[0];} 7486case"[":{const value=[];while(tokens[0]&&!isSymbol(tokens[0],"]")){value.push(_parse(tokens,0));if(tokens[0]){if(isSymbol(tokens[0],",")){tokens.shift();}else if(!isSymbol(tokens[0],"]")){throw new ParserError("parsing error");}}} 7487if(!tokens[0]||!isSymbol(tokens[0],"]")){throw new ParserError("parsing error");} 7488tokens.shift();return{type:4,value};} 7489case"{":{const dict={};while(tokens[0]&&!isSymbol(tokens[0],"}")){const key=_parse(tokens,0);if((key.type!==1&&key.type!==0)||!tokens[0]||!isSymbol(tokens[0],":")){throw new ParserError("parsing error");} 7490tokens.shift();const value=_parse(tokens,0);dict[key.value]=value;if(isSymbol(tokens[0],",")){tokens.shift();}} 7491if(!tokens.shift()){throw new ParserError("parsing error");} 7492return{type:11,value:dict};}}} 7493throw new ParserError("Token cannot be parsed");} 7494function parseInfix(left,current,tokens){switch(current.type){case 2:if(infixOperators.has(current.value)){let right=_parse(tokens,bindingPower(current));if(current.value==="and"||current.value==="or"){return{type:14,op:current.value,left,right,};}else if(current.value==="."){if(right.type===5){return{type:15,obj:left,key:right.value,};}else{throw new ParserError("invalid obj lookup");}} 7495let op={type:7,op:current.value,left,right,};
7495while(chainedOperators.has(current.value)&&tokens[0]&&tokens[0].type===2&&chainedOperators.has(tokens[0].value)){const nextToken=tokens.shift();op={type:14,op:"and",left:op,right:{type:7,op:nextToken.value,left:right,right:_parse(tokens,bindingPower(nextToken)),},};right=op.right.right;} 7496return op;} 7497switch(current.value){case"(":{const args=[];const kwargs={};while(tokens[0]&&!isSymbol(tokens[0],")")){const arg=_parse(tokens,0);if(arg.type===9){kwargs[arg.name.value]=arg.value;}else{args.push(arg);} 7498if(tokens[0]&&isSymbol(tokens[0],",")){tokens.shift();}} 7499if(!tokens[0]||!isSymbol(tokens[0],")")){throw new ParserError("parsing error");} 7500tokens.shift();return{type:8,fn:left,args,kwargs};} 7501case"=":if(left.type===5){return{type:9,name:left,value:_parse(tokens,10),};} 7502break;case"[":{const key=_parse(tokens);if(!tokens[0]||!isSymbol(tokens[0],"]")){throw new ParserError("parsing error");} 7503tokens.shift();return{type:12,target:left,key:key,};} 7504case"if":{const condition=_parse(tokens);if(!tokens[0]||!isSymbol(tokens[0],"else")){throw new ParserError("parsing error");} 7505tokens.shift();const ifFalse=_parse(tokens);return{type:13,condition,ifTrue:left,ifFalse,};}}} 7506throw new ParserError("Token cannot be parsed");} 7507function _parse(tokens,bp=0){const token=tokens.shift();let expr=parsePrefix(token,tokens);while(tokens[0]&&bindingPower(tokens[0])>bp){expr=parseInfix(expr,tokens.shift(),tokens);} 7508return expr;} 7509__exports.parse=parse;function parse(tokens){if(tokens.length){return _parse(tokens,0);} 7510throw new ParserError("Missing token");} 7511__exports.parseArgs=parseArgs;function parseArgs(args,spec){const last=args[args.length-1];const unnamedArgs=typeof last==="object"?args.slice(0,-1):args;const kwargs=typeof last==="object"?last:{};for(const[index,val]of unnamedArgs.entries()){kwargs[spec[index]]=val;} 7512return kwargs;} 7513return __exports;});; 7514 7515/* /web/static/src/core/py_js/py_tokenizer.js */ 7516odoo.define('@web/core/py_js/py_tokenizer',async function(require){'use strict';let __exports={};const TokenizerError=__exports.TokenizerError=class TokenizerError extends Error{} 7517const directMap={"\\":"\\",'"':'"',"'":"'",a:"\x07",b:"\x08",f:"\x0c",n:"\n",r:"\r",t:"\t",v:"\v",};function decodeStringLiteral(str,unicode){const out=[];let code;for(var i=0;i<str.length;++i){if(str[i]!=="\\"){out.push(str[i]);continue;} 7518var escape=str[i+1];if(escape in directMap){out.push(directMap[escape]);++i;continue;} 7519switch(escape){case"\n":++i;continue;case"N":if(!unicode){break;} 7520throw new TokenizerError("SyntaxError: \\N{} escape not implemented");case"u":if(!unicode){break;} 7521var uni=str.slice(i+2,i+6);if(!/[0-9a-f]{4}/i.test(uni)){throw new TokenizerError(["SyntaxError: (unicode error) 'unicodeescape' codec"," can't decode bytes in position ",i,"-",i+4,": truncated \\uXXXX escape",].join(""));} 7522code=parseInt(uni,16);out.push(String.fromCharCode(code));i+=5;continue;case"U":if(!unicode){break;} 7523throw new TokenizerError("SyntaxError: \\U escape not implemented");case"x":var hex=str.slice(i+2,i+4);if(!/[0-9a-f]{2}/i.test(hex)){if(!unicode){throw new TokenizerError("ValueError: invalid \\x escape");} 7524throw new TokenizerError(["SyntaxError: (unicode error) 'unicodeescape'"," codec can't decode bytes in position ",i,"-",i+2,": truncated \\xXX escape",].join(""));} 7525code=parseInt(hex,16);out.push(String.fromCharCode(code));i+=3;continue;default:if(!/[0-8]/.test(escape)){break;} 7526var r=/[0-8]{1,3}/g;r.lastIndex=i+1;var m=r.exec(str);var oct=m[0];code=parseInt(oct,8);out.push(String.fromCharCode(code));i+=oct.length;continue;} 7527out.push("\\");} 7528return out.join("");} 7529const constants=new Set(["None","False","True"]);const comparators=__exports.comparators=["in","not","not in","is","is not","<","<=",">",">=","<>","!=","==",];const binaryOperators=__exports.binaryOperators=["or","and","|","^","&","<<",">>","+","-","*","/","//","%","~","**",".",];const unaryOperators=__exports.unaryOperators=["-"];const symbols=new Set([...["(",")","[","]","{","}",":",","],...["if","else","lambda","="],...comparators,...binaryOperators,...unaryOperators,]);function group(...args){return"("+args.join("|")+")";} 7530const Name="[a-zA-Z_]\\w*";const Whitespace="[ \\f\\t]*";const DecNumber="\\d+(L|l)?";const IntNumber=DecNumber;const Exponent="[eE][+-]?\\d+";const PointFloat=group(`\\d+\\.\\d*(${Exponent})?`,`\\.\\d+(${Exponent})?`);const FloatNumber=group(PointFloat,`\\d+${Exponent}`);const Number=group(FloatNumber,IntNumber);const Operator=group("\\*\\*=?",">>=?","<<=?","<>","!=","//=?","[+\\-*/%&|^=<>]=?","~");const Bracket="[\\[\\]\\(\\)\\{\\}]";const Special="[:;.,`@]";const Funny=group(Operator,Bracket,Special);const ContStr=group("([uU])?'([^\n'\\\\]*(?:\\\\.[^\n'\\\\]*)*)'",'([uU])?"([^\n"\\\\]*(?:\\\\.[^\n"\\\\]*)*)"');const PseudoToken=Whitespace+group(Number,Funny,ContStr,Name);const NumberPattern=new RegExp("^"+Number+"$");const StringPattern=new RegExp("^"+ContStr+"$");const NamePattern=new RegExp("^"+Name+"$");const strip=new RegExp("^"+Whitespace);__exports.tokenize=tokenize;function tokenize(str){const tokens=[];const max=str.length;let start=0;let end=0;const pseudoprog=new RegExp(PseudoToken,"g");while(pseudoprog.lastIndex<max){const pseudomatch=pseudoprog.exec(str);
7530if(!pseudomatch){if(/^\s+$/.test(str.slice(end))){break;} 7531throw new TokenizerError("Failed to tokenize <<"+ 7532str+">> at index "+ 7533(end||0)+"; parsed so far: "+ 7534tokens);} 7535if(pseudomatch.index>end){if(str.slice(end,pseudomatch.index).trim()){throw new TokenizerError("Invalid expression");}} 7536start=pseudomatch.index;end=pseudoprog.lastIndex;let token=str.slice(start,end).replace(strip,"");if(NumberPattern.test(token)){tokens.push({type:0,value:parseFloat(token),});}else if(StringPattern.test(token)){var m=StringPattern.exec(token);tokens.push({type:1,value:decodeStringLiteral(m[3]!==undefined?m[3]:m[5],!!(m[2]||m[4])),});}else if(symbols.has(token)){if(token==="in"&&tokens.length>0&&tokens[tokens.length-1].value==="not"){token="not in";tokens.pop();}else if(token==="not"&&tokens.length>0&&tokens[tokens.length-1].value==="is"){token="is not";tokens.pop();} 7537tokens.push({type:2,value:token,});}else if(constants.has(token)){tokens.push({type:4,value:token,});}else if(NamePattern.test(token)){tokens.push({type:3,value:token,});}else{throw new TokenizerError("Invalid expression");}} 7538return tokens;} 7539return __exports;});; 7540 7541/* /web/static/src/core/py_js/py_utils.js */ 7542odoo.define('@web/core/py_js/py_utils',async function(require){'use strict';let __exports={};const{bp}=require("@web/core/py_js/py_parser");const{PyDate,PyDateTime}=require("@web/core/py_js/py_date");__exports.toPyValue=toPyValue;function toPyValue(value){switch(typeof value){case"string":return{type:1,value};case"number":return{type:0,value};case"boolean":return{type:2,value};case"object":if(Array.isArray(value)){return{type:4,value:value.map(toPyValue)};}else if(value===null){return{type:3};}else if(value instanceof Date){return{type:1,value:PyDateTime.convertDate(value)};}else if(value instanceof PyDate||value instanceof PyDateTime){return{type:1,value};}else{const content={};for(const key in value){content[key]=toPyValue(value[key]);} 7543return{type:11,value:content};} 7544default:throw new Error("Invalid type");}} 7545__exports.formatAST=formatAST;function formatAST(ast,lbp=0){switch(ast.type){case 3:return"None";case 1:return JSON.stringify(ast.value);case 0:return String(ast.value);case 2:return ast.value?"True":"False";case 4:return`[${ast.value.map(formatAST).join(", ")}]`;case 6:if(ast.op==="not"){return`not `+formatAST(ast.right,50);} 7546return ast.op+formatAST(ast.right,130);case 7:{const abp=bp(ast.op);const str=`${formatAST(ast.left, abp)} ${ast.op} ${formatAST(ast.right, abp)}`;return abp<lbp?`(${str})`:str;} 7547case 11:{const pairs=[];for(const k in ast.value){pairs.push(`"${k}": ${formatAST(ast.value[k])}`);} 7548return`{`+pairs.join(", ")+`}`;} 7549case 10:return`(${ast.value.map(formatAST).join(", ")})`;case 5:return ast.value;case 12:{return`${formatAST(ast.target)}[${formatAST(ast.key)}]`;} 7550case 13:{const{ifTrue,condition,ifFalse}=ast;return`${formatAST(ifTrue)} if ${formatAST(condition)} else ${formatAST(ifFalse)}`;} 7551case 14:{const abp=bp(ast.op);const str=`${formatAST(ast.left, abp)} ${ast.op} ${formatAST(ast.right, abp)}`;return abp<lbp?`(${str})`:str;} 7552case 15:return`${formatAST(ast.obj, 150)}.${ast.key}`;case 8:{const args=ast.args.map(formatAST);const kwargs=[];for(const kwarg in ast.kwargs){kwargs.push(`${kwarg} = ${formatAST(ast.kwargs[kwarg])}`);} 7553const argStr=args.concat(kwargs).join(", ");return`${formatAST(ast.fn)}(${argStr})`;}} 7554throw new Error("invalid expression: "+ast);} 7555const PY_DICT=__exports.PY_DICT=Object.create(null);__exports.toPyDict=toPyDict;function toPyDict(obj){return new Proxy(obj,{getPrototypeOf(){return PY_DICT;},});} 7556return __exports;});; 7557 7558/* /web/static/src/core/registry.js */ 7559odoo.define('@web/core/registry',async function(require){'use strict';let __exports={};const{EventBus}=require("@odoo/owl");const KeyNotFoundError=__exports.KeyNotFoundError=class KeyNotFoundError extends Error{} 7560const DuplicatedKeyError=__exports.DuplicatedKeyError=class DuplicatedKeyError extends Error{} 7561const Registry=__exports.Registry=class Registry extends EventBus{constructor(){super();this.content={};this.subRegistries={};this.elements=null;this.entries=null;this.addEventListener("UPDATE",()=>{this.elements=null;this.entries=null;});} 7562add(key,value,{force,sequence}={}){if(!force&&key in this.content){throw new DuplicatedKeyError(`Cannot add '${key}' in this registry: it already exists`);} 7563let previousSequence;if(force){const elem=this.content[key];previousSequence=elem&&elem[0];} 7564sequence=sequence===undefined?previousSequence||50:sequence;this.content[key]=[sequence,value];const payload={operation:"add",key,value};this.trigger("UPDATE",payload);return this;} 7565get(key,defaultValue){if(arguments.length<2&&!(key in this.content)){throw new KeyNotFoundError(`Cannot find ${key} in this registry!`);} 7566const info=this.content[key];return info?info[1]:defaultValue;} 7567contains(key){return key in this.content;} 7568getAll(){if(!this.elements){const content=Object.values(this.content).sort((el1,el2)=>el1[0]-el2[0]);this.elements=content.map((elem)=>elem[1]);} 7569return this.elements.slice();} 7570getEntries(){if(!this.entries){const entries=Object.entries(this.content).sort((el1,el2)=>el1[1][0]-el2[1][0]);this.entries=entries.map(([str,elem])=>[str,elem[1]]);} 7571return this.entries.slice();} 7572remove(key){const value=this.content[key];delete this.content[key];
7572const payload={operation:"delete",key,value};this.trigger("UPDATE",payload);} 7573category(subcategory){if(!(subcategory in this.subRegistries)){this.subRegistries[subcategory]=new Registry();} 7574return this.subRegistries[subcategory];}} 7575const registry=__exports.registry=new Registry();return __exports;});; 7576 7577/* /web/static/src/core/scroller_service.js */ 7578odoo.define('@web/core/scroller_service',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const{scrollTo}=require("@web/core/utils/scrolling");const scrollerService=__exports.scrollerService={start(env){browser.addEventListener("click",(ev)=>{const link=ev.target.closest("a");if(!link){return;} 7579const disableAnchor=link.attributes.getNamedItem("disable_anchor");if(disableAnchor&&disableAnchor.value==="true"){return;} 7580const href=link.attributes.getNamedItem("href");if(href){if(href.value[0]==="#"){if(href.value.length===1){ev.preventDefault();return;} 7581let matchingEl=null;try{matchingEl=document.querySelector(`.o_content #${href.value.substr(1)}`);}catch(_e){} 7582const triggerEv=new CustomEvent("anchor-link-clicked",{detail:{element:matchingEl,id:href.value,originalEv:ev,},});env.bus.trigger("SCROLLER:ANCHOR_LINK_CLICKED",triggerEv);if(matchingEl&&!triggerEv.defaultPrevented){ev.preventDefault();scrollTo(matchingEl,{isAnchor:true});}}}});},};registry.category("services").add("scroller",scrollerService);return __exports;});; 7583 7584/* /web/static/src/core/signature/name_and_signature.js */ 7585odoo.define('@web/core/signature/name_and_signature',async function(require){'use strict';let __exports={};const{isMobileOS}=require("@web/core/browser/feature_detection");const{Dropdown}=require("@web/core/dropdown/dropdown");const{DropdownItem}=require("@web/core/dropdown/dropdown_item");const{useService}=require("@web/core/utils/hooks");const{pick}=require("@web/core/utils/objects");const{renderToString}=require("@web/core/utils/render");const{getDataURLFromFile}=require("@web/core/utils/urls");const{Component,useState,onWillStart,useRef,useEffect}=require("@odoo/owl");let htmlId=0;const NameAndSignature=__exports.NameAndSignature=class NameAndSignature extends Component{setup(){this.rpc=useService("rpc");this.htmlId=htmlId++;this.defaultName=this.props.signature.name||"";this.currentFont=0;this.drawTimeout=null;this.state=useState({signMode:this.props.mode||(this.props.noInputName&&!this.defaultName?"draw":"auto"),showSignatureArea:!!(this.props.noInputName||this.defaultName),showFontList:false,});this.signNameInputRef=useRef("signNameInput");const signInputLoad=useRef("signInputLoad");useEffect((el)=>{if(el){el.click();}},()=>[signInputLoad.el]);onWillStart(async()=>{this.fonts=await this.rpc(`/web/sign/get_fonts/${this.props.defaultFont}`);});this.signatureRef=useRef("signature");useEffect((el)=>{if(el){this.$signatureField=$(".o_web_sign_signature");this.$signatureField.on("change",()=>{this.props.signature.isSignatureEmpty=this.isSignatureEmpty;});this.jSignature();this.resetSignature();this.props.signature.getSignatureImage=()=>this.jSignature("getData","image");if(this.state.signMode==="auto"){this.drawCurrentName();}}},()=>[this.signatureRef.el]);} 7586drawCurrentName(){const font=this.fonts[this.currentFont];const text=this.getCleanedName();const canvas=this.signatureRef.el.querySelector("canvas");const img=this.getSVGText(font,text,canvas.width,canvas.height);this.printImage(img);} 7587focusName(){if(!isMobileOS()&&this.signNameInputRef.el){this.signNameInputRef.el.focus();}} 7588getCleanedName(){const text=this.props.signature.name;if(this.props.signatureType==="initial"&&text){return(text.split(" ").map(function(w){return w[0];}).join(".")+".");} 7589return text;} 7590getSVGText(font,text,width,height){const svg=renderToString("web.sign_svg_text",{width:width,height:height,font:font,text:text,type:this.props.signatureType,color:this.props.fontColor,});return"data:image/svg+xml,"+encodeURI(svg);} 7591getSVGTextFont(font){const height=100;const width=parseInt(height*this.props.displaySignatureRatio);
7591return this.getSVGText(font,this.getCleanedName(),width,height);} 7592jSignature(){return this.$signatureField.jSignature(...arguments);} 7593async onChangeSignLoadInput(ev){var file=ev.target.files[0];if(file===undefined){return false;} 7594if(file.type.substr(0,5)!=="image"){this.jSignature("reset");this.state.loadIsInvalid=true;return false;} 7595this.state.loadIsInvalid=false;const result=await getDataURLFromFile(file);this.printImage(result);} 7596onClickSignAutoSelectStyle(){this.state.showFontList=true;} 7597onClickSignDrawClear(){this.jSignature("reset");} 7598onInputSignName(ev){this.props.signature.name=ev.target.value;if(!this.state.showSignatureArea&&this.getCleanedName()){this.state.showSignatureArea=true;return;} 7599if(this.state.signMode==="auto"){this.drawCurrentName();}} 7600onSelectFont(index){this.currentFont=this.fonts[index];this.drawCurrentName();} 7601printImage(imgSrc){const image=new Image();image.onload=()=>{clearTimeout(this.drawTimeout);this.drawTimeout=setTimeout(()=>{let width=0;let height=0;const ratio=image.width/image.height;const signatureEl=this.signatureRef.el;if(!signatureEl){return;} 7602const canvas=signatureEl.querySelector("canvas");const context=canvas.getContext("2d");if(image.width/canvas.width>image.height/canvas.height){width=canvas.width;height=parseInt(width/ratio);}else{height=canvas.height;width=parseInt(height*ratio);} 7603this.jSignature("reset");const ignoredContext=pick(context,"shadowOffsetX","shadowOffsetY");Object.assign(context,{shadowOffsetX:0,shadowOffsetY:0});context.drawImage(image,0,0,image.width,image.height,(canvas.width-width)/2,(canvas.height-height)/2,width,height);Object.assign(context,ignoredContext);this.props.signature.isSignatureEmpty=this.isSignatureEmpty;return this.isSignatureEmpty;},0);};image.src=imgSrc;} 7604resetSignature(){const{width,height}=this.resizeSignature();this.$signatureField.empty().jSignature({"decor-color":"#D1D0CE","background-color":"rgba(255,255,255,0)","show-stroke":false,color:this.props.fontColor,lineWidth:2,width:width,height:height,});this.emptySignature=this.jSignature("getData");this.setMode(this.state.signMode,true);this.focusName();} 7605resizeSignature(){this.signatureRef.el.style.width="unset";const width=this.signatureRef.el.clientWidth;const height=parseInt(width/this.props.displaySignatureRatio);this.state.signature={width,height,};Object.assign(this.signatureRef.el.querySelector("canvas").style,{width,height});return{width,height};} 7606async setMode(mode,reset){if(reset!==true&&mode===this.signMode){return;} 7607this.state.signMode=mode;this.jSignature(this.state.signMode==="draw"?"enable":"disable");this.jSignature("reset");if(this.state.signMode==="auto"){this.drawCurrentName();}} 7608get isSignatureEmpty(){const signature=this.jSignature("getData");return signature&&this.emptySignature?this.emptySignature===signature:true;} 7609get loadIsInvalid(){return this.state.signMode==="load"&&this.state.loadIsInvalid;} 7610get signatureStyle(){const{signature}=this.state;return signature?`width: ${signature.width}px; height: ${signature.height}px`:"";}} 7611NameAndSignature.template="web.NameAndSignature";NameAndSignature.components={Dropdown,DropdownItem};NameAndSignature.props={signature:{type:Object},defaultFont:{type:String,optional:true},displaySignatureRatio:{type:Number,optional:true},fontColor:{type:String,optional:true},signatureType:{type:String,optional:true},noInputName:{type:Boolean,optional:true},mode:{type:String,optional:true},};NameAndSignature.defaultProps={defaultFont:"",displaySignatureRatio:3.0,fontColor:"DarkBlue",signatureType:"signature",noInputName:false,};return __exports;});; 7612 7613/* /web/static/src/core/signature/signature_dialog.js */ 7614odoo.define('@web/core/signature/signature_dialog',async function(require){'use strict';let __exports={};const{Dialog}=require("@web/core/dialog/dialog");const{NameAndSignature}=require("@web/core/signature/name_and_signature");const{Component,useState}=require("@odoo/owl");const SignatureDialog=__exports.SignatureDialog=class SignatureDialog extends Component{setup(){this.title=this.env._t("Adopt Your Signature");this.signature=useState({name:this.props.defaultName,isSignatureEmpty:true,});} 7615onClickConfirm(){this.props.uploadSignature({name:this.signature.name,signatureImage:this.signature.getSignatureImage(),});this.props.close();} 7616get nameAndSignatureProps(){return{...this.props.nameAndSignatureProps,signature:this.signature,};}} 7617SignatureDialog.template="web.SignatureDialog";SignatureDialog.components={Dialog,NameAndSignature};SignatureDialog.defaultProps={defaultName:"",};return __exports;});; 7618 7619/* /web/static/src/core/tooltip/tooltip.js */ 7620odoo.define('@web/core/tooltip/tooltip',async function(require){'use strict';let __exports={};const{Component}=require("@odoo/owl");const Tooltip=__exports.Tooltip=class Tooltip extends Component{} 7621Tooltip.template="web.Tooltip";Tooltip.props={close:Function,tooltip:{type:String,optional:true},template:{type:String,optional:true},info:{optional:true},};return __exports;});; 7622 7623/* /web/static/src/core/tooltip/tooltip_hook.js */ 7624odoo.define('@web/core/tooltip/tooltip_hook',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{useEffect,useRef}=require("@odoo/owl");__exports.useTooltip=useTooltip;function useTooltip(refName,params){const tooltip=useService("tooltip");const ref=useRef(refName);useEffect((el)=>tooltip.add(el,params),()=>[ref.el]);} 7625return __exports;});; 7626 7627/* /web/static/src/core/tooltip/tooltip_service.js */ 7628odoo.define('@web/core/tooltip/tooltip_service',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const{Tooltip}=require("@web/core/tooltip/tooltip");const{hasTouch}=require("@web/core/browser/feature_detection");const{whenReady}=require("@odoo/owl");const OPEN_DELAY=400;const CLOSE_DELAY=200;const tooltipService=__exports.tooltipService={dependencies:["popover"],start(env,{popover}){let openTooltipTimeout;let closeTooltip;let target=null;let touchPressed;const elementsWithTooltips=new WeakMap();function cleanup(){target=null;browser.clearTimeout(openTooltipTimeout);openTooltipTimeout=null;if(closeTooltip){closeTooltip();closeTooltip=null;}} 7629function shouldCleanup(){if(!target){return false;} 7630if(!document.body.contains(target)){return true;} 7631if(hasTouch()){return!touchPressed;} 7632return false;} 7633function openTooltip(el,{tooltip="",template,info,position,delay=OPEN_DELAY}){cleanup();if(!tooltip&&!template){return;} 7634target=el;openTooltipTimeout=browser.setTimeout(()=>{if(target.isConnected){closeTooltip=popover.add(target,Tooltip,{tooltip,template,info},{position});target.title="";}},delay);} 7635function openElementsTooltip(el){if(elementsWithTooltips.has(el)){openTooltip(el,elementsWithTooltips.get(el));}else if(el.matches("[data-tooltip], [data-tooltip-template]")){const dataset=el.dataset;const params={tooltip:dataset.tooltip,template:dataset.tooltipTemplate,position:dataset.tooltipPosition,};if(dataset.tooltipInfo){params.info=JSON.parse(dataset.tooltipInfo);} 7636if(dataset.tooltipDelay){params.delay=parseInt(dataset.tooltipDelay,10);} 7637openTooltip(el,params);}} 7638function onMouseenter(ev){openElementsTooltip(ev.target);} 7639function onMouseleave(ev){if(target===ev.target){cleanup();}} 7640function onTouchStart(ev){touchPressed=true;openElementsTooltip(ev.target);} 7641whenReady(()=>{browser.setInterval(()=>{if(shouldCleanup()){cleanup();}},CLOSE_DELAY);if(hasTouch()){document.body.addEventListener("touchstart",onTouchStart);document.body.addEventListener("touchend",(ev)=>{if(ev.target.matches("[data-tooltip], [data-tooltip-template]")){if(!ev.target.dataset.tooltipTouchTapToShow){touchPressed=false;}}});document.body.addEventListener("touchcancel",(ev)=>{if(ev.target.matches("[data-tooltip], [data-tooltip-template]")){if(!ev.target.dataset.tooltipTouchTapToShow){touchPressed=false;}}});return;} 7642document.body.addEventListener("mouseenter",onMouseenter,{capture:true});document.body.addEventListener("mouseleave",onMouseleave,{capture:true});});return{add(el,params){elementsWithTooltips.set(el,params);return()=>{elementsWithTooltips.delete(el);if(target===el){cleanup();}};},};},};registry.category("services").add("tooltip",tooltipService);return __exports;});; 7643 7644/* /web/static/src/core/transition.js */ 7645odoo.define('@web/core/transition',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{Component,useState,useEffect,xml,onWillUpdateProps,useComponent}=require("@odoo/owl");const config=__exports.config={disabled:false,};__exports.useTransition=useTransition;function useTransition({name,initialVisibility=true,leaveDuration=500,onLeave=()=>{},}){const component=useComponent();const state=useState({shouldMount:initialVisibility,stage:initialVisibility?"enter":"leave",});if(config.disabled){return{get shouldMount(){return state.shouldMount;},set shouldMount(val){state.shouldMount=val;},get className(){return`${name} ${name}-enter-active`;},get stage(){return"enter-active";},};} 7646let onNextPatch=null;useEffect(()=>{if(onNextPatch){onNextPatch();onNextPatch=null;}});let prevState,timer;const transition={get shouldMount(){return state.shouldMount;},set shouldMount(newState){if(newState===prevState){return;} 7647browser.clearTimeout(timer);prevState=newState;if(newState){state.stage="enter";state.shouldMount=true;component.render();onNextPatch=()=>{state.stage="enter-active";};}else{state.stage="leave";timer=browser.setTimeout(()=>{state.shouldMount=false;onLeave();},leaveDuration);}},get className(){return`${name} ${name}-${state.stage}`;},get stage(){return state.stage;},};transition.shouldMount=initialVisibility;return transition;} 7648const Transition=__exports.Transition=class Transition extends Component{setup(){const{visible,leaveDuration,name,onLeave}=this.props;this.transition=useTransition({initialVisibility:visible,leaveDuration,name,onLeave,});onWillUpdateProps(({visible=true})=>{this.transition.shouldMount=visible;});}} 7649Transition.template=xml`<t t-slot="default" t-if="transition.shouldMount" className="transition.className"/>`;Transition.props={name:String,visible:{type:Boolean,optional:true},leaveDuration:{type:Number,optional:true},onLeave:{type:Function,optional:true},slots:Object,};return __exports;});; 7650 7651/* /web/static/src/core/ui/block_ui.js */ 7652odoo.define('@web/core/ui/block_ui',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{Component,useState,xml}=require("@odoo/owl");const BlockUI=__exports.BlockUI=class BlockUI extends Component{setup(){this.messagesByDuration=[{time:20,l1:this.env._t("Loading...")},{time:40,l1:this.env._t("Still loading...")},{time:60,l1:this.env._t("Still loading..."),l2:this.env._t("Please be patient."),},{time:180,l1:this.env._t("Don't leave yet,"),l2:this.env._t("it's still loading..."),},{time:120,l1:this.env._t("You may not believe it,"),l2:this.env._t("but the application is actually loading..."),},{time:3180,l1:this.env._t("Take a minute to get a coffee,"),l2:this.env._t("because it's loading..."),},{time:null,l1:this.env._t("Maybe you should consider reloading the application by pressing F5..."),},];this.state=useState({blockUI:false,line1:"",line2:"",});this.props.bus.addEventListener("BLOCK",this.block.bind(this));this.props.bus.addEventListener("UNBLOCK",this.unblock.bind(this));} 7653replaceMessage(index){const message=this.messagesByDuration[index];this.state.line1=message.l1;this.state.line2=message.l2||"";if(message.time!==null){this.msgTimer=browser.setTimeout(()=>{this.replaceMessage(index+1);},message.time*1000);}} 7654block(){this.state.blockUI=true;this.replaceMessage(0);} 7655unblock(){this.state.blockUI=false;clearTimeout(this.msgTimer);this.state.line1="";this.state.line2="";}} 7656BlockUI.template=xml` 7657 <div t-att-class="state.blockUI ? 'o_blockUI fixed-top d-flex justify-content-center align-items-center flex-column vh-100 bg-black-50' : ''"> 7658 <t t-if="state.blockUI"> 7659 <div class="o_spinner mb-4"> 7660 <img src="/web/static/img/spin.svg" alt="Loading..."/> 7661 </div> 7662 <div class="o_message text-center px-4"> 7663 <t t-esc="state.line1"/> <br/> 7664 <t t-esc="state.line2"/> 7665 </div> 7666 </t> 7667 </div>`;return __exports;});; 7668 7669/* /web/static/src/core/ui/ui_service.js */ 7670odoo.define('@web/core/ui/ui_service',async function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{registry}=require("@web/core/registry");const{debounce}=require("@web/core/utils/timing");const{BlockUI}=require("@web/core/ui/block_ui");const{browser}=require("@web/core/browser/browser");const{getTabableElements}=require("@web/core/utils/ui");const{getActiveHotkey}
7670=require("@web/core/hotkeys/hotkey_service");const{EventBus,useEffect,useRef}=require("@odoo/owl");const SIZES=__exports.SIZES={XS:0,VSM:1,SM:2,MD:3,LG:4,XL:5,XXL:6};__exports.useActiveElement=useActiveElement;function useActiveElement(refName){if(!refName){throw new Error("refName not given to useActiveElement");} 7671const uiService=useService("ui");const owner=useRef(refName);function trapFocus(e){const hotkey=getActiveHotkey(e);if(!["tab","shift+tab"].includes(hotkey)){return;} 7672const el=e.currentTarget;const tabableEls=getTabableElements(el);const firstTabableEl=tabableEls[0]||el;const lastTabableEl=tabableEls[tabableEls.length-1]||el;switch(hotkey){case"tab":if(document.activeElement===lastTabableEl){firstTabableEl.focus();e.preventDefault();e.stopPropagation();} 7673break;case"shift+tab":if(document.activeElement===firstTabableEl){lastTabableEl.focus();e.preventDefault();e.stopPropagation();} 7674break;}} 7675useEffect((el)=>{if(el){const oldActiveElement=document.activeElement;uiService.activateElement(el);const tabableEls=getTabableElements(el);if(tabableEls.length===0&&el.tabIndex<0){el.tabIndex=-1;} 7676const firstTabableEl=tabableEls[0]||el;el.addEventListener("keydown",trapFocus);if(!el.contains(document.activeElement)){firstTabableEl.focus();} 7677return()=>{uiService.deactivateElement(el);el.removeEventListener("keydown",trapFocus);if(el.contains(document.activeElement)){oldActiveElement.focus();}};}},()=>[owner.el]);} 7678const MEDIAS_BREAKPOINTS=__exports.MEDIAS_BREAKPOINTS=[{maxWidth:474},{minWidth:475,maxWidth:575},{minWidth:576,maxWidth:767},{minWidth:768,maxWidth:991},{minWidth:992,maxWidth:1199},{minWidth:1200,maxWidth:1533},{minWidth:1534},];__exports.getMediaQueryLists=getMediaQueryLists;function getMediaQueryLists(){return MEDIAS_BREAKPOINTS.map(({minWidth,maxWidth})=>{if(!maxWidth){return window.matchMedia(`(min-width: ${minWidth}px)`);} 7679if(!minWidth){return window.matchMedia(`(max-width: ${maxWidth}px)`);} 7680return window.matchMedia(`(min-width: ${minWidth}px) and (max-width: ${maxWidth}px)`);});} 7681const MEDIAS=getMediaQueryLists();const uiService=__exports.uiService={getSize(){return MEDIAS.findIndex((media)=>media.matches);},start(env){const bus=new EventBus();registry.category("main_components").add("BlockUI",{Component:BlockUI,props:{bus}});let blockCount=0;function block(){blockCount++;if(blockCount===1){bus.trigger("BLOCK");}} 7682function unblock(){blockCount--;if(blockCount<0){console.warn("Unblock ui was called more times than block, you should only unblock the UI if you have previously blocked it.");blockCount=0;} 7683if(blockCount===0){bus.trigger("UNBLOCK");}} 7684let activeElems=[document];function activateElement(el){activeElems.push(el);bus.trigger("active-element-changed",el);} 7685function deactivateElement(el){activeElems=activeElems.filter((x)=>x!==el);bus.trigger("active-element-changed",ui.activeElement);} 7686function getActiveElementOf(el){for(const activeElement of[...activeElems].reverse()){if(activeElement.contains(el)){return activeElement;}}} 7687const ui={bus,size:this.getSize(),get activeElement(){return activeElems[activeElems.length-1];},get isBlocked(){return blockCount>0;},get isSmall(){return ui.size<=SIZES.SM;},block,unblock,activateElement,deactivateElement,getActiveElementOf,};const updateSize=()=>{const prevSize=ui.size;ui.size=this.getSize();if(ui.size!==prevSize){bus.trigger("resize");}};browser.addEventListener("resize",debounce(updateSize,100));Object.defineProperty(env,"isSmall",{get(){return ui.isSmall;},});return ui;},};registry.category("services").add("ui",uiService);return __exports;});; 7688 7689/* /web/static/src/core/user_service.js */ 7690odoo.define('@web/core/user_service',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{session}=require("@web/session");const userService=__exports.userService={dependencies:["rpc"],async:["hasGroup"],start(env,{rpc}){const groupProms={};const context={...session.user_context,uid:session.uid||session.user_id,};return{get context(){return Object.assign({},context);},removeFromContext(key){delete context[key];},updateContext(update){Object.assign(context,update);}
7690,hasGroup(group){if(!context.uid){return Promise.resolve(false);} 7691if(!groupProms[group]){groupProms[group]=rpc("/web/dataset/call_kw/res.users/has_group",{model:"res.users",method:"has_group",args:[group],kwargs:{context},});} 7692return groupProms[group];},name:session.name,userName:session.username,isAdmin:session.is_admin,isSystem:session.is_system,partnerId:session.partner_id,home_action_id:session.home_action_id,showEffect:session.show_effect,get userId(){return context.uid;},get lang(){return context.lang;},get tz(){return context.tz;},get db(){const res={name:session.db,};if("dbuuid"in session){res.uuid=session.dbuuid;} 7693return res;},};},};registry.category("services").add("user",userService);return __exports;});; 7694 7695/* /web/static/src/core/utils/arrays.js */ 7696odoo.define('@web/core/utils/arrays',async function(require){'use strict';let __exports={};function _cartesian(){const args=Array.prototype.slice.call(arguments);if(args.length===0){return[undefined];} 7697const firstArray=args[0].map(function(elem){return[elem];});if(args.length===1){return firstArray;} 7698const productOfOtherArrays=_cartesian.apply(null,args.slice(1));return firstArray.reduce(function(acc,elem){return acc.concat(productOfOtherArrays.map(function(tuple){return elem.concat(tuple);}));},[]);} 7699function _getExtractorFrom(criterion){if(criterion){switch(typeof criterion){case"string":return(element)=>element[criterion];case"function":return criterion;default:throw new Error(`Expected criterion of type 'string' or 'function' and got '${typeof criterion}'`);}}else{return(element)=>element;}} 7700__exports.intersection=intersection;function intersection(array1,array2){return array1.filter((v)=>array2.includes(v));} 7701__exports.groupBy=groupBy;function groupBy(array,criterion){const extract=_getExtractorFrom(criterion);const groups={};for(const element of array){const group=String(extract(element));if(!(group in groups)){groups[group]=[];} 7702groups[group].push(element);} 7703return groups;} 7704__exports.sortBy=sortBy;function sortBy(array,criterion,order="asc"){const extract=_getExtractorFrom(criterion);return array.slice().sort((elA,elB)=>{const a=extract(elA);const b=extract(elB);let result;if(isNaN(a)&&isNaN(b)){result=a>b?1:a<b?-1:0;}else{result=a-b;} 7705return order==="asc"?result:-result;});} 7706__exports.symmetricalDifference=symmetricalDifference;function symmetricalDifference(arrayA,arrayB){return arrayA.filter((id)=>!arrayB.includes(id)).concat(arrayB.filter((id)=>!arrayA.includes(id)));} 7707__exports.cartesian=cartesian;function cartesian(){const args=Array.prototype.slice.call(arguments);if(args.length===0){return[undefined];}else if(args.length===1){return args[0];}else{return _cartesian.apply(null,args);}} 7708__exports.shallowEqual=shallowEqual;function shallowEqual(arrayA,arrayB){if(arrayA.length!==arrayB.length){return false;} 7709for(let i=0;i<arrayA.length;i++){if(arrayA[i]!==arrayB[i]){return false;}} 7710return true;} 7711__exports.sections=sections;function sections(array){const sections=[];for(let i=0;i<array.length+1;i++){sections.push(array.slice(0,i));} 7712return sections;} 7713__exports.unique=unique;function unique(array){return Array.from(new Set(array));} 7714return __exports;});; 7715 7716/* /web/static/src/core/utils/binary.js */ 7717odoo.define('@web/core/utils/binary',async function(require){'use strict';let __exports={};__exports.isBinarySize=isBinarySize;function isBinarySize(value){return/^\d+(\.\d*)? [^0-9]+$/.test(value);} 7718__exports.toBase64Length=toBase64Length;function toBase64Length(maxBytes){return Math.ceil(maxBytes*4/3);} 7719return __exports;});; 7720 7721/* /web/static/src/core/utils/components.js */ 7722odoo.define('@web/core/utils/components',async function(require){'use strict';let __exports={};const{Component,onError,xml,useSubEnv}=require("@odoo/owl");const ErrorHandler=__exports.ErrorHandler=class ErrorHandler extends Component{setup(){onError((error)=>{this.props.onError(error);});}} 7723ErrorHandler.template=xml`<t t-slot="default" />`;ErrorEvent.props=["onError"];const WithEnv=__exports.WithEnv=class WithEnv extends Component{setup(){useSubEnv(this.props.env);}} 7724WithEnv.template=xml`<t t-slot="default"/>`;return __exports;});; 7725 7726/* /web/static/src/core/utils/concurrency.js */ 7727odoo.define('@web/core/utils/concurrency',async function(require){'use strict';let __exports={};const KeepLast=__exports.KeepLast=class KeepLast{constructor(){this._id=0;} 7728add(promise){this._id++;const currentId=this._id;return new Promise((resolve,reject)=>{promise.then((value)=>{if(this._id===currentId){resolve(value);}}).catch((reason)=>
7728{if(this._id===currentId){reject(reason);}});});}} 7729const Mutex=__exports.Mutex=class Mutex{constructor(){this._lock=Promise.resolve();this._queueSize=0;this._unlockedProm=undefined;this._unlock=undefined;} 7730async exec(action){this._queueSize++;if(!this._unlockedProm){this._unlockedProm=new Promise((resolve)=>{this._unlock=()=>{resolve();this._unlockedProm=undefined;};});} 7731const always=()=>{return Promise.resolve(action()).finally(()=>{if(--this._queueSize===0){this._unlock();}});};this._lock=this._lock.then(always,always);return this._lock;} 7732getUnlockedDef(){return this._unlockedProm||Promise.resolve();}} 7733const Race=__exports.Race=class Race{constructor(){this.currentProm=null;this.currentPromResolver=null;this.currentPromRejecter=null;} 7734add(promise){if(!this.currentProm){this.currentProm=new Promise((resolve,reject)=>{this.currentPromResolver=(value)=>{this.currentProm=null;this.currentPromResolver=null;this.currentPromRejecter=null;resolve(value);};this.currentPromRejecter=(error)=>{this.currentProm=null;this.currentPromResolver=null;this.currentPromRejecter=null;reject(error);};});} 7735promise.then(this.currentPromResolver).catch(this.currentPromRejecter);return this.currentProm;} 7736getCurrentProm(){return this.currentProm;}} 7737const Deferred=__exports.Deferred=class Deferred{constructor(){let resolve;let reject;const prom=new Promise((res,rej)=>{resolve=res;reject=rej;});return Object.assign(prom,{resolve,reject});}} 7738return __exports;});; 7739 7740/* /web/static/src/core/utils/draggable.js */ 7741odoo.define('@web/core/utils/draggable',async function(require){'use strict';let __exports={};const{makeDraggableHook}=require("@web/core/utils/draggable_hook_builder");const useDraggable=__exports.useDraggable=makeDraggableHook({name:"useDraggable",onDragStart({ctx,helpers}){helpers.execHandler("onDragStart",{element:ctx.currentElement});},onDrag({ctx,helpers}){helpers.execHandler("onDrag",{element:ctx.currentElement});},onDragEnd({ctx,helpers}){helpers.execHandler("onDragEnd",{element:ctx.currentElement});},onDrop({ctx,helpers}){helpers.execHandler("onDrop",{element:ctx.currentElement});},});return __exports;});; 7742 7743/* /web/static/src/core/utils/draggable_hook_builder.js */ 7744odoo.define('@web/core/utils/draggable_hook_builder',async function(require){'use strict';let __exports={};const{clamp}=require("@web/core/utils/numbers");const{debounce,setRecurringAnimationFrame}=require("@web/core/utils/timing");const{useEffect,useEnv,useExternalListener,onWillUnmount,reactive}=require("@odoo/owl");const DEFAULT_ACCEPTED_PARAMS={enable:["boolean","function"],ref:["object"],elements:["string"],handle:["string","function"],ignore:["string","function"],cursor:["string"],edgeScrolling:["object","function"],};const DEFAULT_DEFAULT_PARAMS={enable:true,edgeScrolling:{speed:10,threshold:30,},};const LEFT_CLICK=0;const MANDATORY_PARAMS=["ref","elements"];function cancelEvent(ev){ev.stopPropagation();ev.stopImmediatePropagation();ev.preventDefault();} 7745function getRect(el,options={}){const rect=el.getBoundingClientRect();if(options.adjust){const style=getComputedStyle(el);const[pl,pr,pt,pb]=["padding-left","padding-right","padding-top","padding-bottom",].map((prop)=>pixelValueToNumber(style.getPropertyValue(prop)));rect.x+=pl;rect.y+=pt;rect.width-=pl+pr;rect.height-=pt+pb;} 7746return rect;} 7747function getScrollParents(el){return[getScrollParentX(el),getScrollParentY(el)];} 7748function getScrollParentX(el){if(!el){return null;} 7749if(el.scrollWidth>el.clientWidth){const overflow=getComputedStyle(el).getPropertyValue("overflow");if(/\bauto\b|\bscroll\b/.test(overflow)){return el;}} 7750return getScrollParentX(el.parentElement);} 7751function getScrollParentY(el){if(!el){return null;} 7752if(el.scrollHeight>el.clientHeight){const overflow=getComputedStyle(el).getPropertyValue("overflow");if(/\bauto\b|\bscroll\b/.test(overflow)){return el;}} 7753return getScrollParentY(el.parentElement);} 7754function pixelValueToNumber(val){return Number(val.endsWith("px")?val.slice(0,-2):val);} 7755__exports.makeDraggableHook=makeDraggableHook;function makeDraggableHook(hookParams={}){const hookName=hookParams.name||"useAnonymousDraggable";const allAcceptedParams={...DEFAULT_ACCEPTED_PARAMS,...hookParams.acceptedParams};const defaultParams={...DEFAULT_DEFAULT_PARAMS,...hookParams.defaultParams};
7755const computeParams=(params)=>{const computedParams={enable:true};for(const prop in allAcceptedParams){if(prop in params){computedParams[prop]=params[prop];if(typeof params[prop]==="function"){computedParams[prop]=computedParams[prop]();}}} 7756return Object.entries(computedParams);};const makeError=(reason)=>new Error(`Error in hook ${hookName}: ${reason}.`);return{[hookName](params){const addListener=(el,event,callback,options)=>{el.addEventListener(event,callback,options);cleanups.push(()=>el.removeEventListener(event,callback,options));};const addStyle=(el,style)=>{const originalStyle=el.getAttribute("style");cleanups.push(()=>originalStyle?el.setAttribute("style",originalStyle):el.removeAttribute("style"));for(const key in style){el.style[key]=style[key];}};const canDrag=(ev)=>{return(ctx.origin&&Math.hypot(ev.clientX-ctx.origin.x,ev.clientY-ctx.origin.y)>=ctx.pixelsTolerance);};const dragStart=()=>{state.dragging=true;[ctx.currentScrollParentX,ctx.currentScrollParentY]=getScrollParents(ctx.currentContainer);const[eRect]=updateRects();for(const siblingEl of ctx.ref.el.querySelectorAll(ctx.elementSelector)){if(siblingEl!==ctx.currentElement){addStyle(siblingEl,{"pointer-events":"auto"});}} 7757ctx.offset.x-=eRect.x;ctx.offset.y-=eRect.y;addStyle(ctx.currentElement,{position:"fixed","pointer-events":"none","z-index":1000,width:`${eRect.width}px`,height:`${eRect.height}px`,left:`${eRect.x}px`,top:`${eRect.y}px`,});const bodyStyle={"pointer-events":"none","user-select":"none",};if(ctx.cursor){bodyStyle.cursor=ctx.cursor;} 7758addStyle(document.body,bodyStyle);if((ctx.currentScrollParentX||ctx.currentScrollParentY)&&ctx.edgeScrolling.enabled){const cleanupFn=setRecurringAnimationFrame(handleEdgeScrolling);cleanups.push(cleanupFn);} 7759execBuildHandler("onDragStart");};const dragEnd=(cancelled,inErrorState)=>{if(state.dragging){if(!inErrorState){execBuildHandler("onDragEnd");if(!cancelled){execBuildHandler("onDrop");}}} 7760execBuildHandler("onCleanup");while(cleanups.length){cleanups.pop()();} 7761ctx.currentContainer=null;ctx.currentElement=null;ctx.currentElementRect=null;ctx.origin=null;ctx.currentScrollParentX=null;ctx.currentScrollParentY=null;state.dragging=false;};const execBuildHandler=(fnName,arg)=>{if(typeof hookParams[fnName]==="function"){hookParams[fnName]({ctx,helpers:buildHelpers,...arg});}};const execHandler=(callbackName,arg)=>{if(typeof params[callbackName]==="function"){try{params[callbackName]({...ctx.mouse,...arg});}catch(err){dragEnd(true,true);throw err;}}};const handleEdgeScrolling=(deltaTime)=>{const[eRect,,xRect,yRect]=updateRects();const{speed,threshold}=ctx.edgeScrolling;const correctedSpeed=(speed/16)*deltaTime;const diff={};if(xRect){const maxWidth=xRect.x+xRect.width;if(eRect.x-xRect.x<threshold){diff.x=[eRect.x-xRect.x,-1];}else if(maxWidth-eRect.x-eRect.width<threshold){diff.x=[maxWidth-eRect.x-eRect.width,1];}} 7762if(yRect){const maxHeight=yRect.y+yRect.height;if(eRect.y-yRect.y<threshold){diff.y=[eRect.y-yRect.y,-1];}else if(maxHeight-eRect.y-eRect.height<threshold){diff.y=[maxHeight-eRect.y-eRect.height,1];}} 7763const diffToScroll=([delta,sign])=>(1-clamp(delta,0,threshold)/threshold)*correctedSpeed*sign;if(diff.y){ctx.currentScrollParentY.scrollBy({top:diffToScroll(diff.y)});} 7764if(diff.x){ctx.currentScrollParentX.scrollBy({left:diffToScroll(diff.x)});}};const onKeydown=(ev)=>{if(!ctx.enabled||!state.dragging){return;} 7765switch(ev.key){case"Escape":case"Tab":{cancelEvent(ev);dragEnd(true);}}};const onMousedown=(ev)=>{updateMousePosition(ev);dragEnd(true);if(ev.button!==LEFT_CLICK||!ctx.enabled||!ev.target.closest(ctx.fullSelector)||(ctx.ignoreSelector&&ev.target.closest(ctx.ignoreSelector))){return;} 7766ev.preventDefault();ctx.currentContainer=ctx.ref.el;ctx.currentElement=ev.target.closest(ctx.elementSelector);ctx.origin={x:ev.clientX,y:ev.clientY,};Object.assign(ctx.offset,ctx.mouse);execBuildHandler("onWillStartDrag");};const onMousemove=(ev)=>{if(!ctx.enabled||!ctx.currentElement){return;} 7767if(!state.dragging){if(canDrag(ev)){dragStart();}} 7768updateMousePosition(ev);if(state.dragging){const[eRect,cRect]=updateRects();ctx.currentElement.style.left=`${clamp( 7769 ctx.mouse.x - ctx.offset.x, 7770 cRect.x, 7771 cRect.x + cRect.width - eRect.width 7772 )}px`;ctx.currentElement.style.top=`${clamp( 7773 ctx.mouse.y - ctx.offset.y, 7774 cRect.y, 7775 cRect.y + cRect.height - eRect.height 7776 )}px`;execBuildHandler("onDrag");}};const onMouseup=(ev)=>{updateMousePosition(ev);dragEnd(false);};const updateMousePosition=(ev)=>{ctx.mouse.x=ev.clientX;ctx.mouse.y=ev.clientY;};const updateRects=()=>{const containerRect=getRect(ctx.currentContainer,{adjust:true});containerRect.width=ctx.currentContainer.scrollWidth;containerRect.height=ctx.currentContainer.scrollHeight;
7776let scrollParentXRect=null;let scrollParentYRect=null;if(ctx.edgeScrolling.enabled){if(ctx.currentScrollParentX){scrollParentXRect=getRect(ctx.currentScrollParentX,{adjust:true});const right=Math.min(containerRect.left+ctx.currentContainer.scrollWidth,scrollParentXRect.right);containerRect.x=Math.max(containerRect.x,scrollParentXRect.x);containerRect.width=right-containerRect.x;} 7777if(ctx.currentScrollParentY){scrollParentYRect=getRect(ctx.currentScrollParentY,{adjust:true});const bottom=Math.min(containerRect.top+ctx.currentContainer.scrollHeight,scrollParentYRect.bottom);containerRect.y=Math.max(containerRect.y,scrollParentYRect.y);containerRect.height=bottom-containerRect.y;}} 7778ctx.currentElementRect=getRect(ctx.currentElement);return[ctx.currentElementRect,containerRect,scrollParentXRect,scrollParentYRect];};const env=useEnv();const state=reactive({dragging:false});for(const prop in allAcceptedParams){if(params[prop]&&!allAcceptedParams[prop].includes(typeof params[prop])){throw makeError(`invalid type for property "${prop}" in parameters`);}else if(!params[prop]&&MANDATORY_PARAMS.includes(prop)){throw makeError(`missing required property "${prop}" in parameters`);}} 7779const buildHelpers={addListener,addStyle,execHandler};const cleanups=[];const ctx={ref:params.ref,ignoreSelector:null,fullSelector:null,cursor:null,currentContainer:null,currentElement:null,currentElementRect:null,scrollParent:null,enabled:false,mouse:{x:0,y:0},offset:{x:0,y:0},edgeScrolling:{enabled:true},pixelsTolerance:10,};useEffect((...deps)=>{const actualParams={...defaultParams,...Object.fromEntries(deps)};ctx.enabled=Boolean(ctx.ref.el&&!env.isSmall&&actualParams.enable);if(!ctx.enabled){return;} 7780ctx.elementSelector=actualParams.elements;if(!ctx.elementSelector){throw makeError(`no value found by "elements" selector: ${ctx.elementSelector}`);} 7781const allSelectors=[ctx.elementSelector];ctx.cursor=actualParams.cursor||null;if(actualParams.handle){allSelectors.push(actualParams.handle);} 7782if(actualParams.ignore){ctx.ignoreSelector=actualParams.ignore;} 7783ctx.fullSelector=allSelectors.join(" ");Object.assign(ctx.edgeScrolling,actualParams.edgeScrolling);execBuildHandler("onComputeParams",{params:actualParams});},()=>computeParams(params));useEffect((el)=>{if(el){el.addEventListener("mousedown",onMousedown);return()=>el.removeEventListener("mousedown",onMousedown);}},()=>[ctx.ref.el]);const debouncedOnMouseMove=debounce(onMousemove,"animationFrame",true);useExternalListener(window,"mousemove",debouncedOnMouseMove);useExternalListener(window,"mouseup",onMouseup);useExternalListener(window,"keydown",onKeydown,true);onWillUnmount(()=>dragEnd(true));return state;},}[hookName];} 7784return __exports;});; 7785 7786/* /web/static/src/core/utils/files.js */ 7787odoo.define('@web/core/utils/files',async function(require){'use strict';let __exports={};const{humanNumber}=require("@web/core/utils/numbers");const{session}=require("@web/session");const{_t}=require("@web/core/l10n/translation");const{sprintf}=require("@web/core/utils/strings");const DEFAULT_MAX_FILE_SIZE=128*1024*1024;__exports.checkFileSize=checkFileSize;function checkFileSize(fileSize,notificationService){const maxUploadSize=session.max_file_upload_size||DEFAULT_MAX_FILE_SIZE;if(fileSize>maxUploadSize){if(notificationService){notificationService.add(sprintf(_t("The selected file (%sB) is over the maximum allowed file size (%sB)."),humanNumber(fileSize),humanNumber(maxUploadSize)),{type:"danger",});} 7788return false;} 7789return true;} 7790return __exports;});; 7791 7792/* /web/static/src/core/utils/functions.js */ 7793odoo.define('@web/core/utils/functions',async function(require){'use strict';let __exports={};__exports.memoize=memoize;function memoize(func){const cache=new Map();const funcName=func.name?func.name+" (memoized)":"memoized";return{[funcName](...args){if(!cache.has(args[0])){cache.set(args[0],func(...args));} 7794return cache.get(...args);},}[funcName];} 7795return __exports;});; 7796 7797/* /web/static/src/core/utils/hooks.js */ 7798odoo.define('@web/core/utils/hooks',async function(require){'use strict';let __exports={};const{SERVICES_METADATA}=require("@web/env");const{status,useComponent,useEffect,useRef,onWillUnmount}=require("@odoo/owl");__exports.useAutofocus=useAutofocus;function useAutofocus({refName,selectAll}={}){const comp=useComponent();const ref=useRef(refName||"autofocus");if(comp.env.isSmall){return ref;} 7799if(comp.env.device&&comp.env.device.isMobileDevice){return ref;} 7800useEffect((el)=>{if(el){el.focus();if(["INPUT","TEXTAREA"].includes(el.tagName)&&el.type!=="number"){el.selectionEnd=el.value.length;el.selectionStart=selectAll?0:el.value.length;}}},()=>[ref.el]);return ref;} 7801__exports.useBus=useBus;function useBus(bus,eventName,callback){const component=useComponent();useEffect(()=>{const listener=callback.bind(component);bus.addEventListener(eventName,listener);return()=>bus.removeEventListener(eventName,listener);},()=>[]);} 7802__exports.useListener=useListener;function useListener(eventName,querySelector,handler,options={}){if(typeof arguments[1]!=="string"){querySelector=null;handler=arguments[1];options=arguments[2]||{};} 7803if(typeof handler!=="function"){throw new Error("The handler must be a function");} 7804const comp=useComponent();let boundHandler;if(querySelector){boundHandler=function(ev){let el=ev.target;let target;while(el&&!target){if(el.matches(querySelector)){target=el;}else if(el===comp.el){el=null;}else{el=el.parentElement;}} 7805if(el){handler.call(comp,ev);}};}else{boundHandler=handler.bind(comp);} 7806useEffect(()=>{comp.el.addEventListener(eventName,boundHandler,options);return()=>{comp.el.removeEventListener(eventName,boundHandler,options);};},()=>[]);} 7807function _protectMethod(component,fn){return function(...args){if(status(component)==="destroyed"){return Promise.reject(new Error("Component is destroyed"));} 7808const prom=Promise.resolve(fn.call(this,...args));const protectedProm=prom.then((result)=>status(component)==="destroyed"?new Promise(()=>{}):result);return Object.assign(protectedProm,{abort:prom.abort,cancel:prom.cancel,});};} 7809__exports.useService=useService;function useService(serviceName){const component=useComponent();const{services}=component.env;if(!(serviceName in services)){throw new Error(`Service ${serviceName} is not available`);} 7810const service=services[serviceName];if(serviceName in SERVICES_METADATA){if(service instanceof Function){return _protectMethod(component,service);}else{const methods=SERVICES_METADATA[serviceName];const result=Object.create(service);for(const method of methods){result[method]=_protectMethod(component,service[method]);} 7811return result;}} 7812return service;} 7813__exports.useChildRef=useChildRef;function useChildRef(){let defined=false;let value;return function ref(v){value=v;if(defined){return;} 7814Object.defineProperty(ref,"el",{get(){return value.el;},});defined=true;};} 7815__exports.useForwardRefToParent=useForwardRefToParent;function useForwardRefToParent(refName){const component=useComponent();const ref=useRef(refName);if(component.props[refName]){component.props[refName](ref);} 7816return ref;} 7817__exports.useOwnedDialogs=useOwnedDialogs;function useOwnedDialogs(){const dialogService=useService("dialog");const cbs=[];onWillUnmount(()=>
7817{cbs.forEach((cb)=>cb());});const addDialog=(...args)=>{const close=dialogService.add(...args);cbs.push(close);return close;};return addDialog;} 7818return __exports;});; 7819 7820/* /web/static/src/core/utils/numbers.js */ 7821odoo.define('@web/core/utils/numbers',async function(require){'use strict';let __exports={};const{localization:l10n}=require("@web/core/l10n/localization");const{_t}=require("@web/core/l10n/translation");const{intersperse}=require("@web/core/utils/strings");__exports.computeVariation=computeVariation;function computeVariation(value,comparisonValue){if(isNaN(value)||isNaN(comparisonValue)){return NaN;} 7822if(comparisonValue===0){if(value===0){return 0;}else if(value>0){return 1;}else{return-1;}} 7823return(value-comparisonValue)/Math.abs(comparisonValue);} 7824__exports.clamp=clamp;function clamp(num,min,max){return Math.max(Math.min(num,max),min);} 7825__exports.insertThousandsSep=insertThousandsSep;function insertThousandsSep(number,thousandsSep=",",grouping=[]){const negative=number[0]==="-";number=negative?number.slice(1):number;return(negative?"-":"")+intersperse(number,grouping,thousandsSep);} 7826__exports.humanNumber=humanNumber;function humanNumber(number,options={decimals:0,minDigits:1}){const decimals=options.decimals||0;const minDigits=options.minDigits||1;const d2=Math.pow(10,decimals);const numberMagnitude=+number.toExponential().split("e+")[1];number=Math.round(number*d2)/d2;if(numberMagnitude>=21){number=Math.round(number*Math.pow(10,decimals-numberMagnitude))/d2;return`${number}e+${numberMagnitude}`;} 7827const unitSymbols=_t("kMGTPE").toString();const sign=Math.sign(number);number=Math.abs(number);let symbol="";for(let i=unitSymbols.length;i>0;i--){const s=Math.pow(10,i*3);if(s<=number/Math.pow(10,minDigits-1)){number=Math.round((number*d2)/s)/d2;symbol=unitSymbols[i-1];break;}} 7828const{decimalPoint,grouping,thousandsSep}=l10n;const decimalsToKeep=number>=1000?0:decimals;number=sign*number;const[integerPart,decimalPart]=number.toFixed(decimalsToKeep).split(".");const int=insertThousandsSep(integerPart,thousandsSep,grouping);if(!decimalPart){return int+symbol;} 7829return int+decimalPoint+decimalPart+symbol;} 7830return __exports;});; 7831 7832/* /web/static/src/core/utils/objects.js */ 7833odoo.define('@web/core/utils/objects',async function(require){'use strict';let __exports={};__exports.shallowEqual=shallowEqual;function shallowEqual(obj1,obj2){const obj1Keys=Object.keys(obj1);return(obj1Keys.length===Object.keys(obj2).length&&obj1Keys.every((key)=>obj1[key]===obj2[key]));} 7834__exports.deepCopy=deepCopy;function deepCopy(obj){return JSON.parse(JSON.stringify(obj));} 7835__exports.omit=omit;function omit(object,...properties){const result={};const propertiesSet=new Set(properties);for(const key in object){if(!propertiesSet.has(key)){result[key]=object[key];}} 7836return result;} 7837__exports.pick=pick;function pick(object,...properties){return Object.fromEntries(properties.filter((prop)=>prop in object).map((prop)=>[prop,object[prop]]));} 7838return __exports;});; 7839 7840/* /web/static/src/core/utils/patch.js */ 7841odoo.define('@web/core/utils/patch',async function(require){'use strict';let __exports={};const patchMap=new WeakMap();__exports.patch=patch;function patch(obj,patchName,patchValue,options={}){if(typeof patchName!=="string"){throw new Error("Incorrect use of patch: second argument should be the patchName");} 7842const pure=Boolean(options.pure);if(!patchMap.has(obj)){patchMap.set(obj,{original:{},patches:[],});} 7843const objDesc=patchMap.get(obj);if(objDesc.patches.some((p)=>p.name===patchName)){throw new Error(`Class ${obj.name} already has a patch ${patchName}`);} 7844objDesc.patches.push({name:patchName,patch:patchValue,pure,});for(const k in patchValue){let prevDesc=null;let proto=obj;do{prevDesc=Object.getOwnPropertyDescriptor(proto,k);proto=Object.getPrototypeOf(proto);}while(!prevDesc&&proto);let newDesc=Object.getOwnPropertyDescriptor(patchValue,k);if(!Object.hasOwnProperty.call(objDesc.original,k)){objDesc.original[k]=Object.getOwnPropertyDescriptor(obj,k);} 7845if(prevDesc){const patchedFnName=`${k} (patch ${patchName})`;if(prevDesc.value&&typeof newDesc.value==="function"){newDesc={...prevDesc,value:newDesc.value};makeIntermediateFunction("value",prevDesc,newDesc,patchedFnName);} 7846if((newDesc.get||newDesc.set)&&(prevDesc.get||prevDesc.set)){newDesc={...prevDesc,get:newDesc.get||prevDesc.get,set:newDesc.set||prevDesc.set,};if(prevDesc.get&&typeof newDesc.get==="function"){makeIntermediateFunction("get",prevDesc,newDesc,patchedFnName);} 7847if(prevDesc.set&&typeof newDesc.set==="function"){makeIntermediateFunction("set",prevDesc,newDesc,patchedFnName);}}} 7848Object.defineProperty(obj,k,newDesc);} 7849function makeIntermediateFunction(key,prevDesc,newDesc,patchedFnName){const _superFn=prevDesc[key];const patchFn=newDesc[key];if(pure){newDesc[key]=patchFn;}else{newDesc[key]={[patchedFnName](...args){let prevSuper;if(this){prevSuper=this._super;Object.defineProperty(this,"_super",{value:_superFn.bind(this),configurable:true,writable:true,});} 7850const result=patchFn.call(this,...args);if(this){Object.defineProperty(this,"_super",{value:prevSuper,configurable:true,writable:true,});} 7851return result;},}[patchedFnName];}}} 7852__exports.unpatch=unpatch;function unpatch(obj,patchName){const objDesc=patchMap.get(obj);if(!objDesc.patches.some((p)=>p.name===patchName)){throw new Error(`Class ${obj.name} does not have any patch ${patchName}`);} 7853patchMap.delete(obj);for(const k in objDesc.original){if(objDesc.original[k]===undefined){delete obj[k];}else{Object.defineProperty(obj,k,objDesc.original[k]);}}
7853 7854for(const patchDesc of objDesc.patches){if(patchDesc.name!==patchName){patch(obj,patchDesc.name,patchDesc.patch,{pure:patchDesc.pure});}}} 7855return __exports;});; 7856 7857/* /web/static/src/core/utils/render.js */ 7858odoo.define('@web/core/utils/render',async function(require){'use strict';let __exports={};const{blockDom,markup}=require("@odoo/owl");__exports.renderToString=renderToString;function renderToString(template,context={}){const app=renderToString.app;if(!app){throw new Error("an app must be configured before using renderToString");} 7859const templateFn=app.getTemplate(template);const bdom=templateFn(context,{});const div=document.createElement("div");blockDom.mount(bdom,div);return div.innerHTML;} 7860__exports.renderToMarkup=renderToMarkup;function renderToMarkup(template,context={}){return markup(renderToString(template,context));} 7861return __exports;});; 7862 7863/* /web/static/src/core/utils/scrolling.js */ 7864odoo.define('@web/core/utils/scrolling',async function(require){'use strict';let __exports={};__exports.scrollTo=scrollTo;function scrollTo(element,options={scrollable:null,isAnchor:false}){function _getScrollParent(node){if(node==null){return null;} 7865if(node.scrollHeight>node.clientHeight&&node.clientHeight>0){return node;}else{return _getScrollParent(node.parentNode);}} 7866const scrollable=options.scrollable?options.scrollable:_getScrollParent(element.parentNode);if(scrollable){const scrollBottom=scrollable.getBoundingClientRect().bottom;const scrollTop=scrollable.getBoundingClientRect().top;const elementBottom=element.getBoundingClientRect().bottom;const elementTop=element.getBoundingClientRect().top;if(elementBottom>scrollBottom&&!options.isAnchor){scrollable.scrollTop+=elementTop-scrollBottom+Math.ceil(element.getBoundingClientRect().height);}else if(elementTop<scrollTop||options.isAnchor){scrollable.scrollTop-=scrollTop-elementTop;if(options.isAnchor){const parentScrollable=_getScrollParent(scrollable.parentNode);if(parentScrollable){scrollTo(scrollable,{isAnchor:true,scrollable:parentScrollable});}}}}} 7867return __exports;});; 7868 7869/* /web/static/src/core/utils/search.js */ 7870odoo.define('@web/core/utils/search',async function(require){'use strict';let __exports={};const{unaccent}=require("@web/core/utils/strings");function match(pattern,str){let totalScore=0;let currentScore=0;const len=str.length;let patternIndex=0;pattern=unaccent(pattern,false);str=unaccent(str,false);for(let i=0;i<len;i++){if(str[i]===pattern[patternIndex]){patternIndex++;currentScore+=100+currentScore-i/200;}else{currentScore=0;} 7871totalScore=totalScore+currentScore;} 7872return patternIndex===pattern.length?totalScore:0;} 7873__exports.fuzzyLookup=fuzzyLookup;function fuzzyLookup(pattern,list,fn){const results=[];list.forEach((data)=>{const score=match(pattern,fn(data));if(score>0){results.push({score,elem:data});}});results.sort((a,b)=>b.score-a.score);return results.map((r)=>r.elem);} 7874__exports.fuzzyTest=fuzzyTest;function fuzzyTest(pattern,string){return match(pattern,string)!==0;} 7875return __exports;});; 7876 7877/* /web/static/src/core/utils/sortable.js */ 7878odoo.define('@web/core/utils/sortable',async function(require){'use strict';let __exports={};const{makeDraggableHook}=require("@web/core/utils/draggable_hook_builder");const useSortable=__exports.useSortable=makeDraggableHook({name:"useSortable",acceptedParams:{groups:["string","function"],connectGroups:["boolean","function"],},defaultParams:{connectGroups:false,currentGroup:null,edgeScrolling:{speed:20,threshold:60},ghostElement:null,groupSelector:null,},onComputeParams({ctx,params}){ctx.groupSelector=params.groups||null;if(ctx.groupSelector){ctx.fullSelector=[ctx.groupSelector,ctx.fullSelector].join(" ");} 7879ctx.connectGroups=params.connectGroups;},onDragStart({ctx,helpers}){const onElementMouseenter=(ev)=>{const element=ev.currentTarget;if(ctx.connectGroups||!ctx.groupSelector||ctx.currentGroup===element.closest(ctx.groupSelector)){const pos=ctx.ghostElement.compareDocumentPosition(element);if(pos===2){element.before(ctx.ghostElement);}else if(pos===4){element.after(ctx.ghostElement);}} 7880helpers.execHandler("onElementEnter",{element});};const onElementMouseleave=(ev)=>{const element=ev.currentTarget;helpers.execHandler("onElementLeave",{element});};const onGroupMouseenter=(ev)=>{const group=ev.currentTarget;group.appendChild(ctx.ghostElement);helpers.execHandler("onGroupEnter",{group});};const onGroupMouseleave=(ev)=>{const group=ev.currentTarget;helpers.execHandler("onGroupLeave",{group});};const{width,height}=ctx.currentElementRect;ctx.ghostElement=ctx.currentElement.cloneNode(false);ctx.ghostElement.style=`visibility: hidden; display: block; width: ${width}px; height:${height}px;`;if(ctx.connectGroups&&ctx.groupSelector){for(const siblingGroup of ctx.ref.el.querySelectorAll(ctx.groupSelector)){helpers.addListener(siblingGroup,"mouseenter",onGroupMouseenter);helpers.addListener(siblingGroup,"mouseleave",onGroupMouseleave);helpers.addStyle(siblingGroup,{"pointer-events":"auto"});}} 7881for(const siblingEl of ctx.ref.el.querySelectorAll(ctx.elementSelector)){if(siblingEl!==ctx.currentElement&&siblingEl!==ctx.ghostElement){helpers.addListener(siblingEl,"mouseenter",onElementMouseenter);helpers.addListener(siblingEl,"mouseleave",onElementMouseleave);}} 7882ctx.currentElement.after(ctx.ghostElement);helpers.execHandler("onDragStart",{element:ctx.currentElement,group:ctx.currentGroup,});},onDragEnd({ctx,helpers}){helpers.execHandler("onDragEnd",{element:ctx.currentElement,group:ctx.currentGroup});},onDrop({ctx,helpers}){const previous=ctx.ghostElement.previousElementSibling;const next=ctx.ghostElement.nextElementSibling;if(previous!==ctx.currentElement&&next!==ctx.currentElement){helpers.execHandler("onDrop",{element:ctx.currentElement,group:ctx.currentGroup,previous,next,parent:ctx.groupSelector&&ctx.ghostElement.closest(ctx.groupSelector),});}},onWillStartDrag({ctx}){if(ctx.groupSelector){ctx.currentGroup=ctx.currentElement.closest(ctx.groupSelector);if(!ctx.connectGroups){ctx.currentContainer=ctx.currentGroup;}}},onCleanup({ctx}){if(ctx.ghostElement){ctx.ghostElement.remove();} 7883ctx.currentGroup=null;ctx.ghostElement=null;},});return __exports;});; 7884 7885/* /web/static/src/core/utils/strings.js */ 7886odoo.define('@web/core/utils/strings',async function(require){'use strict';let __exports={};const nbsp=__exports.nbsp="\u00a0";__exports.escape=escape;function escape(str){if(str===undefined){return"";} 7887if(typeof str==="number"){return String(str);} 7888const p=document.createElement("p");p.textContent=str;return p.innerHTML;} 7889__exports.escapeRegExp=escapeRegExp;function escapeRegExp(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");} 7890__exports.intersperse=intersperse;function intersperse(str,indices,separator=""){separator=separator||"";const result=[];let last=str.length;for(let i=0;i<indices.length;++i){let section=indices[i];if(section===-1||last<=0){break;}else if(section===0&&i===0){break;}else if(section===0){section=indices[--i];} 7891result.push(str.substring(last-section,last));last-=section;} 7892const s=str.substring(0,last);if(s){result.push(s);} 7893return result.reverse().join(separator);} 7894__exports.sprintf=sprintf;function sprintf(s,...values){if(values.length===1&&Object.prototype.toString.call(values[0])==="[object Object]"){const valuesDict=values[0];s=s.replace(/%\(?([^)]+)\)s/g,(match,value)=>valuesDict[value]);}else if(values.length>0){s=s.replace(/%s/g,()=>values.shift());} 7895return s;} 7896__exports.capitalize=capitalize;function capitalize(s){return s?s[0].toUpperCase()+s.slice(1):"";} 7897const diacriticsMap={'\u0041':'A','\u24B6':'A','\uFF21':'A','\u00C0':'A','\u00C1':'A','\u00C2':'A','\u1EA6':'A','\u1EA4':'A','\u1EAA':'A','\u1EA8':'A','\u00C3':'A','\u0100':'A','\u0102':'A','\u1EB0':'A','\u1EAE':'A','\u1EB4':'A','\u1EB2':'A','\u0226':'A','\u01E0':'A','\u00C4':'A','\u01DE':'A','\u1EA2':'A','\u00C5':'A','\u01FA':'A','\u01CD':'A','\u0200':'A','\u0202':'A','\u1EA0':'A','\u1EAC':'A','\u1EB6':'A','\u1E00':'A','\u0104':'A','\u023A':'A','\u2C6F':'A','\uA732':'AA','\u00C6':'AE','\u01FC':'AE','\u01E2':'AE','\uA734':'AO','\uA736':'AU','\uA738':'AV','\uA73A':'AV','\uA73C':'AY','\u0042':'B','\u24B7':'B','\uFF22':'B','\u1E02':'B','\u1E04':'B','\u1E06':'B','\u0243':'B','\u0182':'B','\u0181':'B','\u0043':'C','\u24B8':'C','\uFF23':'C','\u0106':'C','\u0108':'C','\u010A':'C','\u010C':'C','\u00C7':'C','\u1E08':'C','\u0187':'C','\u023B':'C','\uA73E':'C','\u0044':'D','\u24B9':'D','\uFF24':'D','\u1E0A':'D','\u010E':'D','\u1E0C':'D','\u1E10':'D','\u1E12':'D','\u1E0E':'D','\u0110':'D','\u018B':'D','\u018A':'D','\u0189':'D','\uA779':'D','\u01F1':'DZ','\u01C4':'DZ','\u01F2':'Dz','\u01C5':'Dz','\u0045':'E','\u24BA':'E','\uFF25':'E','\u00C8':'E','\u00C9':'E','\u00CA':'E','\u1EC0':'E','\u1EBE':'E','\u1EC4':'E','\u1EC2':'E','\u1EBC':'E','\u0112':'E','\u1E14':'E','\u1E16':'E','\u0114':'E','\u0116':'E','\u00CB':'E','\u1EBA':'E','\u011A':'E','\u0204':'E','\u0206':'E','\u1EB8':'E','\u1EC6':'E','\u0228':'E','\u1E1C':'E','\u0118':'E','\u1E18':'E','\u1E1A':'E','\u0190':'E','\u018E':'E','\u0046':'F','\u24BB':'F','\uFF26':'F','\u1E1E':'F','\u0191':'F','\uA77B':'F','\u0047':'G','\u24BC':'G','\uFF27':'G','\u01F4':'G','\u011C':'G','\u1E20':'G','\u011E':'G','\u0120':'G','\u01E6':'G','\u0122':'G','\u01E4':'G','\u0193':'G','\uA7A0':'G','\uA77D':'G','\uA77E':'G','\u0048':'H','\u24BD':'H','\uFF28':'H','\u0124':'H','\u1E22':'H','\u1E26':'H','\u021E':'H','\u1E24':'H','\u1E28':'H','\u1E2A':'H','\u0126':'H','\u2C67':'H','\u2C75':'H','\uA78D':'H','\u0049':'I','\u24BE':'I','\uFF29':'I','\u00CC':'I','\u00CD':'I','\u00CE':'I','\u0128':'I','\u012A':'I','\u012C':'I','\u0130':'I','\u00CF':'I','\u1E2E':'I','\u1EC8':'I','\u01CF':'I','\u0208':'I','\u020A':'I','\u1ECA':'I','\u012E':'I','\u1E2C':'I','\u0197':'I','\u004A':'J','\u24BF':'J','\uFF2A':'J','\u0134':'J','\u0248':'J','\u004B':'K','\u24C0':'K','\uFF2B':'K','\u1E30':'K','\u01E8':'K','\u1E32':'K','\u0136':'K','\u1E34':'K','\u0198':'K','\u2C69':'K','\uA740':'K','\uA742':'K','\uA744':'K','\uA7A2':'K','\u004C':'L','\u24C1':'L','\uFF2C':'L','\u013F':'L','\u0139':'L','\u013D':'L','\u1E36':'L','\u1E38':'L','\u013B':'L','\u1E3C':'L','\u1E3A':'L','\u0141':'L','\u023D':'L','\u2C62':'L','\u2C60':'L','\uA748':'L','\uA746':'L','\uA780':'L','\u01C7':'LJ','\u01C8':'Lj','\u004D':'M','\u24C2':'M','\uFF2D':'M','\u1E3E':'M','\u1E40':'M','\u1E42':'M','\u2C6E':'M','\u019C':'M','\u004E':'N','\u24C3':'N','\uFF2E':'N','\u01F8':'N','\u0143':'N','\u00D1':'N','\u1E44':'N','\u0147':'N','\u1E46':'N','\u0145':'N','\u1E4A':'N','\u1E48':'N','\u0220':'N','\u019D':'N','\uA790':'N','\uA7A4':'N','\u01CA':'NJ','\u01CB':'Nj','\u004F':'O','\u24C4':'O','\uFF2F':'O','\u00D2':'O','\u00D3':'O','\u00D4':'O','\u1ED2':'O','\u1ED0':'O','\u1ED6':'O','\u1ED4':'O','\u00D5':'O','\u1E4C':'O','\u022C':'O','\u1E4E':'O','\u014C':'O','\u1E50':'O','\u1E52':'O','\u014E':'O','\u022E':'O','\u0230':'O','\u00D6':'O','\u022A':'O','\u1ECE':'O','\u0150':'O','\u01D1':'O','\u020C':'O','\u020E':'O','\u01A0':'O','\u1EDC':'O','\u1EDA':'O','\u1EE0':'O','\u1EDE':'O','\u1EE2':'O','\u1ECC':'O','\u1ED8':'O','\u01EA':'O','\u01EC':'O','\u00D8':'O','\u01FE':'O','\u0186':'O','\u019F':'O','\uA74A':'O','\uA74C':'O','\u01A2':'OI','\uA74E':'OO','\u0222':'OU','\u0050':'P','\u24C5':'P','\uFF30':'P','\u1E54':'P','\u1E56':'P','\u01A4':'P','\u2C63':'P','\uA750':'P','\uA752':'P','\uA754':'P','\u0051':'Q','\u24C6':'Q','\uFF31':'Q','\uA756':'Q','\uA758':'Q','\u024A':'Q','\u0052':'R','\u24C7':'R','\uFF32':'R','\u0154':'R','\u1E58':'R','\u0158':'R','\u0210':'R','\u0212':'R','\u1E5A':'R','\u1E5C':'R','\u0156':'R','\u1E5E':'R','\u024C':'R','\u2C64':'R','\uA75A':'R','\uA7A6':'R','\uA782':'R','\u0053':'S','\u24C8':'S','\uFF33':'S','\u1E9E':'S','\u015A':'S','\u1E64':'S','\u015C':'S','\u1E60':'S','\u0160':'S','\u1E66':'S','\u1E62':'S','\u1E68':'S','\u0218':'S','\u015E':'S','\u2C7E':'S','\uA7A8':'S','\uA784':'S','\u0054':'T','\u24C9':'T','\uFF34':'T','\u1E6A':'T','\u0164':'T','\u1E6C':'T','\u021A':'T','\u0162':'T','\u1E70':'T','\u1E6E':'T','\u0166':'T','\u01AC':'T','\u01AE':'T','\u023E':'T','\uA786':'T','\uA728':'TZ','\u0055':'U','\u24CA':'U','\uFF35':'U','\u00D9':'U','\u00DA':'U','\u00DB':'U','\u0168':'U','\u1E78':'U','\u016A':'U','\u1E7A':'U','\u016C':'U','\u00DC':'U','\u01DB':'U','\u01D7':'U','\u01D5':'U','\u01D9':'U','\u1EE6':'U','\u016E':'U','\u0170':'U','\u01D3':'U','\u0214':'U','\u0216':'U','\u01AF':'U','\u1EEA':'U','\u1EE8':'U','\u1EEE':'U','\u1EEC':'U','\u1EF0':'U','\u1EE4':'U','\u1E72':'U','\u0172':'U','\u1E76':'U','\u1E74':'U','\u0244':'U','\u0056':'V','\u24CB':'V','\uFF36':'V','\u1E7C':'V','\u1E7E':'V','\u01B2':'V','\uA75E':'V','\u0245':'V','\uA760':'VY','\u0057':'W','\u24CC':'W','\uFF37':'W','\u1E80':'W','\u1E82':'W','\u0174':'W','\u1E86':'W','\u1E84':'W','\u1E88':'W','\u2C72':'W','\u0058':'
7897X','\u24CD':'X','\uFF38':'X','\u1E8A':'X','\u1E8C':'X','\u0059':'Y','\u24CE':'Y','\uFF39':'Y','\u1EF2':'Y','\u00DD':'Y','\u0176':'Y','\u1EF8':'Y','\u0232':'Y','\u1E8E':'Y','\u0178':'Y','\u1EF6':'Y','\u1EF4':'Y','\u01B3':'Y','\u024E':'Y','\u1EFE':'Y','\u005A':'Z','\u24CF':'Z','\uFF3A':'Z','\u0179':'Z','\u1E90':'Z','\u017B':'Z','\u017D':'Z','\u1E92':'Z','\u1E94':'Z','\u01B5':'Z','\u0224':'Z','\u2C7F':'Z','\u2C6B':'Z','\uA762':'Z','\u0061':'a','\u24D0':'a','\uFF41':'a','\u1E9A':'a','\u00E0':'a','\u00E1':'a','\u00E2':'a','\u1EA7':'a','\u1EA5':'a','\u1EAB':'a','\u1EA9':'a','\u00E3':'a','\u0101':'a','\u0103':'a','\u1EB1':'a','\u1EAF':'a','\u1EB5':'a','\u1EB3':'a','\u0227':'a','\u01E1':'a','\u00E4':'a','\u01DF':'a','\u1EA3':'a','\u00E5':'a','\u01FB':'a','\u01CE':'a','\u0201':'a','\u0203':'a','\u1EA1':'a','\u1EAD':'a','\u1EB7':'a','\u1E01':'a','\u0105':'a','\u2C65':'a','\u0250':'a','\uA733':'aa','\u00E6':'ae','\u01FD':'ae','\u01E3':'ae','\uA735':'ao','\uA737':'au','\uA739':'av','\uA73B':'av','\uA73D':'ay','\u0062':'b','\u24D1':'b','\uFF42':'b','\u1E03':'b','\u1E05':'b','\u1E07':'b','\u0180':'b','\u0183':'b','\u0253':'b','\u0063':'c','\u24D2':'c','\uFF43':'c','\u0107':'c','\u0109':'c','\u010B':'c','\u010D':'c','\u00E7':'c','\u1E09':'c','\u0188':'c','\u023C':'c','\uA73F':'c','\u2184':'c','\u0064':'d','\u24D3':'d','\uFF44':'d','\u1E0B':'d','\u010F':'d','\u1E0D':'d','\u1E11':'d','\u1E13':'d','\u1E0F':'d','\u0111':'d','\u018C':'d','\u0256':'d','\u0257':'d','\uA77A':'d','\u01F3':'dz','\u01C6':'dz','\u0065':'e','\u24D4':'e','\uFF45':'e','\u00E8':'e','\u00E9':'e','\u00EA':'e','\u1EC1':'e','\u1EBF':'e','\u1EC5':'e','\u1EC3':'e','\u1EBD':'e','\u0113':'e','\u1E15':'e','\u1E17':'e','\u0115':'e','\u0117':'e','\u00EB':'e','\u1EBB':'e','\u011B':'e','\u0205':'e','\u0207':'e','\u1EB9':'e','\u1EC7':'e','\u0229':'e','\u1E1D':'e','\u0119':'e','\u1E19':'e','\u1E1B':'e','\u0247':'e','\u025B':'e','\u01DD':'e','\u0066':'f','\u24D5':'f','\uFF46':'f','\u1E1F':'f','\u0192':'f','\uA77C':'f','\u0067':'g','\u24D6':'g','\uFF47':'g','\u01F5':'g','\u011D':'g','\u1E21':'g','\u011F':'g','\u0121':'g','\u01E7':'g','\u0123':'g','\u01E5':'g','\u0260':'g','\uA7A1':'g','\u1D79':'g','\uA77F':'g','\u0068':'h','\u24D7':'h','\uFF48':'h','\u0125':'h','\u1E23':'h','\u1E27':'h','\u021F':'h','\u1E25':'h','\u1E29':'h','\u1E2B':'h','\u1E96':'h','\u0127':'h','\u2C68':'h','\u2C76':'h','\u0265':'h','\u0195':'hv','\u0069':'i','\u24D8':'i','\uFF49':'i','\u00EC':'i','\u00ED':'i','\u00EE':'i','\u0129':'i','\u012B':'i','\u012D':'i','\u00EF':'i','\u1E2F':'i','\u1EC9':'i','\u01D0':'i','\u0209':'i','\u020B':'i','\u1ECB':'i','\u012F':'i','\u1E2D':'i','\u0268':'i','\u0131':'i','\u006A':'j','\u24D9':'j','\uFF4A':'j','\u0135':'j','\u01F0':'j','\u0249':'j','\u006B':'k','\u24DA':'k','\uFF4B':'k','\u1E31':'k','\u01E9':'k','\u1E33':'k','\u0137':'k','\u1E35':'k','\u0199':'k','\u2C6A':'k','\uA741':'k','\uA743':'k','\uA745':'k','\uA7A3':'k','\u006C':'l','\u24DB':'l','\uFF4C':'l','\u0140':'l','\u013A':'l','\u013E':'l','\u1E37':'l','\u1E39':'l','\u013C':'l','\u1E3D':'l','\u1E3B':'l','\u017F':'l','\u0142':'l','\u019A':'l','\u026B':'l','\u2C61':'l','\uA749':'l','\uA781':'l','\uA747':'l','\u01C9':'lj','\u006D':'m','\u24DC':'m','\uFF4D':'m','\u1E3F':'m','\u1E41':'m','\u1E43':'m','\u0271':'m','\u026F':'m','\u006E':'n','\u24DD':'n','\uFF4E':'n','\u01F9':'n','\u0144':'n','\u00F1':'n','\u1E45':'n','\u0148':'n','\u1E47':'n','\u0146':'n','\u1E4B':'n','\u1E49':'n','\u019E':'n','\u0272':'n','\u0149':'n','\uA791':'n','\uA7A5':'n','\u01CC':'nj','\u006F':'o','\u24DE':'o','\uFF4F':'o','\u00F2':'o','\u00F3':'o','\u00F4':'o','\u1ED3':'o','\u1ED1':'o','\u1ED7':'o','\u1ED5':'o','\u00F5':'o','\u1E4D':'o','\u022D':'o','\u1E4F':'o','\u014D':'o','\u1E51':'o','\u1E53':'o','\u014F':'o','\u022F':'o','\u0231':'o','\u00F6':'o','\u022B':'o','\u1ECF':'o','\u0151':'o','\u01D2':'o','\u020D':'o','\u020F':'o','\u01A1':'o','\u1EDD':'o','\u1EDB':'o','\u1EE1':'o','\u1EDF':'o','\u1EE3':'o','\u1ECD':'o','\u1ED9':'o','\u01EB':'o','\u01ED':'o','\u00F8':'o','\u01FF':'o','\u0254':'o','\uA74B':'o','\uA74D':'o','\u0275':'o','\u01A3':'oi','\u0223':'ou','\uA74F':'oo','\u0070':'p','\u24DF':'p','\uFF50':'p','\u1E55':'p','\u1E57':'p','\u01A5':'p','\u1D7D':'p','\uA751':'p','\uA753':'p','\uA755':'p','\u0071':'q','\u24E0':'q','\uFF51':'q','\u024B':'q','\uA757':'q','\uA759':'q','\u0072':'r','\u24E1':'r','\uFF52':'r','\u0155':'r','\u1E59':'r','\u0159':'r','\u0211':'r','\u0213':'r','\u1E5B':'r','\u1E5D':'r','\u0157':'r','\u1E5F':'r','\u024D':'r','\u027D':'r','\uA75B':'r','\uA7A7':'r','\uA783':'r','\u0073':'s','\u24E2':'s','\uFF53':'s','\u00DF':'s','\u015B':'s','\u1E65':'s','\u015D':'s','\u1E61':'s','\u0161':'s','\u1E67':'s','\u1E63':'s','\u1E69':'s','\u0219':'s','\u015F':'s','\u023F':'s','\uA7A9':'s','\uA785':'s','\u1E9B':'s','\u0074':'t','\u24E3':'t','\uFF54':'t','\u1E6B':'t','\u1E97':'t','\u016
78975':'t','\u1E6D':'t','\u021B':'t','\u0163':'t','\u1E71':'t','\u1E6F':'t','\u0167':'t','\u01AD':'t','\u0288':'t','\u2C66':'t','\uA787':'t','\uA729':'tz','\u0075':'u','\u24E4':'u','\uFF55':'u','\u00F9':'u','\u00FA':'u','\u00FB':'u','\u0169':'u','\u1E79':'u','\u016B':'u','\u1E7B':'u','\u016D':'u','\u00FC':'u','\u01DC':'u','\u01D8':'u','\u01D6':'u','\u01DA':'u','\u1EE7':'u','\u016F':'u','\u0171':'u','\u01D4':'u','\u0215':'u','\u0217':'u','\u01B0':'u','\u1EEB':'u','\u1EE9':'u','\u1EEF':'u','\u1EED':'u','\u1EF1':'u','\u1EE5':'u','\u1E73':'u','\u0173':'u','\u1E77':'u','\u1E75':'u','\u0289':'u','\u0076':'v','\u24E5':'v','\uFF56':'v','\u1E7D':'v','\u1E7F':'v','\u028B':'v','\uA75F':'v','\u028C':'v','\uA761':'vy','\u0077':'w','\u24E6':'w','\uFF57':'w','\u1E81':'w','\u1E83':'w','\u0175':'w','\u1E87':'w','\u1E85':'w','\u1E98':'w','\u1E89':'w','\u2C73':'w','\u0078':'x','\u24E7':'x','\uFF58':'x','\u1E8B':'x','\u1E8D':'x','\u0079':'y','\u24E8':'y','\uFF59':'y','\u1EF3':'y','\u00FD':'y','\u0177':'y','\u1EF9':'y','\u0233':'y','\u1E8F':'y','\u00FF':'y','\u1EF7':'y','\u1E99':'y','\u1EF5':'y','\u01B4':'y','\u024F':'y','\u1EFF':'y','\u007A':'z','\u24E9':'z','\uFF5A':'z','\u017A':'z','\u1E91':'z','\u017C':'z','\u017E':'z','\u1E93':'z','\u1E95':'z','\u01B6':'z','\u0225':'z','\u0240':'z','\u2C6C':'z','\uA763':'z',};__exports.unaccent=unaccent;
7897function unaccent(str,caseSensitive){str=str.replace(/[^\u0000-\u007E]/g,function(accented){return diacriticsMap[accented]||accented;});return caseSensitive?str:str.toLowerCase();} 7898return __exports;});; 7899 7900/* /web/static/src/core/utils/timing.js */ 7901odoo.define('@web/core/utils/timing',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{onWillUnmount,useComponent}=require("@odoo/owl");__exports.throttleForAnimation=throttleForAnimation;function throttleForAnimation(func){let handle=null;const funcName=func.name?`${func.name} (throttleForAnimation)`:"throttleForAnimation";return Object.assign({[funcName](...args){browser.cancelAnimationFrame(handle);handle=browser.requestAnimationFrame(()=>{handle=null;func.call(this,...args);});},}[funcName],{cancel(){browser.cancelAnimationFrame(handle);},});} 7902__exports.throttle=throttle;function throttle(func,delay){let waiting=false;const funcName=func.name?func.name+" (throttle)":"throttle";return{[funcName](...args){const context=this;if(!waiting){waiting=true;browser.setTimeout(function(){waiting=false;func.call(context,...args);},delay);}},}[funcName];} 7903__exports.debounce=debounce;function debounce(func,delay,immediate=false){let handle;const funcName=func.name?func.name+" (debounce)":"debounce";const useAnimationFrame=delay==="animationFrame";const setFnName=useAnimationFrame?"requestAnimationFrame":"setTimeout";const clearFnName=useAnimationFrame?"cancelAnimationFrame":"clearTimeout";return Object.assign({[funcName](...args){return new Promise((resolve)=>{const callNow=immediate&&!handle;browser[clearFnName](handle);handle=browser[setFnName](()=>{handle=null;if(!immediate){Promise.resolve(func.apply(this,args)).then(resolve);}},delay);if(callNow){Promise.resolve(func.apply(this,args)).then(resolve);}});},}[funcName],{cancel(){browser[clearFnName](handle);},});} 7904__exports.useDebounced=useDebounced;function useDebounced(callback,delay){const component=useComponent();const debounced=debounce(callback.bind(component),delay);onWillUnmount(()=>debounced.cancel());return debounced;} 7905__exports.setRecurringAnimationFrame=setRecurringAnimationFrame;function setRecurringAnimationFrame(callback){const handler=(timestamp)=>{callback(timestamp-lastTimestamp);lastTimestamp=timestamp;handle=browser.requestAnimationFrame(handler);};const stop=()=>{browser.cancelAnimationFrame(handle);};let lastTimestamp=browser.performance.now();let handle=browser.requestAnimationFrame(handler);return stop;} 7906return __exports;});; 7907 7908/* /web/static/src/core/utils/ui.js */ 7909odoo.define('@web/core/utils/ui',async function(require){'use strict';let __exports={};__exports.closest=closest;function closest(elements,targetPos){let closestEl=null;let closestDistance=Infinity;for(const el of elements){const rect=el.getBoundingClientRect();const distance=getQuadrance(rect,targetPos);if(!closestEl||distance<closestDistance){closestEl=el;closestDistance=distance;}} 7910return closestEl;} 7911__exports.isVisible=isVisible;function isVisible(el){if(el===document||el===window){return true;} 7912if(!el){return false;} 7913let _isVisible=false;if("offsetWidth"in el&&"offsetHeight"in el){_isVisible=el.offsetWidth>0&&el.offsetHeight>0;}else if("getBoundingClientRect"in el){const rect=el.getBoundingClientRect();_isVisible=rect.width>0&&rect.height>0;} 7914if(!_isVisible&&getComputedStyle(el).display==="contents"){for(const child of el.children){if(isVisible(child)){return true;}}} 7915return _isVisible;} 7916__exports._legacyIsVisible=_legacyIsVisible;function _legacyIsVisible(el){if(el===document||el===window){return true;} 7917if(!el){return false;} 7918let _isVisible=false;if("offsetWidth"in el&&"offsetHeight"in el){_isVisible=el.offsetWidth>0||el.offsetHeight>0;}else if("getBoundingClientRect"in el){const rect=el.getBoundingClientRect();_isVisible=rect.width>0||rect.height>0;} 7919if(!_isVisible&&getComputedStyle(el).display==="contents"){for(const child of el.children){if(isVisible(child)){return true;}}} 7920return _isVisible;} 7921__exports.getQuadrance=getQuadrance;function getQuadrance(rect,pos){let q=0;if(pos.x<rect.x){q+=(rect.x-pos.x)**2;}else if(rect.x+rect.width<pos.x){q+=(pos.x-(rect.x+rect.width))**2;} 7922if(pos.y<rect.y){q+=(rect.y-pos.y)**2;}
7922else if(rect.y+rect.height<pos.y){q+=(pos.y-(rect.y+rect.height))**2;} 7923return q;} 7924__exports.getVisibleElements=getVisibleElements;function getVisibleElements(activeElement,selector){const visibleElements=[];const elements=activeElement.querySelectorAll(selector);for(const el of elements){if(isVisible(el)){visibleElements.push(el);}} 7925return visibleElements;} 7926__exports.touching=touching;function touching(elements,targetRect){const r1={x:0,y:0,width:0,height:0,...targetRect};return[...elements].filter((el)=>{const r2=el.getBoundingClientRect();return(r2.x+r2.width>=r1.x&&r2.x<=r1.x+r1.width&&r2.y+r2.height>=r1.y&&r2.y<=r1.y+r1.height);});} 7927let TABABLE_SELECTOR="[tabindex], a, area, button, frame, iframe, input, object, select, textarea, details > summary:nth-child(1),".split(",").join(':not([tabindex="-1"]):not(:disabled),');TABABLE_SELECTOR=TABABLE_SELECTOR.slice(0,TABABLE_SELECTOR.length-1);__exports.getTabableElements=getTabableElements;function getTabableElements(container=document.body){const elements=[...container.querySelectorAll(TABABLE_SELECTOR)].filter(isVisible);const byTabIndex={};for(const el of[...elements]){if(!byTabIndex[el.tabIndex]){byTabIndex[el.tabIndex]=[];} 7928byTabIndex[el.tabIndex].push(el);} 7929const withTabIndexZero=byTabIndex[0]||[];delete byTabIndex[0];return[...Object.values(byTabIndex).flat(),...withTabIndexZero];} 7930__exports.getNextTabableElement=getNextTabableElement;function getNextTabableElement(container=document.body){const tabableElements=getTabableElements(container);const index=tabableElements.indexOf(document.activeElement);return index===-1?tabableElements[0]:tabableElements[index+1]||null;} 7931__exports.getPreviousTabableElement=getPreviousTabableElement;function getPreviousTabableElement(container=document.body){const tabableElements=getTabableElements(container);const index=tabableElements.indexOf(document.activeElement);return index===-1?tabableElements[tabableElements.length-1]:tabableElements[index-1]||null;} 7932return __exports;});; 7933 7934/* /web/static/src/core/utils/urls.js */ 7935odoo.define('@web/core/utils/urls',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");__exports.objectToUrlEncodedString=objectToUrlEncodedString;function objectToUrlEncodedString(obj){return Object.entries(obj).map(([k,v])=>`${encodeURIComponent(k)}=${encodeURIComponent(v || "")}`).join("&");} 7936__exports.getOrigin=getOrigin;function getOrigin(origin){if(origin){origin=origin.replace(/\/+$/,"");}else{const{host,protocol}=browser.location;origin=`${protocol}//${host}`;} 7937return origin;} 7938__exports.url=url;function url(route,queryParams,options={}){const origin=getOrigin(options.origin);if(!route){return origin;} 7939let queryString=objectToUrlEncodedString(queryParams||{});queryString=queryString.length>0?`?${queryString}`:queryString;let prefix=["http://","https://","//"].some((el)=>route.length>=el.length&&route.slice(0,el.length)===el);prefix=prefix?"":origin;return`${prefix}${route}${queryString}`;} 7940__exports.getDataURLFromFile=getDataURLFromFile;function getDataURLFromFile(file){if(!file){return Promise.reject();} 7941return new Promise((resolve,reject)=>{const reader=new FileReader();reader.addEventListener("load",()=>{if(reader.result==="data:"){resolve(`data:${file.type};base64,`);}else{resolve(reader.result);}});reader.addEventListener("abort",reject);reader.addEventListener("error",reject);reader.readAsDataURL(file);});} 7942return __exports;});; 7943 7944/* /web/static/src/core/utils/xml.js */ 7945odoo.define('@web/core/utils/xml',async function(require){'use strict';let __exports={};const{nbsp}=require("@web/core/utils/strings");const parser=new DOMParser();const xmlDocument=parser.parseFromString("<templates/>","text/xml");function hasParsingError(parsedDocument){return parsedDocument.getElementsByTagName("parsererror").length>0;} 7946const XMLParser=__exports.XMLParser=class XMLParser{parse(){} 7947visitXML(xml,callback){const visit=(el)=>{if(el){let didVisitChildren=false;const visitChildren=()=>{for(const child of el.children){visit(child);} 7948didVisitChildren=true;};const shouldVisitChildren=callback(el,visitChildren);if(shouldVisitChildren!==false&&!didVisitChildren){visitChildren();}}};const xmlDoc=typeof xml==="string"?this.parseXML(xml):xml;visit(xmlDoc);} 7949parseXML(arch){const cleanedArch=arch.replace(/&nbsp;/g,nbsp);const xml=parser.parseFromString(cleanedArch,"text/xml");if(hasParsingError(xml)){throw new Error(`An error occured while parsing ${arch}: ${xml.getElementsByTagName("parsererror")}`);} 7950return xml.documentElement;}} 7951__exports.append=append;function append(parent,node){const nodes=Array.isArray(node)?node:[node];
7951parent.append(...nodes.filter(Boolean));return parent;} 7952__exports.combineAttributes=combineAttributes;function combineAttributes(el,attr,parts,glue=" "){const allValues=[];if(el.hasAttribute(attr)){allValues.push(el.getAttribute(attr));} 7953parts=Array.isArray(parts)?parts:[parts];parts=parts.filter((part)=>!!part);allValues.push(...parts);el.setAttribute(attr,allValues.join(glue));} 7954__exports.createElement=createElement;function createElement(tagName,...args){const el=xmlDocument.createElement(tagName);for(const arg of args){if(!arg){continue;} 7955if(Symbol.iterator in arg){el.append(...arg);}else if(typeof arg==="object"){for(const name in arg){el.setAttribute(name,arg[name]);}}} 7956return el;} 7957__exports.createTextNode=createTextNode;function createTextNode(data){return xmlDocument.createTextNode(data);} 7958__exports.extractAttributes=extractAttributes;function extractAttributes(el,attributes){const attrs=Object.create(null);for(const attr of attributes){attrs[attr]=el.getAttribute(attr)||"";el.removeAttribute(attr);} 7959return attrs;} 7960__exports.getTag=getTag;function getTag(node,lower=false){const tag=(node&&node.nodeName)||"";return lower?tag.toLowerCase():tag;} 7961__exports.setAttributes=setAttributes;function setAttributes(node,attributes){for(const[name,value]of Object.entries(attributes)){node.setAttribute(name,value);}} 7962return __exports;});; 7963 7964/* /web/static/src/public/error_notifications.js */ 7965odoo.define('@web/public/error_notifications',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{odooExceptionTitleMap}=require("@web/core/errors/error_dialogs");const{_t}=require("@web/core/l10n/translation");odooExceptionTitleMap.forEach((title,exceptionName)=>{registry.category("error_notifications").add(exceptionName,{title:title,type:"warning",sticky:true,});});const sessionExpired={title:_t("Odoo Session Expired"),message:_t("Your Odoo session expired. The current page is about to be refreshed."),buttons:[{text:_t("Ok"),click:()=>window.location.reload(true),close:true,},],};registry.category("error_notifications").add("odoo.http.SessionExpiredException",sessionExpired).add("werkzeug.exceptions.Forbidden",sessionExpired).add("504",{title:_t("Request timeout"),message:_t("The operation was interrupted. This usually means that the current operation is taking too much time."),});return __exports;});; 7966 7967/* /web/static/src/legacy/utils.js */ 7968odoo.define('@web/legacy/utils',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const AbstractStorageService=require("web.AbstractStorageService");const{ConnectionAbortedError,RPCError,makeErrorFromResponse,ConnectionLostError,}=require("@web/core/network/rpc_service");const{ErrorDialog}=require("@web/core/errors/error_dialogs");const{useService}=require("@web/core/utils/hooks");const{useComponent}=require("@odoo/owl");const wowlServicesSymbol=__exports.wowlServicesSymbol=Symbol("wowlServices");__exports.makeLegacyRpcService=makeLegacyRpcService;function makeLegacyRpcService(legacyEnv){return{start(env){legacyEnv.bus.on("rpc_request",null,(rpcId)=>{env.bus.trigger("RPC:REQUEST",rpcId);});legacyEnv.bus.on("rpc_response",null,(rpcId)=>{env.bus.trigger("RPC:RESPONSE",rpcId);});legacyEnv.bus.on("rpc_response_failed",null,(rpcId)=>{env.bus.trigger("RPC:RESPONSE",rpcId);});},};} 7969__exports.makeLegacyDialogMappingService=makeLegacyDialogMappingService;function makeLegacyDialogMappingService(legacyEnv){return{dependencies:["ui","hotkey"],start(env){const{ui,hotkey}=env.services;function getModalEl(dialog){return dialog.modalRef?dialog.modalRef.el:dialog.$modal[0];} 7970function getCloseCallback(dialog){return dialog.modalRef?()=>dialog._close():()=>dialog.$modal.modal("hide");} 7971const dialogHotkeyRemoveMap=new Map();function onOpenDialog(dialog){ui.activateElement(getModalEl(dialog));const remove=hotkey.add("escape",getCloseCallback(dialog));dialogHotkeyRemoveMap.set(dialog,remove);} 7972function onCloseDialog(dialog){ui.deactivateElement(getModalEl(dialog));if(dialogHotkeyRemoveMap.has(dialog)){const removeHotkey=dialogHotkeyRemoveMap.get(dialog);removeHotkey();
7972dialogHotkeyRemoveMap.delete(dialog);}} 7973legacyEnv.bus.on("legacy_dialog_opened",null,onOpenDialog);legacyEnv.bus.on("legacy_dialog_destroyed",null,onCloseDialog);legacyEnv.bus.on("owl_dialog_mounted",null,onOpenDialog);legacyEnv.bus.on("owl_dialog_willunmount",null,onCloseDialog);},};} 7974__exports.makeLegacyCommandService=makeLegacyCommandService;function makeLegacyCommandService(legacyEnv){return{dependencies:["command"],start(env){const{command}=env.services;const commandRemoveMap=new Map();function setLegacyCommand(uniqueId,getCommandDefinition){const{name,action,options}=getCommandDefinition(env);removeLegacyCommand(uniqueId);commandRemoveMap.set(uniqueId,command.add(name,action,options));} 7975function removeLegacyCommand(uniqueId){if(commandRemoveMap.has(uniqueId)){const removeCommand=commandRemoveMap.get(uniqueId);removeCommand();commandRemoveMap.delete(uniqueId);}} 7976function openMainPalette(config={}){command.openMainPalette(config);} 7977legacyEnv.bus.on("set_legacy_command",null,setLegacyCommand);legacyEnv.bus.on("remove_legacy_command",null,removeLegacyCommand);legacyEnv.bus.on("openMainPalette",null,openMainPalette);},};} 7978__exports.makeLegacyDropdownService=makeLegacyDropdownService;function makeLegacyDropdownService(legacyEnv){return{dependencies:["ui","hotkey"],start(_,{ui,hotkey}){legacyEnv.services.ui=ui;legacyEnv.services.hotkey=hotkey;},};} 7979__exports.makeLegacySessionService=makeLegacySessionService;function makeLegacySessionService(legacyEnv,session){return{dependencies:["user"],start(env){function mapContext(){return Object.assign({},env.services.user.context);} 7980function setContext(update){env.services.user.updateContext(update);} 7981Object.defineProperty(legacyEnv.session,"userContext",{get:()=>mapContext(),set:(update)=>{setContext(update);},});Object.defineProperty(session,"user_context",{get:()=>mapContext(),set:(update)=>{setContext(update);},});},};} 7982__exports.mapLegacyEnvToWowlEnv=mapLegacyEnvToWowlEnv;function mapLegacyEnvToWowlEnv(legacyEnv,wowlEnv){legacyEnv[wowlServicesSymbol]=wowlEnv.services;legacyEnv.session.rpc=(...args)=>{let rejection;const prom=new Promise((resolve,reject)=>{const[route,params,settings={}]=args;if(params&¶ms.kwargs){params.kwargs.context=Object.assign({},legacyEnv.session.user_context,params.kwargs.context,);if(settings.noContextKeys){const keys=settings.noContextKeys;if(typeof(keys)==='string'){delete params.kwargs.context[keys];}else{for(const key of keys){delete params.kwargs.context[key];}}}} 7983const jsonrpc=wowlEnv.services.rpc(route,params,{silent:settings.shadow,xhr:settings.xhr,});rejection=()=>{jsonrpc.abort();};jsonrpc.then(resolve).catch((reason)=>{if(reason instanceof RPCError||reason instanceof ConnectionLostError){reject({message:reason,event:$.Event(),legacy:true});}else if(reason instanceof ConnectionAbortedError){reject({message:reason.message,event:$.Event("abort")});}else{reject(reason);}});});prom.abort=rejection;return prom;};function mapStorage(storage){const StorageService=AbstractStorageService.extend({storage});return new StorageService();} 7984legacyEnv.services.local_storage=mapStorage(browser.localStorage);legacyEnv.services.session_storage=mapStorage(browser.sessionStorage);legacyEnv.services.dialog=wowlEnv.services.dialog;wowlEnv.bus.addEventListener("WEB_CLIENT_READY",()=>{legacyEnv.bus.trigger("web_client_ready");});wowlEnv.bus.addEventListener("SCROLLER:ANCHOR_LINK_CLICKED",(ev)=>{legacyEnv.bus.trigger("SCROLLER:ANCHOR_LINK_CLICKED",ev.detail);});legacyEnv.bus.on("clear_cache",null,()=>{wowlEnv.bus.trigger("CLEAR-CACHES");});} 7985const reBSTooltip=/^bs-.*$/;__exports.cleanDomFromBootstrap=cleanDomFromBootstrap;function cleanDomFromBootstrap(){const body=document.body;const tooltips=body.querySelectorAll("body .tooltip");for(const tt of tooltips){if(Array.from(tt.classList).find((cls)=>reBSTooltip.test(cls))){tt.parentNode.removeChild(tt);}}} 7986__exports.makeLegacyNotificationService=makeLegacyNotificationService;function makeLegacyNotificationService(legacyEnv){return{dependencies:["notification"],start(env,{notification}){let notifId=0;const idsToRemoveFn={};function notify({title,message,subtitle,buttons=[],sticky,type,className,onClose,}
7986){if(subtitle){title=[title,subtitle].filter(Boolean).join(" ");} 7987if(!message&&title){message=title;title=undefined;} 7988buttons=buttons.map((button)=>{return{name:button.text,icon:button.icon,primary:button.primary,onClick:button.click,};});const removeFn=notification.add(message,{sticky,title,type,className,onClose,buttons,});const id=++notifId;idsToRemoveFn[id]=removeFn;return id;} 7989function close(id,_,wait){const removeFn=idsToRemoveFn[id];delete idsToRemoveFn[id];if(wait){browser.setTimeout(()=>{removeFn(id);},wait);}else{removeFn(id);}} 7990legacyEnv.services.notification={notify,close};},};} 7991__exports.makeLegacyCrashManagerService=makeLegacyCrashManagerService;function makeLegacyCrashManagerService(legacyEnv){return{dependencies:["dialog"],start(env){legacyEnv.services.crash_manager={show_message(message){env.services.dialog.add(ErrorDialog,{traceback:message});},rpc_error(errorResponse){Promise.reject(makeErrorFromResponse(errorResponse));},};},};} 7992__exports.wrapSuccessOrFail=wrapSuccessOrFail;function wrapSuccessOrFail(promise,{on_success,on_fail}={}){return promise.then(on_success||(()=>{})).catch((reason)=>{let alreadyThrown=false;if(on_fail){alreadyThrown=on_fail(reason)==="alreadyThrown";} 7993const error=reason instanceof Error&&"cause"in reason?reason.cause:reason;if(error instanceof Error&&!alreadyThrown){throw reason;}});} 7994__exports.makeLegacyRainbowManService=makeLegacyRainbowManService;function makeLegacyRainbowManService(legacyEnv){return{dependencies:["effect"],start(env,{effect}){legacyEnv.bus.on("show-effect",null,(payload)=>{effect.add(payload);});},};} 7995__exports.useLegacyRefs=useLegacyRefs;function useLegacyRefs(){const env=owl.useEnv();let legacyRefs;if(env.legacyRefs){legacyRefs=env.legacyRefs;}else{legacyRefs={component:null,widget:null,};} 7996owl.useChildSubEnv({legacyRefs,});return legacyRefs;} 7997__exports.useWowlService=useWowlService;function useWowlService(serviceName){const component=useComponent();const env=component.env;component.env={services:env[wowlServicesSymbol]};const service=useService(serviceName);component.env=env;return service;} 7998return __exports;});; 7999 8000/* /web/static/src/legacy/js/core/misc.js */ 8001odoo.define('web.framework',function(require){"use strict";var core=require('web.core');var ajax=require('web.ajax');var Widget=require('web.Widget');const{sprintf}=require('web.utils') 8002var _t=core._t;var messages_by_seconds=function(){return[[0,_t("Loading...")],[20,_t("Still loading...")],[60,_t("Still loading...<br />Please be patient.")],[120,_t("Don't leave yet,<br />it's still loading...")],[300,_t("You may not believe it,<br />but the application is actually loading...")],[420,_t("Take a minute to get a coffee,<br />because it's loading...")],[3600,_t("Maybe you should consider reloading the application by pressing F5...")]];};var Throbber=Widget.extend({template:"Throbber",start:function(){this.start_time=new Date().getTime();this.act_message();},act_message:function(){var self=this;setTimeout(function(){if(self.isDestroyed()) 8003return;var seconds=(new Date().getTime()-self.start_time)/1000;var mes;_.each(messages_by_seconds(),function(el){if(seconds>=el[0]) 8004mes=el[1];});self.$(".oe_throbber_message").html(mes);self.act_message();},1000);},});if($.blockUI){$.blockUI.defaults.baseZ=1100;$.blockUI.defaults.message='<div class="openerp oe_blockui_spin_container" style="background-color: transparent;">';$.blockUI.defaults.css.border='0';$.blockUI.defaults.css["background-color"]='';} 8005function blockAccessKeys(){var elementWithAccessKey=[];elementWithAccessKey=document.querySelectorAll('[accesskey]');_.each(elementWithAccessKey,function(elem){elem.setAttribute("data-accesskey",elem.getAttribute('accesskey'));elem.removeAttribute('accesskey');});} 8006function unblockAccessKeys(){var elementWithDataAccessKey=[];elementWithDataAccessKey=document.querySelectorAll('[data-accesskey]');_.each(elementWithDataAccessKey,function(elem){elem.setAttribute('accesskey',elem.getAttribute('data-accesskey'));elem.removeAttribute('data-accesskey');});} 8007var throbbers=[];function blockUI(){var tmp=$.blockUI.apply($,arguments);var throbber=new Throbber();throbbers.push(throbber);throbber.appendTo($(".oe_blockui_spin_container"));$(document.body).addClass('o_ui_blocked');blockAccessKeys();return tmp;} 8008function unblockUI(){_.invoke(throbbers,'destroy');throbbers=[];$(document.body).removeClass('o_ui_blocked');unblockAccessKeys();return $.unblockUI.apply($,arguments);} 8009function redirect(url,wait){var load=function(){var old=""+window.location;var old_no_hash=old.split("#")[0];var url_no_hash=url.split("#")[0];location.assign(url);if(old_no_hash===url_no_hash){location.reload(true);}};var wait_server=function(){ajax.rpc("/web/webclient/version_info",{}).then(load).guardedCatch(function(){setTimeout(wait_server,250);});};if(wait){setTimeout(wait_server,1000);}else{load();}} 8010function Reload(parent,action){var params=action.params||{};var menu_id=params.menu_id||false;var action_id=params.action_id||false;var l=window.location;var sobj=$.deparam(l.search.substr(1));if(params.url_search){sobj=_.extend(sobj,params.url_search);} 8011var search='?'+$.param(sobj);var hash=l.hash;if(menu_id){hash="#menu_id="+menu_id;if(action_id){hash+="&action="+action_id;}}else if(action_id){hash="#action="+action_id;} 8012var url=l.protocol+"//"+l.host+l.pathname+search+hash;core.bus.trigger('clear_cache');redirect(url,params.wait);} 8013core.action_registry.add("reload",Reload);
8013function Home(parent,action){var url='/'+(window.location.search||'');redirect(url,action&&action.params&&action.params.wait);} 8014core.action_registry.add("home",Home);function login(){redirect('/web/login');} 8015core.action_registry.add("login",login);function logout(){redirect('/web/session/logout');} 8016core.action_registry.add("logout",logout);function displayNotification(parent,action){let{title='',message='',links=[],type='info',sticky=false,next}=action.params||{};links=links.map(({url,label})=>`<a href="${_.escape(url)}" target="_blank">${_.escape(label)}</a>`) 8017parent.displayNotification({title,message:owl.markup(sprintf(_.escape(message),...links)),type,sticky,});return next;} 8018core.action_registry.add("display_notification",displayNotification);function ReloadContext(parent,action){ajax.rpc("/web/session/get_session_info",{}).then(function(){Reload(parent,action);});} 8019core.action_registry.add("reload_context",ReloadContext);if(!document.contains){document.contains=function contains(node){if(!(0 in arguments)){throw new TypeError('1 argument is required');} 8020do{if(this===node){return true;}}while(node=node&&node.parentNode);return false;};} 8021return{blockUI:blockUI,unblockUI:unblockUI,redirect:redirect,};});; 8022 8023/* /web/static/src/legacy/js/owl_compatibility.js */ 8024odoo.define('web.OwlCompatibility',function(require){"use strict";const{LegacyComponent}=require("@web/legacy/legacy_component");const{templates}=require("@web/core/assets");const{App,Component,onMounted,onWillStart,onWillUnmount,onPatched,onWillUpdateProps,onWillDestroy,useSubEnv,xml,status,}=owl;const widgetSymbol=odoo.widgetSymbol;const children=new WeakMap();const templateForLegacy=xml`<t/>`;const templateForOwl=xml`<t t-component="props.Component" t-props="childProps" />`;class ComponentAdapter extends LegacyComponent{constructor(props){if(!props.Component){throw Error(`ComponentAdapter: 'Component' prop is missing.`);} 8025let template;if(!(props.Component.prototype instanceof Component)){template=templateForLegacy;}else{template=templateForOwl;} 8026ComponentAdapter.template=template;super(...arguments);this.template=template;this.widget=null;} 8027setup(){onWillUpdateProps((nextProps)=>{if(this.widget){return this.updateWidget(nextProps);}});let widgetIsAttached=false;const insertWidget=()=>{this.removeEl();if(!this.widget||!this.widget.el){return;} 8028const node=this.__owl__.firstNode();node.parentNode.insertBefore(this.widget.el,node);this.widgetEl=this.widget.el;widgetIsAttached=true;};onMounted(()=>{insertWidget();if(this.widget&&this.widget.on_attach_callback){this.widget.on_attach_callback();}});onPatched(()=>{if(widgetIsAttached){this.renderWidget();}else{insertWidget();}});onWillDestroy(()=>this.__destroy(this.__owl__.parent.component));onWillStart(this.onWillStart);onWillUnmount(this.onWillUnmount);} 8029onWillStart(){if(!(this.props.Component.prototype instanceof Component)){this.widget=new this.props.Component(this,...this.widgetArgs);return this.widget._widgetRenderAndInsert(()=>{});}} 8030onWillUnmount(){if(this.widget&&this.widget.on_detach_callback){this.widget.on_detach_callback();} 8031this.removeEl();} 8032removeEl(){if(this.widgetEl){this.widgetEl.remove();this.widgetEl=null;}} 8033__destroy(){this.removeEl();if(this.widget){this.widget.destroy();}} 8034get childProps(){if(!this._childProps){this._childProps=Object.assign({},this.props);delete this._childProps.Component;} 8035return this._childProps;} 8036get widgetArgs(){if(this.props.widgetArgs){return this.props.widgetArgs;} 8037const args=Object.keys(this.props);args.splice(args.indexOf('Component'),1);if(args.length>1){throw new Error(`ComponentAdapter has more than 1 argument, 'widgetArgs' must be overriden.`);} 8038return args.map(a=>this.props[a]);} 8039updateWidget(){if(this.env.isDebug('assets')){console.warn(`ComponentAdapter: Widget could not be updated, maybe override 'updateWidget' function?`);}} 8040renderWidget(){if(this.env.isDebug('assets')){console.warn(`ComponentAdapter: Widget could not be re-rendered, maybe override 'renderWidget' function?`);}} 8041_trigger_up(ev){const evType=ev.name;const payload=ev.data;
8041if(evType==='call_service'){let args=payload.args||[];if(payload.service==='ajax'&&payload.method==='rpc'){args=args.concat(ev.target);} 8042const service=this.env.services[payload.service];if(service){const result=service[payload.method].apply(service,args);payload.callback(result);}else{throw new Error(`The service "${payload.service}" is not present in the legacy owl environment. 8043 You should probably create a mapper in @web/legacy/utils`);}}else if(evType==='get_session'){if(payload.callback){payload.callback(this.env.session);}}else if(evType==='load_views'){const params={model:payload.modelName,context:payload.context,views_descr:payload.views,};this.env.dataManager.load_views(params,payload.options||{}).then(payload.on_success);}else if(evType==='load_filters'){return this.env.dataManager.load_filters(payload).then(payload.on_success);}else{payload.__targetWidget=ev.target;this.trigger(evType.replace(/_/g,'-'),payload);}} 8044get el(){if(this.widget){return this.widget.el;} 8045return super.el;}} 8046const bodyRef={get el(){return document.body}};function standaloneAdapter(props={},ref=bodyRef){const env=owl.Component.env;const app=new App(null,{templates,env,dev:env.isDebug(),translatableAttributes:["data-tooltip"],translateFn:env._t,});if(!("Component"in props)){props.Component=owl.Component;}
8047const component=app.makeNode(ComponentAdapter,props).component;Object.defineProperty(component,"el",{get(){return ref.el;}});return component;} 8048const WidgetAdapterMixin={on_attach_callback(){for(const component of children.get(this)||[]){component.on_attach_callback();}},on_detach_callback(){for(const component of children.get(this)||[]){component.on_detach_callback();}},destroy(){for(const wrapper of children.get(this)||[]){wrapper.destroy();} 8049children.delete(this);},};function recursiveCall(node,childrenFirst=false,callback){if(!childrenFirst){callback(node);} 8050for(const child of Object.values(node.children)){recursiveCall(child,childrenFirst,callback);} 8051if(childrenFirst){callback(node);}} 8052function prepareForFinish(node){const fiber=node.fiber;const complete=fiber.complete;fiber.complete=function(){if(!this.target.ownerDocument.contains(this.target)){this.mounted=[this];} 8053complete.call(this);};} 8054const nodesToRemount=new WeakMap();function setToRemount(node,updateAndRender){let toRemount=true;if(!node.isPatched){node.isPatched=true;node.mounted.push(()=>{toRemount=false;});node.willUpdateProps.push(()=>{const rootMounted=node.fiber.root.mounted;if(toRemount&&!rootMounted.includes(node.fiber)){rootMounted.push(node.fiber);}});} 8055return()=>toRemount=true;} 8056function prepareForRemount(mainNode){const updateAndRender=mainNode.updateAndRender;recursiveCall(mainNode,false,(node)=>{if(mainNode===node){return;} 8057if(nodesToRemount.has(node)){nodesToRemount.get(node)();return;}else{nodesToRemount.set(node,setToRemount(node,updateAndRender));}});} 8058function registerWrapper(parent,wrapper){let parentChildren=children.get(parent);if(!parentChildren){parentChildren=[];children.set(parent,parentChildren);} 8059parentChildren.push(wrapper);} 8060class ProxyComponent extends LegacyComponent{setup(){for(const[hookName,cb]of Object.entries(this.props.hooks)){owl[hookName](cb);} 8061onWillUnmount(()=>{this._handledEvents=new Set();});this.parentWidget=this.props.parentWidget;this._handledEvents=new Set();useSubEnv({[widgetSymbol]:this._addListener.bind(this)});} 8062_addListener(evType){if(this.parentWidget&&!this._handledEvents.has(evType)&&status(this)==="mounted"){this._handledEvents.add(evType);this.el.addEventListener(evType,ev=>{if(!ev.cancelBubble){ev.stopPropagation();const detail=Object.assign({},ev.detail,{__originalComponent:ev.originalComponent,});this.parentWidget.trigger_up(ev.type.replace(/-/g,'_'),detail);}});}}} 8063ProxyComponent.template=xml`<t t-component="props.Component" t-props="props.props"/>`;class ComponentWrapper{constructor(parent,Component,props){if(parent instanceof Component){throw new Error("ComponentWrapper must be used with a legacy Widget as parent");} 8064this.setParent(parent);const _env=props.env;delete props.env;this.props=props;this.Component=Component;const env=_env||owl.Component.env;const appConfig={env,templates,dev:"isDebug"in env?env.isDebug():env.debug,translatableAttributes:["data-tooltip"],translateFn:env._t,};const app=new App(null,appConfig);this.app=app;this.node=this._makeOwlNode();this.env=this.node.component.env;app.root=this.node;this.__owl__=Object.create(this.node);this.componentRef={comp:null};this.status="new";this.setup();} 8065_makeOwlNode(){const resolveRender=()=>{if(this.renderResolve){this.renderResolve();}};const props={props:this.props,hooks:{onMounted:resolveRender,onPatched:resolveRender,onRendered:()=>{this.componentRef.comp=Object.values(this.node.children)[0].component;},},Component:this.Component,parentWidget:this.parentWidget,};return this.app.makeNode(ProxyComponent,props);} 8066setup(){} 8067get el(){return this.node.component.el;} 8068async mount(target,options){if(this.status==="mounted"||this.status==="willMount"){return this.render();}else if(this.status==="destroyed"){return;} 8069if(target){this.target=target;} 8070if(options){this.mountOptions=options;} 8071const remount=this.status==="unmounted";if(remount){prepareForRemount(this.node);} 8072this.status="willMount";const prom=this.app.mountNode(this.node,this.target,this.mountOptions);if(remount){this.node.fiber.deep=true;} 8073prepareForFinish(this.node);await prom;if(this.target.ownerDocument.contains(this.target)){this.status="mounted";} 8074this.node.willStart=[];const mounted=this.node.mounted;this.node.mounted=mounted.slice(0,mounted.length-1);return this;} 8075unmount(){this.on_detach_callback();this.el.remove();this.node.bdom=null;}
8076render(){if(this.status!=="mounted"){return;} 8077if(this.renderProm){this.node.render(true);return this.renderProm;} 8078this.renderProm=new Promise((resolve,reject)=>{this.renderResolve=resolve;this.renderReject=reject;}).then(()=>{this.renderProm=null;this.renderResolve=null;this.renderReject=null;});this.node.render(true);return this.renderProm;} 8079trigger(){return this.node.component.trigger(...arguments);} 8080destroy(){if(["willMount","unmounted"].includes(this.status)){recursiveCall(this.node,false,(node)=>{node.willUnmount=[];});} 8081this.app.destroy();this.status="destroyed";} 8082get $el(){return $(this.el);} 8083on_attach_callback(){if(!this.el||!this.el.ownerDocument.contains(this.el)){return;} 8084if(this.status==="mounted"){return;} 8085recursiveCall(this.node,true,(node)=>{for(const cb of node.mounted){cb();}});this.node.status=1;this.status="mounted";} 8086on_detach_callback(){if(this.status==="unmounted"){return;} 8087recursiveCall(this.node,false,(node)=>{if(node.status===1){const component=node.component;for(const cb of node.willUnmount){cb.call(component);}}});this.node.status=0;this.status="unmounted";} 8088async update(nextProps){if(this.status==="destroyed"){return;} 8089const props=this.node.component.props.props;const nextComponentProps=Object.assign({},props,nextProps);this.node.component.props.props=nextComponentProps;this.props=nextComponentProps;if(this.status==="unmounted"){return this.mount(this.target);}else{return this.render();}} 8090setParent(parent){if(parent instanceof Component){throw new Error('ComponentWrapper must be used with a legacy Widget as parent');} 8091if(parent){registerWrapper(parent,this);} 8092if(this.parentWidget){const parentChildren=children.get(this.parentWidget);parentChildren.splice(parentChildren.indexOf(this),1);} 8093this.parentWidget=parent;if(this.node){this.node.component.parentWidget=parent;}}} 8094return{ComponentAdapter,ComponentWrapper,WidgetAdapterMixin,standaloneAdapter,};});; 8095 8096/* /web/static/src/legacy/js/services/session.js */ 8097odoo.define('web.session',function(require){"use strict";var Session=require('web.Session');var session=new Session(undefined,undefined,{use_cors:false});session.is_bound=session.session_bind();return session;});; 8098 8099/* /web/static/src/legacy/js/public/public_env.js */ 8100odoo.define("web.public_env",function(require){"use strict";const commonEnv=require("web.commonEnv");return commonEnv;});; 8101 8102/* /web/static/src/legacy/js/public/public_root.js */ 8103odoo.define('@web/legacy/js/public/public_root',async function(require){'use strict';let __exports={};const dom=require('web.dom');const legacyEnv=require('web.public_env');const session=require('web.session');const{getCookie}=require('web.utils.cookies');const publicWidget=require('web.public.widget');const{registry}=require('@web/core/registry');const AbstractService=require("web.AbstractService");const lazyloader=require("web.public.lazyloader");const{makeLegacyNotificationService,makeLegacyRpcService,makeLegacySessionService,makeLegacyDialogMappingService,mapLegacyEnvToWowlEnv,makeLegacyRainbowManService,}=require("@web/legacy/utils");const{standaloneAdapter}=require("web.OwlCompatibility");const{makeEnv,startServices}=require("@web/env");const{setLoadXmlDefaultApp,loadJS,templates}=require('@web/core/assets');const{MainComponentsContainer}=require("@web/core/main_components_container");const{browser}=require('@web/core/browser/browser');const{jsonrpc}=require('@web/core/network/rpc_service');const{_t}=require("@web/core/l10n/translation");const serviceRegistry=registry.category("services");const{Component,App,whenReady}=require("@odoo/owl");function getLang(){var html=document.documentElement;return(html.getAttribute('lang')||'en_US').replace('-','_');} 8104const lang=getCookie('frontend_lang')||getLang();var localeDef=lang!=='en_US'?loadJS('/web/webclient/locale/'+lang.replace('-','_')):Promise.resolve();const PublicRoot=__exports.PublicRoot=publicWidget.RootWidget.extend({events:_.extend({},publicWidget.RootWidget.prototype.events||{},{'submit .js_website_submit_form':'_onWebsiteFormSubmit','click .js_disable_on_click':'_onDisableOnClick',}),custom_events:_.extend({},publicWidget.RootWidget.prototype.custom_events||{},{call_service:'_onCallService',context_get:'_onContextGet',main_object_request:'_onMainObjectRequest',widgets_start_request:'_onWidgetsStartRequest',widgets_stop_request:'_onWidgetsStopRequest',}),init:function(){this._super.apply(this,arguments);this.env=legacyEnv;this.publicWidgets=[];},willStart:function(){return Promise.all([this._super.apply(this,arguments),session.is_bound,localeDef]);},start:function(){var defs=[this._super.apply(this,arguments),this._startWidgets()];this.$(".o_image[data-mimetype^='image']").each(function(){var $img=$(this);if(/gif|jpe|jpg|png/.test($img.data('mimetype'))&&$img.data('src')){$img.css('background-image',"url('"+$img.data('src')+"')");}});if(window.location.hash.indexOf("scrollTop=")>-1){this.el.scrollTop=+window.location.hash.match(/scrollTop=([0-9]+)/)[1];} 8105if($.fn.placeholder){$('input, textarea').placeholder();} 8106this.$el.children().on('error.datetimepicker',this._onDateTimePickerError.bind(this));return Promise.all(defs);},_getContext:function(context){return _.extend({'lang':getLang(),},context||{});},_getExtraContext:function(context){return this._getContext(context);},_getPublicWidgetsRegistry:function(options){return publicWidget.registry;},_getRegistry:function(){return registry.category("public_root_widgets");},_startWidgets:function($from,options){var self=this;if($from===undefined){$from=this.$('#wrapwrap');if(!$from.length){$from=this.$el;}} 8107options=Object.assign({},options,{wysiwyg:$('#wrapwrap').data('wysiwyg'),});this._stopWidgets($from);var defs=_.map(this._getPublicWidgetsRegistry(options),function(PublicWidget){var selector=PublicWidget.prototype.selector||'';var $target=dom.cssFind($from,selector,true);var defs=_.map($target,function(el){var widget=new PublicWidget(self,options);self.publicWidgets.push(widget);return widget.attachTo($(el));});return Promise.all(defs);});return Promise.all(defs);},_stopWidgets:function($from){var removedWidgets=_.map(this.publicWidgets,function(widget){if(!$from||$from.filter(widget.el).length||$from.find(widget.el).length){widget.destroy();return widget;} 8108return null;});this.publicWidgets=_.difference(this.publicWidgets,removedWidgets);},_onCallService:function(ev){function _computeContext(context,noContextKeys){context=_.extend({},this._getContext(),context);if(noContextKeys){context=_.omit(context,noContextKeys);} 8109return JSON.parse(JSON.stringify(context));} 8110const payload=ev.data;
8110let args=payload.args||[];if(payload.service==='ajax'&&payload.method==='rpc'){args=args.concat(ev.target);var route=args[0];if(_.str.startsWith(route,'/web/dataset/call_kw/')){var params=args[1];var options=args[2];var noContextKeys;if(options){noContextKeys=options.noContextKeys;args[2]=_.omit(options,'noContextKeys');} 8111params.kwargs.context=_computeContext.call(this,params.kwargs.context,noContextKeys);}}else{return;} 8112const service=this.env.services[payload.service];const result=service[payload.method].apply(service,args);payload.callback(result);ev.stopPropagation();},_onContextGet:function(ev){if(ev.data.extra){ev.data.callback(this._getExtraContext(ev.data.context));}else{ev.data.callback(this._getContext(ev.data.context));}},_onMainObjectRequest:function(ev){var repr=$('html').data('main-object');var m=repr.match(/(.+)\((-?\d+),(.*)\)/);ev.data.callback({model:m[1],id:m[2]|0,});},_onWidgetsStartRequest:function(ev){this._startWidgets(ev.data.$target,ev.data.options).then(ev.data.onSuccess).guardedCatch(ev.data.onFailure);},_onWidgetsStopRequest:function(ev){this._stopWidgets(ev.data.$target);},_onWebsiteFormSubmit:function(ev){var $buttons=$(ev.currentTarget).find('button[type="submit"], a.a-submit');_.each($buttons,function(btn){var $btn=$(btn);$btn.prepend('<i class="fa fa-circle-o-notch fa-spin"></i> ');$btn.prop('disabled',true);});},_onDisableOnClick:function(ev){$(ev.currentTarget).addClass('disabled');},_onDateTimePickerError:function(ev){return false;},});owl.Component.env=legacyEnv;__exports.createPublicRoot=createPublicRoot;async function createPublicRoot(RootWidget){await lazyloader.allScriptsLoaded;AbstractService.prototype.deployServices(legacyEnv);serviceRegistry.add("legacy_rpc",makeLegacyRpcService(legacyEnv));serviceRegistry.add("legacy_session",makeLegacySessionService(legacyEnv,session));serviceRegistry.add("legacy_notification",makeLegacyNotificationService(legacyEnv));serviceRegistry.add("legacy_dialog_mapping",makeLegacyDialogMappingService(legacyEnv));serviceRegistry.add("legacy_rainbowman_service",makeLegacyRainbowManService(legacyEnv));const wowlToLegacyServiceMappers=registry.category('wowlToLegacyServiceMappers').getEntries();for(const[legacyServiceName,wowlToLegacyServiceMapper]of wowlToLegacyServiceMappers){serviceRegistry.add(legacyServiceName,wowlToLegacyServiceMapper(legacyEnv));} 8113await Promise.all([whenReady(),session.is_bound]);const baseUrl=session.prefix;const{fetch}=browser;browser.fetch=function(url,...args){if(!url.match(/^(?:https?:)?\/\//)){url=baseUrl+url;} 8114return fetch(url,...args);} 8115serviceRegistry.add("rpc",{async:true,start(env){let rpcId=0;return function rpc(route,params={},settings){if(!route.match(/^(?:https?:)?\/\//)){route=baseUrl+route;} 8116return jsonrpc(env,rpcId++,route,params,settings);};},},{force:true});const wowlEnv=makeEnv();await startServices(wowlEnv);mapLegacyEnvToWowlEnv(legacyEnv,wowlEnv);const publicRoot=new RootWidget(standaloneAdapter({Component}));const app=new App(MainComponentsContainer,{templates,env:wowlEnv,dev:wowlEnv.debug,translateFn:_t,translatableAttributes:["data-tooltip"],});setLoadXmlDefaultApp(app);await Promise.all([app.mount(document.body),publicRoot.attachTo(document.body),]);return publicRoot;} 8117__exports[Symbol.for("default")]={PublicRoot,createPublicRoot};return __exports;});odoo.define(`web.public.root`,async function(require){return require('@web/legacy/js/public/public_root')[Symbol.for("default")];});; 8118 8119/* /website/static/src/js/content/website_root_instance.js */ 8120odoo.define('@website/js/content/website_root_instance',async function(require){'use strict';let __exports={};const{createPublicRoot}=require("@web/legacy/js/public/public_root");const lazyloader=require("web.public.lazyloader");const{WebsiteRoot}=require("@website/js/content/website_root");const{loadWysiwyg}=require("web_editor.loader");const prom=createPublicRoot(WebsiteRoot).then(rootInstance=>{if(window.frameElement){let prepare=Promise.resolve();if(window.frameElement.dataset.loadWysiwyg==='true'){prepare=loadWysiwyg(['website.assets_wysiwyg_inside']);} 8121prepare.then(()=>{window.dispatchEvent(new CustomEvent('PUBLIC-ROOT-READY',{detail:{rootInstance}}));});} 8122return rootInstance;});lazyloader.registerPageReadinessDelay(prom);__exports[Symbol.for("default")]=prom;return __exports;});odoo.define(`root.widget`,async function(require){return require('@website/js/content/website_root_instance')[Symbol.for("default")];});; 8123 8124/* /web/static/src/legacy/js/public/public_widget.js */ 8125odoo.define('@web/legacy/js/public/public_widget',async function(require){'use strict';let __exports={};const dom=require('web.dom');const Widget=require('web.Widget');var RootWidget=Widget.extend({init:function(){this._super.apply(this,arguments);this._widgets=[];},start:function(){var defs=[this._super.apply(this,arguments)];defs.push(this._attachComponents());this._getRegistry().on("UPDATE",this,({operation,value})=>{if(operation==="add"){this._attachComponent(value);}});return Promise.all(defs);},_attachComponent:function(childInfo,$from){var self=this;var $elements=dom.cssFind($from||this.$el,childInfo.selector);var defs=_.map($elements,function(element){var w=new childInfo.Widget(self);self._widgets.push(w);return w.attachTo(element);});return Promise.all(defs);},_attachComponents:function($from){var self=this;var childInfos=this._getRegistry().getAll();var defs=_.map(childInfos,function(childInfo){return self._attachComponent(childInfo,$from);});return Promise.all(defs);},_getRegistry:function(){},});var PublicWidget=Widget.extend({selector:false,events:{},init:function(parent,options){this._super.apply(this,arguments);this.options=options||{};},destroy:function(){if(this.selector){var $oldel=this.$el;this.setElement(null);} 8126this._super.apply(this,arguments);if(this.selector){this.$el=$oldel;this.el=$oldel[0];this.$target=this.$el;this.target=this.el;}},setElement:function(){this._super.apply(this,arguments);if(this.selector){this.$target=this.$el;this.target=this.el;}},_delegateEvents:function(){var self=this;var originalEvents=this.events;var events={};_.each(this.events,function(method,event){if(typeof method!=='string'){events[event]=method;return;} 8127var methodOptions=method.split(' ');
8127if(methodOptions.length<=1){events[event]=method;return;} 8128var isAsync=_.contains(methodOptions,'async');if(!isAsync){events[event]=method;return;} 8129method=self.proxy(methodOptions[methodOptions.length-1]);if(_.str.startsWith(event,'click')){method=dom.makeButtonHandler(method);}else{method=dom.makeAsyncHandler(method);} 8130events[event]=method;});this.events=events;this._super.apply(this,arguments);this.events=originalEvents;},_getContext:function(extra,extraContext){var context;this.trigger_up('context_get',{extra:extra||false,context:extraContext,callback:function(ctx){context=ctx;},});return context;},});var registry={};registry._fixAppleCollapse=PublicWidget.extend({selector:'div[data-bs-toggle="collapse"]',events:{'click':function(){},},});registry.login=PublicWidget.extend({selector:'.oe_login_form',events:{'submit':'_onSubmit',},_onSubmit(ev){if(!ev.isDefaultPrevented()){const btnEl=ev.currentTarget.querySelector('button[type="submit"]');const removeLoadingEffect=dom.addButtonLoadingEffect(btnEl);const oldPreventDefault=ev.preventDefault.bind(ev);ev.preventDefault=()=>{removeLoadingEffect();oldPreventDefault();};}},});__exports[Symbol.for("default")]={RootWidget:RootWidget,Widget:PublicWidget,registry:registry,};return __exports;});odoo.define(`web.public.widget`,async function(require){return require('@web/legacy/js/public/public_widget')[Symbol.for("default")];});; 8131 8132/* /web/static/src/legacy/legacy_promise_error_handler.js */ 8133odoo.define('@web/legacy/legacy_promise_error_handler',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");function legacyRejectPromiseHandler(env,error,originalError){if(error.name.startsWith("UncaughtPromiseError")){const isLegitError=originalError&&originalError instanceof Error;const isLegacyRPC=originalError&&originalError.legacy;if(!isLegitError&&!isLegacyRPC){error.unhandledRejectionEvent.preventDefault();return true;}} 8134return false;} 8135registry.category("error_handlers").add("legacyRejectPromiseHandler",legacyRejectPromiseHandler,{sequence:1});return __exports;});; 8136 8137/* /web/static/src/legacy/legacy_rpc_error_handler.js */ 8138odoo.define('@web/legacy/legacy_rpc_error_handler',async function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const{ConnectionLostError,RPCError}=require("@web/core/network/rpc_service");const{lostConnectionHandler,rpcErrorHandler}=require("@web/core/errors/error_handlers");const errorHandlerRegistry=registry.category("error_handlers");function legacyRPCErrorHandler(env,error,originalError){if(originalError&&originalError.legacy&&originalError.message&&(originalError.message instanceof RPCError||originalError.message instanceof ConnectionLostError)){const event=originalError.event;originalError=originalError.message;if(event.isDefaultPrevented()){error.unhandledRejectionEvent.preventDefault();return true;} 8139event.preventDefault();if(originalError instanceof ConnectionLostError){return lostConnectionHandler(env,error,originalError);} 8140return rpcErrorHandler(env,error,originalError);} 8141return false;} 8142errorHandlerRegistry.add("legacyRPCErrorHandler",legacyRPCErrorHandler,{sequence:97});return __exports;});; 8143 8144/* /web/static/src/legacy/js/fields/field_utils.js */ 8145odoo.define('web.field_utils',function(require){"use strict";var core=require('web.core');var dom=require('web.dom');var session=require('web.session');var time=require('web.time');var utils=require('web.utils');var _t=core._t;const NBSP="\u00a0";function formatBinary(value,field,options){if(!value){return'';} 8146return utils.binaryToBinsize(value);} 8147function formatBoolean(value,field,options){if(options&&options.forceString){return value?_t('True'):_t('False');} 8148return dom.renderCheckbox({prop:{checked:value,disabled:true,},});} 8149function formatChar(value,field,options){value=typeof value==='string'?value:'';if(options&&options.isPassword){return _.str.repeat('*',value?value.length:0);} 8150if(options&&options.escape){value=_.escape(value);} 8151return value;} 8152function formatDate(value,field,options){if(value===false||isNaN(value)){return"";} 8153if(field&&field.type==='datetime'){if(!options||!('timezone'in options)||options.timezone){value=value.clone().add(session.getTZOffset(value),'minutes');}} 8154var date_format=time.getLangDateFormat();return value.format(date_format);} 8155function formatDateTime(value,field,options){if(value===false){return"";} 8156if(!options||!('timezone'in options)||options.timezone){value=value.clone().add(session.getTZOffset(value),'minutes');} 8157return value.format(time.getLangDatetimeFormat());} 8158function formatFloat(value,field,options){options=options||{};if(value===false){return"";} 8159if(options.humanReadable&&options.humanReadable(value)){return utils.human_number(value,options.decimals,options.minDigits,options.formatterCallback);} 8160var l10n=core._t.database.parameters;var precision;if(options.digits){precision=options.digits[1];}else if(field&&field.digits){precision=field.digits[1];}else{precision=2;} 8161var formatted=_.str.sprintf('%.'+precision+'f',value||0).split('.');formatted[0]=utils.insert_thousand_seps(formatted[0]);return formatted.join(l10n.decimal_point);} 8162function formatFloatFactor(value,field,options){var factor=options.factor||1;return formatFloat(value*factor,field,options);} 8163function formatFloatTime(value,field,options){options=options||{};var pattern=options.noLeadingZeroHour?'%1d:%02d':'%02d:%02d';if(value<0){value=Math.abs(value);pattern='-'+pattern;} 8164var hour=Math.floor(value);var min=Math.round((value%1)*60);if(min===60){min=0;hour=hour+1;} 8165return _.str.sprintf(pattern,hour,min);} 8166function formatInteger(value,field,options){options=options||{};if(options.isPassword){return _.str.repeat('*',String(value).length);} 8167if(!value&&value!==0){return"";} 8168if(options.humanReadable&&options.humanReadable(value)){return utils.human_number(value,options.decimals,options.minDigits,options.formatterCallback);} 8169return utils.insert_thousand_seps(_.str.sprintf('%d',value));} 8170function formatMany2one(value,field,options){if(!value){value='';}else if(_.isArray(value)){value=value[1];}else{while(value.data){value=value.data.display_name||'';}} 8171if(options&&options.escape){value=_.escape(value);} 8172return value;} 8173function formatX2Many(value){if(value.data.length===0){return _t('No records');}else if(value.data.length===1){return _t('1 record');}else{return value.data.length+_t(' records');}} 8174function formatMonetary(value,field,options){if(value===false){return"";} 8175options=Object.assign({forceString:false},options);var currency=options.currency;
8175if(!currency){var currency_id=options.currency_id;if(!currency_id&&options.data){var currency_field=options.currency_field||field.currency_field||'currency_id';currency_id=options.data[currency_field]&&options.data[currency_field].res_id;} 8176currency=session.get_currency(currency_id);} 8177var digits=(currency&¤cy.digits)||options.digits;if(options.field_digits===true){digits=field.digits||digits;} 8178var formatted_value=formatFloat(value,field,_.extend({},options,{digits:digits}));if(!currency||options.noSymbol){return formatted_value;} 8179const val=currency.position==='after'?[formatted_value,currency.symbol]:[currency.symbol,formatted_value];if(options.forceString){return val.join(' ');} 8180return utils.Markup(val.map((v)=>_.escape(v)).join(NBSP));} 8181function formatPercentage(value,field,options){options=options||{};let result=formatFloat(value*100,field,options)||'0';if(!options.humanReadable||!options.humanReadable(value*100)){result=parseFloat(result).toString().replace('.',_t.database.parameters.decimal_point);} 8182return result+(options.noSymbol?'':'%');} 8183function formatSelection(value,field,options){var val=_.find(field.selection,function(option){return option[0]===value;});if(!val){return'';} 8184value=val[1];if(options&&options.escape){value=_.escape(value);} 8185return value;} 8186function formatJson(value,field,options){if(!value){return'';} 8187return JSON.stringify(value);} 8188function parseSmartDateInput(value){const units={d:'days',m:'months',w:'weeks',y:'years',};const re=new RegExp(`^([+-])(\\d+)([${Object.keys(units).join('')}]?)$`);const match=re.exec(value);if(match){let date=moment();const offset=parseInt(match[2],10);const unit=units[match[3]||'d'];if(match[1]==='+'){date.add(offset,unit);}else{date.subtract(offset,unit);} 8189return date;} 8190return false;} 8191function parseDate(value,field,options){if(!value){return false;} 8192var datePattern=time.getLangDateFormat();var datePatternWoZero=time.getLangDateFormatWoZero();var date;const smartDate=parseSmartDateInput(value);if(smartDate){date=smartDate;}else{if(options&&options.isUTC){value=value.padStart(10,"0");date=moment.utc(value);}else{date=moment.utc(value,[datePattern,datePatternWoZero,moment.ISO_8601]);}} 8193if(date.isValid()){if(date.year()===0){date.year(moment.utc().year());} 8194if(date.year()>=1000){date.toJSON=function(){return this.clone().locale('en').format('YYYY-MM-DD');};return date;}} 8195throw new Error(_.str.sprintf(core._t("'%s' is not a correct date"),value));} 8196function parseDateTime(value,field,options){if(!value){return false;} 8197const datePattern=time.getLangDateFormat();const timePattern=time.getLangTimeFormat();const datePatternWoZero=time.getLangDateFormatWoZero();const timePatternWoZero=time.getLangTimeFormatWoZero();var pattern1=datePattern+' '+timePattern;var pattern2=datePatternWoZero+' '+timePatternWoZero;var datetime;const smartDate=parseSmartDateInput(value);if(smartDate){datetime=smartDate;}else{if(options&&options.isUTC){value=value.padStart(19,"0");datetime=moment.utc(value.replace(' ','T')+'Z');}else{datetime=moment.utc(value,[pattern1,pattern2,moment.ISO_8601]);if(options&&options.timezone){datetime.add(-session.getTZOffset(datetime),'minutes');}}} 8198if(datetime.isValid()){if(datetime.year()===0){datetime.year(moment.utc().year());} 8199if(datetime.year()>=1000){datetime.toJSON=function(){return this.clone().locale('en').format('YYYY-MM-DD HH:mm:ss');};return datetime;}} 8200throw new Error(_.str.sprintf(core._t("'%s' is not a correct datetime"),value));} 8201function parseNumber(value){if(core._t.database.parameters.thousands_sep){var escapedSep=_.str.escapeRegExp(core._t.database.parameters.thousands_sep);value=value.replace(new RegExp(escapedSep,'g'),'');} 8202if(core._t.database.parameters.decimal_point){value=value.replace(core._t.database.parameters.decimal_point,'.');} 8203return Number(value);} 8204function parseFloat(value){var parsed=parseNumber(value);if(isNaN(parsed)){throw new Error(_.str.sprintf(core._t("'%s' is not a correct float"),value));} 8205return parsed;} 8206function parseMonetary(value,field,options){if(!value.includes(NBSP)&&!value.includes(' ')){return parseFloat(value);} 8207options=options||{};var currency=options.currency;
8207if(!currency){var currency_id=options.currency_id;if(!currency_id&&options.data){var currency_field=options.currency_field||field.currency_field||'currency_id';currency_id=options.data[currency_field]&&options.data[currency_field].res_id;} 8208currency=session.get_currency(currency_id);} 8209if(!currency){return parseFloat(value);} 8210if(!value.includes(currency.symbol)){throw new Error(_.str.sprintf(core._t("'%s' is not a correct monetary field"),value));} 8211if(currency.position==='before'){return parseFloat(value.replace(`${ currency.symbol }${ NBSP }`,'').replace(`${ currency.symbol } `,''));}else{return parseFloat(value.replace(`${ NBSP }${ currency.symbol }`,'').replace(` ${ currency.symbol }`,''));}} 8212function parseFloatFactor(value,field,options){var parsed=parseFloat(value);var factor=options.factor||1.0;return parsed/factor;} 8213function parseFloatTime(value){var factor=1;if(value[0]==='-'){value=value.slice(1);factor=-1;} 8214var float_time_pair=value.split(":");if(float_time_pair.length!==2) 8215return factor*parseFloat(value);var hours=parseInteger(float_time_pair[0]);var minutes=parseInteger(float_time_pair[1]);return factor*(hours+(minutes/60));} 8216function parsePercentage(value){return parseFloat(value)/100;} 8217function parseInteger(value){var parsed=parseNumber(value);if(isNaN(parsed)||parsed%1||parsed<-2147483648||parsed>2147483647){throw new Error(_.str.sprintf(core._t("'%s' is not a correct integer"),value));} 8218return parsed;} 8219function parseMany2one(value){if(_.isArray(value)){return{id:value[0],display_name:value[1],};} 8220if(_.isNumber(value)||_.isString(value)){return{id:parseInt(value,10),};} 8221return value;} 8222return{format:{binary:formatBinary,boolean:formatBoolean,char:formatChar,date:formatDate,datetime:formatDateTime,float:formatFloat,float_factor:formatFloatFactor,float_time:formatFloatTime,html:_.identity,integer:formatInteger,many2many:formatX2Many,many2one:formatMany2one,many2one_reference:formatInteger,monetary:formatMonetary,one2many:formatX2Many,percentage:formatPercentage,reference:formatMany2one,selection:formatSelection,text:formatChar,json:formatJson,},parse:{binary:_.identity,boolean:_.identity,char:_.identity,date:parseDate,datetime:parseDateTime,float:parseFloat,float_factor:parseFloatFactor,float_time:parseFloatTime,html:_.identity,integer:parseInteger,many2many:_.identity,many2one:parseMany2one,many2one_reference:parseInteger,monetary:parseMonetary,one2many:_.identity,percentage:parsePercentage,reference:parseMany2one,selection:_.identity,text:_.identity,json:_.identity,},};});; 8223 8224/* /web/static/src/legacy/frontend/keyboard_navigation_mixin.js */ 8225odoo.define('web.KeyboardNavigationMixin',function(require){"use strict";var BrowserDetection=require('web.BrowserDetection');const core=require('web.core');var knownUnusableAccessKeys=[' ','A','B','C','H','J','K','L','N','P','S','Q','E','F','D','0','1','2','3','4','5','6','7','8','9'];var KeyboardNavigationMixin={events:{'keydown':'_onKeyDown','keyup':'_onKeyUp',},init:function(options){this.options=Object.assign({autoAccessKeys:true,skipRenderOverlay:false,},options);this._areAccessKeyVisible=false;this.BrowserDetection=new BrowserDetection();},start:function(){const temp=this._hideAccessKeyOverlay.bind(this);this._hideAccessKeyOverlay=()=>temp();window.addEventListener('blur',this._hideAccessKeyOverlay);core.bus.on('click',null,this._hideAccessKeyOverlay);},destroy:function(){window.removeEventListener('blur',this._hideAccessKeyOverlay);core.bus.off('click',null,this._hideAccessKeyOverlay);},_addAccessKeyOverlays:function(){if(this.options.skipRenderOverlay){return;} 8226var accesskeyElements=$(document).find('[accesskey]').filter(':visible');_.each(accesskeyElements,function(elem){var overlay=$(_.str.sprintf("
8226<div class='o_web_accesskey_overlay font-sans-serif'>%s</div>",$(elem).attr('accesskey').toUpperCase()));var $overlayParent;if(elem.tagName.toUpperCase()==="INPUT"){$overlayParent=$(elem).parent();}else{$overlayParent=$(elem);} 8227if($overlayParent.css('position')!=='absolute'){$overlayParent.css('position','relative');} 8228overlay.appendTo($overlayParent);});},_getAllUsedAccessKeys:function(){var usedAccessKeys=knownUnusableAccessKeys.slice();this.$el.find('[accesskey]').each(function(_,elem){usedAccessKeys.push(elem.accessKey.toUpperCase());});return usedAccessKeys;},_hideAccessKeyOverlay:function(){this._areAccessKeyVisible=false;var overlays=this.$el.find('.o_web_accesskey_overlay');if(overlays.length){return overlays.remove();}},_setAccessKeyOnTopNavigation:function(){this.$el.find('.o_menu_sections>li>a').each(function(number,item){item.accessKey=number+1;});},_onKeyDown:function(keyDownEvent){if($('body.o_ui_blocked').length&&(keyDownEvent.altKey||keyDownEvent.key==='Alt')&&!keyDownEvent.ctrlKey){if(keyDownEvent.preventDefault)keyDownEvent.preventDefault();else keyDownEvent.returnValue=false;if(keyDownEvent.stopPropagation)keyDownEvent.stopPropagation();if(keyDownEvent.cancelBubble)keyDownEvent.cancelBubble=true;return false;} 8229if(!this._areAccessKeyVisible&&(keyDownEvent.altKey||keyDownEvent.key==='Alt')&&!keyDownEvent.ctrlKey){this._areAccessKeyVisible=true;this._setAccessKeyOnTopNavigation();var usedAccessKey=this._getAllUsedAccessKeys();if(this.options.autoAccessKeys){var buttonsWithoutAccessKey=this.$el.find('button.btn:visible').not('[accesskey]').not('[disabled]').not('[tabindex="-1"]');_.each(buttonsWithoutAccessKey,function(elem){var buttonString=[elem.innerText,elem.title,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"].join('');for(var letterIndex=0;letterIndex<buttonString.length;letterIndex++){var candidateAccessKey=buttonString[letterIndex].toUpperCase();if(candidateAccessKey>='A'&&candidateAccessKey<='Z'&&!_.includes(usedAccessKey,candidateAccessKey)){elem.accessKey=candidateAccessKey;usedAccessKey.push(candidateAccessKey);break;}}});} 8230var elementsWithoutAriaKeyshortcut=this.$el.find('[accesskey]').not('[aria-keyshortcuts]');_.each(elementsWithoutAriaKeyshortcut,function(elem){elem.setAttribute('aria-keyshortcuts','Alt+Shift+'+elem.accessKey);});this._addAccessKeyOverlays();} 8231if(this.BrowserDetection.isOsMac()) 8232return;if(keyDownEvent.altKey&&!keyDownEvent.ctrlKey&&keyDownEvent.key.length===1){var elementWithAccessKey=[];if(keyDownEvent.keyCode>=65&&keyDownEvent.keyCode<=90||keyDownEvent.keyCode>=97&&keyDownEvent.keyCode<=122){elementWithAccessKey=document.querySelectorAll('[accesskey="'+String.fromCharCode(keyDownEvent.keyCode).toLowerCase()+'"], [accesskey="'+String.fromCharCode(keyDownEvent.keyCode).toUpperCase()+'"]');if(elementWithAccessKey.length){if(this.BrowserDetection.isOsMac()||!this.BrowserDetection.isBrowserChrome()){elementWithAccessKey[0].focus();elementWithAccessKey[0].click();if(keyDownEvent.preventDefault)keyDownEvent.preventDefault();else keyDownEvent.returnValue=false;if(keyDownEvent.stopPropagation)keyDownEvent.stopPropagation();if(keyDownEvent.cancelBubble)keyDownEvent.cancelBubble=true;return false;}}} 8233else{var numberKey;if(keyDownEvent.originalEvent.code&&keyDownEvent.originalEvent.code.indexOf('Digit')===0){numberKey=keyDownEvent.originalEvent.code[keyDownEvent.originalEvent.code.length-1];}else if(keyDownEvent.originalEvent.key&&keyDownEvent.originalEvent.key.length===1&&keyDownEvent.originalEvent.key>='0'&&keyDownEvent.originalEvent.key<='9'){numberKey=keyDownEvent.originalEvent.key;}else if(keyDownEvent.keyCode>=48&&keyDownEvent.keyCode<=57){numberKey=keyDownEvent.keyCode-48;} 8234if(numberKey>='0'&&numberKey<='9'){elementWithAccessKey=document.querySelectorAll('[accesskey="'+numberKey+'"]');if(elementWithAccessKey.length){elementWithAccessKey[0].click();if(keyDownEvent.preventDefault)keyDownEvent.preventDefault();else keyDownEvent.returnValue=false;if(keyDownEvent.stopPropagation)keyDownEvent.stopPropagation();if(keyDownEvent.cancelBubble)keyDownEvent.cancelBubble=true;return false;}}}}},_onKeyUp:function(keyUpEvent){if((keyUpEvent.altKey||keyUpEvent.key==='Alt')&&!keyUpEvent.ctrlKey){if(this.options.skipRenderOverlay){return;} 8235this._hideAccessKeyOverlay();if(keyUpEvent.preventDefault)keyUpEvent.preventDefault();else keyUpEvent.returnValue=false;if(keyUpEvent.stopPropagation)keyUpEvent.stopPropagation();if(keyUpEvent.cancelBubble)keyUpEvent.cancelBubble=true;return false;}},};return KeyboardNavigationMixin;});; 8236 8237/* /bus/static/src/im_status_service.js */ 8238odoo.define('@bus/im_status_service',async function(require){'use strict';let __exports={};const{browser}=require('@web/core/browser/browser');const{registry}=require('@web/core/registry');const UPDATE_BUS_PRESENCE_DELAY=__exports.UPDATE_BUS_PRESENCE_DELAY=60000;const imStatusService=__exports.imStatusService={dependencies:['bus_service','multi_tab','presence'],start(env,{bus_service,multi_tab,presence}){const imStatusModelToIds={};let updateBusPresenceTimeout;const throttledUpdateBusPresence=_.throttle(function updateBusPresence(){clearTimeout(updateBusPresenceTimeout);if(!multi_tab.isOnMainTab()){return;} 8239const now=new Date().getTime();bus_service.send("update_presence",{inactivity_period:now-presence.getLastPresence(),im_status_ids_by_model:{...imStatusModelToIds},});updateBusPresenceTimeout=browser.setTimeout(throttledUpdateBusPresence,UPDATE_BUS_PRESENCE_DELAY);},UPDATE_BUS_PRESENCE_DELAY);bus_service.addEventListener('connect',()=>{browser.setTimeout(throttledUpdateBusPresence,250);});multi_tab.bus.addEventListener('become_main_tab',throttledUpdateBusPresence);bus_service.addEventListener('reconnect',throttledUpdateBusPresence);multi_tab.bus.addEventListener('no_longer_main_tab',()=>clearTimeout(updateBusPresenceTimeout));bus_service.addEventListener('disconnect',()=>clearTimeout(updateBusPresenceTimeout));return{registerToImStatus(model,ids){if(!ids.length){return this.unregisterFromImStatus(model);} 8240imStatusModelToIds[model]=ids;},unregisterFromImStatus(model){delete imStatusModelToIds[model];},};},};registry.category('services').add('im_status',imStatusService);return __exports;});; 8241 8242/* /bus/static/src/multi_tab_service.js */ 8243odoo.define('@bus/multi_tab_service',async function(require){'use strict';let __exports={};const{registry}=require('@web/core/registry');const{browser}=require('@web/core/browser/browser');const{EventBus}=owl;let multiTabId=0;const multiTabService=__exports.multiTabService={start(){const bus=new EventBus();const TAB_HEARTBEAT_PERIOD=10000;const MAIN_TAB_HEARTBEAT_PERIOD=1500;const HEARTBEAT_OUT_OF_DATE_PERIOD=5000;const HEARTBEAT_KILL_OLD_PERIOD=15000;const PRIVATE_LOCAL_STORAGE_KEYS=['main','heartbeat'];let _isOnMainTab=false;let lastHeartbeat=0;let heartbeatTimeout;const sanitizedOrigin=location.origin.replace(/:\/{0,2}/g,'_');const localStoragePrefix=`${this.name}.${sanitizedOrigin}.`;const now=new Date().getTime();const tabId=`${this.name}${multiTabId++}:${now}`;function generateLocalStorageKey(baseKey){return localStoragePrefix+baseKey;} 8244function getItemFromStorage(key,defaultValue){const item=browser.localStorage.getItem(generateLocalStorageKey(key));try{return item?JSON.parse(item):defaultValue;}catch{return item;}} 8245function setItemInStorage(key,value){browser.localStorage.setItem(generateLocalStorageKey(key),JSON.stringify(value));} 8246function startElection(){if(_isOnMainTab){return;} 8247const now=new Date().getTime();const lastPresenceByTab=getItemFromStorage('lastPresenceByTab',{});const heartbeatKillOld=now-HEARTBEAT_KILL_OLD_PERIOD;let newMain;for(const[tab,lastPresence]of Object.entries(lastPresenceByTab)){if(lastPresence<heartbeatKillOld){continue;} 8248newMain=tab;break;} 8249if(newMain===tabId){lastHeartbeat=now;setItemInStorage('heartbeat',lastHeartbeat);setItemInStorage('main',true);_isOnMainTab=true;bus.trigger('become_main_tab');delete lastPresenceByTab[newMain];setItemInStorage('lastPresenceByTab',lastPresenceByTab);}} 8250function heartbeat(){const now=new Date().getTime();let heartbeatValue=getItemFromStorage('heartbeat',0);const lastPresenceByTab=getItemFromStorage('lastPresenceByTab',{});if(heartbeatValue+HEARTBEAT_OUT_OF_DATE_PERIOD<now){startElection();heartbeatValue=getItemFromStorage('heartbeat',0);} 8251if(_isOnMainTab){const cleanedTabs={};for(const[tabId,lastPresence]of Object.entries(lastPresenceByTab)){if(lastPresence+HEARTBEAT_KILL_OLD_PERIOD>now){cleanedTabs[tabId]=lastPresence;}} 8252if(heartbeatValue!==lastHeartbeat){_isOnMainTab=false;lastHeartbeat=0;lastPresenceByTab[tabId]=now;setItemInStorage('lastPresenceByTab',lastPresenceByTab);bus.trigger('no_longer_main_tab');}else{lastHeartbeat=now;setItemInStorage('heartbeat',now);setItemInStorage('lastPresenceByTab',cleanedTabs);}}else{lastPresenceByTab[tabId]=now;setItemInStorage('lastPresenceByTab',lastPresenceByTab);}
8253const hbPeriod=_isOnMainTab?MAIN_TAB_HEARTBEAT_PERIOD:TAB_HEARTBEAT_PERIOD;heartbeatTimeout=browser.setTimeout(heartbeat,hbPeriod);} 8254function onStorage({key,newValue}){if(key===generateLocalStorageKey('main')&&!newValue){startElection();} 8255if(PRIVATE_LOCAL_STORAGE_KEYS.includes(key)){return;} 8256if(key&&key.includes(localStoragePrefix)){const baseKey=key.replace(localStoragePrefix,'');bus.trigger('shared_value_updated',{key:baseKey,newValue});}} 8257function onPagehide(){clearTimeout(heartbeatTimeout);const lastPresenceByTab=getItemFromStorage('lastPresenceByTab',{});delete lastPresenceByTab[tabId];setItemInStorage('lastPresenceByTab',lastPresenceByTab);if(_isOnMainTab){_isOnMainTab=false;bus.trigger('no_longer_main_tab');browser.localStorage.removeItem(generateLocalStorageKey('main'));}} 8258browser.addEventListener('pagehide',onPagehide);browser.addEventListener('storage',onStorage);const lastPresenceByTab=getItemFromStorage('lastPresenceByTab',{});lastPresenceByTab[tabId]=now;setItemInStorage('lastPresenceByTab',lastPresenceByTab);if(!getItemFromStorage('main')){startElection();} 8259heartbeat();return{bus,get currentTabId(){return tabId;},isOnMainTab(){return _isOnMainTab;},getSharedValue(key,defaultValue){return getItemFromStorage(key,defaultValue);},setSharedValue(key,value){if(value===undefined){return this.removeSharedValue(key);} 8260setItemInStorage(key,value);},removeSharedValue(key){browser.localStorage.removeItem(generateLocalStorageKey(key));},};},};registry.category('services').add('multi_tab',multiTabService);return __exports;});; 8261 8262/* /bus/static/src/services/bus_service.js */ 8263odoo.define('@bus/services/bus_service',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{Deferred}=require("@web/core/utils/concurrency");const{registry}=require('@web/core/registry');const{session}=require('@web/session');const{isIosApp}=require('@web/core/browser/feature_detection');const{WORKER_VERSION}=require("@bus/workers/websocket_worker");const legacySession=require("web.session");const{EventBus}=owl;const busService=__exports.busService={dependencies:['localization','multi_tab'],async start(env,{multi_tab:multiTab}){const bus=new EventBus();let worker;let isActive=false;let isInitialized=false;let isUsingSharedWorker=browser.SharedWorker&&!isIosApp();const startTs=new Date().getTime();const connectionInitializedDeferred=new Deferred();function send(action,data){if(!worker){return;} 8264const message={action,data};if(isUsingSharedWorker){worker.port.postMessage(message);}else{worker.postMessage(message);}} 8265function handleMessage(messageEv){const{type}=messageEv.data;let{data}=messageEv.data;if(type==='notification'){multiTab.setSharedValue('last_notification_id',data[data.length-1].id);data=data.map(notification=>notification.message);}else if(type==='initialized'){isInitialized=true;connectionInitializedDeferred.resolve();return;} 8266bus.trigger(type,data);} 8267function initializeWorkerConnection(){let uid=Array.isArray(session.user_id)?session.user_id[0]:session.user_id;if(!uid&&uid!==undefined){uid=false;} 8268send('initialize_connection',{websocketURL:`${legacySession.prefix.replace("http", "ws")}/websocket`,debug:odoo.debug,lastNotificationId:multiTab.getSharedValue('last_notification_id',0),uid,startTs,});} 8269function startWorker(){let workerURL=`${legacySession.prefix}/bus/websocket_worker_bundle?v=${WORKER_VERSION}`;if(legacySession.prefix!==window.origin){const source=`importScripts("${workerURL}");`;workerURL='data:application/javascript;base64,'+window.btoa(source);} 8270const workerClass=isUsingSharedWorker?browser.SharedWorker:browser.Worker;worker=new workerClass(workerURL,{name:isUsingSharedWorker?'odoo:websocket_shared_worker':'odoo:websocket_worker',});worker.addEventListener("error",(e)=>{if(!isInitialized&&workerClass===browser.SharedWorker){console.warn('Error while loading "bus_service" SharedWorker, fallback on Worker.');isUsingSharedWorker=false;startWorker();}else if(!isInitialized){isInitialized=true;connectionInitializedDeferred.resolve();console.warn('Bus service failed to initialized.');}});if(isUsingSharedWorker){worker.port.start();worker.port.addEventListener('message',handleMessage);}else{worker.addEventListener('message',handleMessage);} 8271initializeWorkerConnection();} 8272browser.addEventListener('pagehide',({persisted})=>{if(!persisted){send('leave');}});browser.addEventListener('online',()=>{if(isActive){send('start');}});browser.addEventListener('offline',()=>send('stop'));return{addEventListener:bus.addEventListener.bind(bus),addChannel:async channel=>{if(!worker){startWorker();await connectionInitializedDeferred;} 8273send('add_channel',channel);send('start');isActive=true;},deleteChannel:channel=>send('delete_channel',channel),forceUpdateChannels:()=>send('force_update_channels'),trigger:bus.trigger.bind(bus),removeEventListener:bus.removeEventListener.bind(bus),send:(eventName,data)=>send('send',{event_name:eventName,data}),start:async()=>
8273{if(!worker){startWorker();await connectionInitializedDeferred;} 8274send('start');isActive=true;},stop:()=>{send('leave');isActive=false;},};},};registry.category('services').add('bus_service',busService);return __exports;});; 8275 8276/* /bus/static/src/services/legacy/make_bus_service_to_legacy_env.js */ 8277odoo.define('@bus/services/legacy/make_bus_service_to_legacy_env',async function(require){'use strict';let __exports={};const{registry}=require('@web/core/registry');__exports.makeBusServiceToLegacyEnv=makeBusServiceToLegacyEnv;function makeBusServiceToLegacyEnv(legacyEnv){return{dependencies:['bus_service'],start(_,{bus_service}){legacyEnv.services['bus_service']=bus_service;},};} 8278registry.category('wowlToLegacyServiceMappers').add('bus_service_to_legacy_env',makeBusServiceToLegacyEnv);return __exports;});; 8279 8280/* /bus/static/src/services/legacy/make_multi_tab_to_legacy_env.js */ 8281odoo.define('@bus/services/legacy/make_multi_tab_to_legacy_env',async function(require){'use strict';let __exports={};const{registry}=require('@web/core/registry');__exports.makeMultiTabToLegacyEnv=makeMultiTabToLegacyEnv;function makeMultiTabToLegacyEnv(legacyEnv){return{dependencies:['multi_tab'],start(_,{multi_tab}){legacyEnv.services['multi_tab']=multi_tab;},};} 8282registry.category('wowlToLegacyServiceMappers').add('multi_tab_to_legacy_env',makeMultiTabToLegacyEnv);return __exports;});; 8283 8284/* /bus/static/src/services/presence_service.js */ 8285odoo.define('@bus/services/presence_service',async function(require){'use strict';let __exports={};const{browser}=require('@web/core/browser/browser');const{registry}=require('@web/core/registry');const core=require('web.core');const presenceService=__exports.presenceService={start(env){const LOCAL_STORAGE_PREFIX='presence';env.bus.addEventListener('window_focus',isOdooFocused=>{core.bus.trigger('window_focus',isOdooFocused);});let isOdooFocused=true;let lastPresenceTime=(browser.localStorage.getItem(`${LOCAL_STORAGE_PREFIX}.lastPresence`)||new Date().getTime());function onPresence(){lastPresenceTime=new Date().getTime();browser.localStorage.setItem(`${LOCAL_STORAGE_PREFIX}.lastPresence`,lastPresenceTime);} 8286function onFocusChange(isFocused){try{isFocused=parent.document.hasFocus();}catch{} 8287isOdooFocused=isFocused;browser.localStorage.setItem(`${LOCAL_STORAGE_PREFIX}.focus`,isOdooFocused);if(isOdooFocused){lastPresenceTime=new Date().getTime();env.bus.trigger('window_focus',isOdooFocused);}} 8288function onStorage({key,newValue}){if(key===`${LOCAL_STORAGE_PREFIX}.focus`){isOdooFocused=JSON.parse(newValue);env.bus.trigger('window_focus',newValue);} 8289if(key===`${LOCAL_STORAGE_PREFIX}.lastPresence`){lastPresenceTime=JSON.parse(newValue);}} 8290browser.addEventListener('storage',onStorage);browser.addEventListener('focus',()=>onFocusChange(true));browser.addEventListener('blur',()=>onFocusChange(false));browser.addEventListener('pagehide',()=>onFocusChange(false));browser.addEventListener('click',onPresence);browser.addEventListener('keydown',onPresence);return{getLastPresence(){return lastPresenceTime;},isOdooFocused(){return isOdooFocused;}};},};registry.category('services').add('presence',presenceService);return __exports;});; 8291 8292/* /bus/static/src/workers/websocket_worker.js */ 8293odoo.define('@bus/workers/websocket_worker',async function(require){'use strict';let __exports={};const{debounce}=require('@bus/workers/websocket_worker_utils');const WEBSOCKET_CLOSE_CODES=__exports.WEBSOCKET_CLOSE_CODES=Object.freeze({CLEAN:1000,GOING_AWAY:1001,PROTOCOL_ERROR:1002,INCORRECT_DATA:1003,ABNORMAL_CLOSURE:1006,INCONSISTENT_DATA:1007,MESSAGE_VIOLATING_POLICY:1008,MESSAGE_TOO_BIG:1009,EXTENSION_NEGOTIATION_FAILED:1010,SERVER_ERROR:1011,RESTART:1012,TRY_LATER:1013,BAD_GATEWAY:1014,SESSION_EXPIRED:4001,KEEP_ALIVE_TIMEOUT:4002,RECONNECTING:4003,});const WORKER_VERSION=__exports.WORKER_VERSION='1.0.5';const INITIAL_RECONNECT_DELAY=1000;const MAXIMUM_RECONNECT_DELAY=60000;const WebsocketWorker=__exports.WebsocketWorker=class WebsocketWorker{constructor(){this.newestStartTs=undefined;this.websocketURL="";this.currentUID=null;this.isWaitingForNewUID=true;this.channelsByClient=new Map();this.connectRetryDelay=INITIAL_RECONNECT_DELAY;this.connectTimeout=null;this.debugModeByClient=new Map();this.isDebug=false;this.isReconnecting=false;this.lastChannelSubscription=null;this.lastNotificationId=0;this.messageWaitQueue=[];this._forceUpdateChannels=debounce(this._forceUpdateChannels,300,true);this._onWebsocketClose=this._onWebsocketClose.bind(this);this._onWebsocketError=this._onWebsocketError.bind(this);this._onWebsocketMessage=this._onWebsocketMessage.bind(this);this._onWebsocketOpen=this._onWebsocketOpen.bind(this);} 8294broadcast(type,data){for(const client of this.channelsByClient.keys()){client.postMessage({type,data});}} 8295registerClient(messagePort){messagePort.onmessage=ev=>{this._onClientMessage(messagePort,ev.data);};this.channelsByClient.set(messagePort,[]);} 8296sendToClient(client,type,data){client.postMessage({type,data});} 8297_onClientMessage(client,{action,data}){switch(action){case'send':return this._sendToServer(data);case'start':return this._start();case'stop':return this._stop();case'leave':return this._unregisterClient(client);case'add_channel':return this._addChannel(client,data);case'delete_channel':return this._deleteChannel(client,data);case'force_update_channels':return this._forceUpdateChannels();case'initialize_connection':return this._initializeConnection(client,data);}} 8298_addChannel(client,channel){const clientChannels=this.channelsByClient.get(client);if(!clientChannels.includes(channel)){clientChannels.push(channel);this.channelsByClient.set(client,clientChannels);this._updateChannels();}} 8299_deleteChannel(client,channel){const clientChannels=this.channelsByClient.get(client);if(!clientChannels){return;} 8300const channelIndex=clientChannels.indexOf(channel);if(channelIndex!==-1){clientChannels.splice(channelIndex,1);this._updateChannels();}} 8301_forceUpdateChannels(){this._updateChannels({force:true});} 8302_unregisterClient(client){this.channelsByClient.delete(client);this.debugModeByClient.delete(client);this.isDebug=Object.values(this.debugModeByClient).some(debugValue=>debugValue!=='');this._updateChannels();} 8303_initializeConnection(client,{debug,lastNotificationId,uid,websocketURL,startTs}){if(this.newestStartTs&&this.newestStartTs>startTs){this.debugModeByClient[client]=debug;this.isDebug=Object.values(this.debugModeByClient).some(debugValue=>debugValue!=='');this.sendToClient(client,"initialized");return;} 8304this.newestStartTs=startTs;this.websocketURL=websocketURL;this.lastNotificationId=lastNotificationId;this.debugModeByClient[client]=debug;this.isDebug=Object.values(this.debugModeByClient).some(debugValue=>debugValue!=='');const isCurrentUserKnown=uid!==undefined;if(this.isWaitingForNewUID&&isCurrentUserKnown){this.isWaitingForNewUID=false;this.currentUID=uid;} 8305if(this.currentUID!==uid&&isCurrentUserKnown){this.currentUID=uid;if(this.websocket){this.websocket.close(WEBSOCKET_CLOSE_CODES.CLEAN);} 8306this.channelsByClient.forEach((_,key)=>this.channelsByClient.set(key,[]));} 8307this.sendToClient(client,'initialized');} 8308_isWebsocketConnected(){return this.websocket&&this.websocket.readyState===1;} 8309_isWebsocketConnecting(){return this.websocket&&this.websocket.readyState===0;} 8310_isWebsocketClosing(){return this.websocket&&this.websocket.readyState===2;}
8311_onWebsocketClose({code,reason}){if(this.isDebug){console.debug(`%c${new Date().toLocaleString()} - [onClose]`,'color: #c6e; font-weight: bold;',code,reason);} 8312this.lastChannelSubscription=null;if(this.isReconnecting){return;} 8313this.broadcast('disconnect',{code,reason});if(code===WEBSOCKET_CLOSE_CODES.CLEAN){return;} 8314this.broadcast('reconnecting',{closeCode:code});this.isReconnecting=true;if(code===WEBSOCKET_CLOSE_CODES.KEEP_ALIVE_TIMEOUT){this.connectRetryDelay=0;} 8315if(code===WEBSOCKET_CLOSE_CODES.SESSION_EXPIRED){this.isWaitingForNewUID=true;} 8316this._retryConnectionWithDelay();} 8317_onWebsocketError(){if(this.isDebug){console.debug(`%c${new Date().toLocaleString()} - [onError]`,'color: #c6e; font-weight: bold;');} 8318this._retryConnectionWithDelay();} 8319_onWebsocketMessage(messageEv){const notifications=JSON.parse(messageEv.data);if(this.isDebug){console.debug(`%c${new Date().toLocaleString()} - [onMessage]`,'color: #c6e; font-weight: bold;',notifications);} 8320this.lastNotificationId=notifications[notifications.length-1].id;this.broadcast('notification',notifications);} 8321_onWebsocketOpen(){if(this.isDebug){console.debug(`%c${new Date().toLocaleString()} - [onOpen]`,'color: #c6e; font-weight: bold;');} 8322this._updateChannels();this.messageWaitQueue.forEach(msg=>this.websocket.send(msg));this.messageWaitQueue=[];this.broadcast(this.isReconnecting?'reconnect':'connect');this.connectRetryDelay=INITIAL_RECONNECT_DELAY;this.connectTimeout=null;this.isReconnecting=false;} 8323_retryConnectionWithDelay(){this.connectRetryDelay=Math.min(this.connectRetryDelay*1.5,MAXIMUM_RECONNECT_DELAY)+1000*Math.random();this.connectTimeout=setTimeout(this._start.bind(this),this.connectRetryDelay);} 8324_sendToServer(message){const payload=JSON.stringify(message);if(!this._isWebsocketConnected()){this.messageWaitQueue.push(payload);}else{this.websocket.send(payload);}} 8325_start(){if(this._isWebsocketConnected()||this._isWebsocketConnecting()){return;} 8326if(this.websocket){this.websocket.removeEventListener('open',this._onWebsocketOpen);this.websocket.removeEventListener('message',this._onWebsocketMessage);this.websocket.removeEventListener('error',this._onWebsocketError);this.websocket.removeEventListener('close',this._onWebsocketClose);} 8327if(this._isWebsocketClosing()){this.lastChannelSubscription=null;this.broadcast("disconnect",{code:WEBSOCKET_CLOSE_CODES.ABNORMAL_CLOSURE});} 8328this.websocket=new WebSocket(this.websocketURL);this.websocket.addEventListener('open',this._onWebsocketOpen);this.websocket.addEventListener('error',this._onWebsocketError);this.websocket.addEventListener('message',this._onWebsocketMessage);this.websocket.addEventListener('close',this._onWebsocketClose);} 8329_stop(){clearTimeout(this.connectTimeout);this.connectRetryDelay=INITIAL_RECONNECT_DELAY;this.isReconnecting=false;this.lastChannelSubscription=null;if(this.websocket){this.websocket.close();}} 8330_updateChannels({force=false}={}){const allTabsChannels=[...new Set([].concat.apply([],[...this.channelsByClient.values()]))].sort();const allTabsChannelsString=JSON.stringify(allTabsChannels);const shouldUpdateChannelSubscription=allTabsChannelsString!==this.lastChannelSubscription;if(force||shouldUpdateChannelSubscription){this.lastChannelSubscription=allTabsChannelsString;this._sendToServer({event_name:'subscribe',data:{channels:allTabsChannels,last:this.lastNotificationId}});}}} 8331return __exports;});; 8332 8333/* /bus/static/src/workers/websocket_worker_utils.js */ 8334odoo.define('@bus/workers/websocket_worker_utils',async function(require){'use strict';let __exports={};__exports.debounce=debounce;function debounce(func,wait,immediate){let timeout;return function(){const context=this;const args=arguments;function later(){timeout=null;if(!immediate){func.apply(context,args);}} 8335const callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){func.apply(context,args);}};} 8336return __exports;});; 8337 8338/* /web_tour/static/src/js/running_tour_action_helper.js */ 8339odoo.define('web_tour.RunningTourActionHelper',function(require){"use strict";var core=require('web.core');var utils=require('web_tour.utils');var Tip=require('web_tour.Tip');var get_first_visible_element=utils.get_first_visible_element;var get_jquery_element_from_selector=utils.get_jquery_element_from_selector;var RunningTourActionHelper=core.Class.extend({init:function(tip_widget){this.tip_widget=tip_widget;},click:function(element){this._click(this._get_action_values(element));},dblclick:function(element){this._click(this._get_action_values(element),2);},tripleclick:function(element){this._click(this._get_action_values(element),3);},clicknoleave:function(element){this._click(this._get_action_values(element),1,false);},text:function(text,element){this._text(this._get_action_values(element),text);},remove_text(text,element){this._text(this._get_action_values(element),'\n');},text_blur:function(text,element){this._text_blur(this._get_action_values(element),text);},drag_and_drop:function(to,element){this._drag_and_drop_jquery(this._get_action_values(element),to);},drag_and_drop_native:function(toSel,element){const to=get_jquery_element_from_selector(toSel)[0];this._drag_and_drop(this._get_action_values(element).$element[0],to);},drag_move_and_drop:function(to,element){this._drag_move_and_drop(this._get_action_values(element),to);}
8339,keydown:function(keyCodes,element){this._keydown(this._get_action_values(element),keyCodes.split(/[,\s]+/));},auto:function(element){var values=this._get_action_values(element);if(values.consume_event==="input"){this._text(values);}else{this._click(values);}},_get_action_values:function(element){var $e=get_jquery_element_from_selector(element);var $element=element?get_first_visible_element($e):this.tip_widget.$anchor;if($element.length===0){$element=$e.first();} 8340var consume_event=element?Tip.getConsumeEventType($element):this.tip_widget.consume_event;return{$element:$element,consume_event:consume_event,};},_click:function(values,nb,leave){trigger_mouse_event(values.$element,"mouseover");values.$element.trigger("mouseenter");for(var i=1;i<=(nb||1);i++){trigger_mouse_event(values.$element,"mousedown");trigger_mouse_event(values.$element,"mouseup");trigger_mouse_event(values.$element,"click",i);if(i%2===0){trigger_mouse_event(values.$element,"dblclick");}} 8341if(leave!==false){trigger_mouse_event(values.$element,"mouseout");values.$element.trigger("mouseleave");} 8342function trigger_mouse_event($element,type,count){var e=document.createEvent("MouseEvents");e.initMouseEvent(type,true,true,window,count||0,0,0,0,0,false,false,false,false,0,$element[0]);$element[0].dispatchEvent(e);}},_text:function(values,text){this._click(values);text=text||"Test";if(values.consume_event==="input"){values.$element.trigger({type:'keydown',key:text[text.length-1]}).val(text).trigger({type:'keyup',key:text[text.length-1]});values.$element[0].dispatchEvent(new InputEvent('input',{bubbles:true,}));}else if(values.$element.is("select")){var $options=values.$element.find("option");
8342$options.prop("selected",false).removeProp("selected");var $selectedOption=$options.filter(function(){return $(this).val()===text;});if($selectedOption.length===0){$selectedOption=$options.filter(function(){return $(this).text().trim()===text;});} 8343const regex=/option\s+([0-9]+)/;if($selectedOption.length===0&®ex.test(text)){const position=parseInt(regex.exec(text)[1]);$selectedOption=$options.eq(position-1);} 8344$selectedOption.prop("selected",true);this._click(values);values.$element.trigger("input");}else{values.$element.focusIn();values.$element.trigger($.Event("keydown",{key:'_',keyCode:95}));values.$element.text(text).trigger("input");values.$element.focusInEnd();values.$element.trigger($.Event("keyup",{key:'_',keyCode:95}));} 8345values.$element[0].dispatchEvent(new Event("change",{bubbles:true,cancelable:false}));},_text_blur:function(values,text){this._text(values,text);values.$element.trigger('focusout');values.$element.trigger('blur');},_calculateCenter:function($el,selector){const center=$el.offset();if(selector&&selector.indexOf('iframe')!==-1){const iFrameOffset=$('iframe').offset();center.left+=iFrameOffset.left;center.top+=iFrameOffset.top;} 8346center.left+=$el.outerWidth()/2;center.top+=$el.outerHeight()/2;return center;},_drag_and_drop_jquery:function(values,to){var $to;const elementCenter=this._calculateCenter(values.$element);if(to){$to=get_jquery_element_from_selector(to);}else{$to=$(document.body);} 8347values.$element.trigger($.Event("mouseenter"));values.$element.trigger($.Event("mousedown",{which:1,pageX:elementCenter.left,pageY:elementCenter.top}));if(!$to.length){values.$element.trigger($.Event("mousemove",{which:1,pageX:elementCenter.left+1,pageY:elementCenter.top}));$to=get_jquery_element_from_selector(to);} 8348let toCenter=this._calculateCenter($to,to);values.$element.trigger($.Event("mousemove",{which:1,pageX:toCenter.left,pageY:toCenter.top}));toCenter=this._calculateCenter($to,to);values.$element.trigger($.Event("mouseup",{which:1,pageX:toCenter.left,pageY:toCenter.top}));},_drag_and_drop:function(element,to){const elementCenter=this._calculateCenter($(element));const toCenter=this._calculateCenter($(to));element.dispatchEvent(new Event("mouseenter"));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true,button:0,which:1,clientX:elementCenter.left,clientY:elementCenter.top,}));element.dispatchEvent(new MouseEvent("mousemove",{bubbles:true,cancelable:true,clientX:toCenter.left,clientY:toCenter.top}));to.dispatchEvent(new Event("mouseenter",{clientX:toCenter.left,clientY:toCenter.top}));element.dispatchEvent(new Event("mouseup",{bubbles:true,cancelable:true,button:0,which:1,}));},_drag_move_and_drop:function(values,params){const parts=/^\[(.+),(.+)\]@(.+) => (.+)/.exec(params);const initialMoveOffset=[parseInt(parts[1]),parseInt(parts[2])];const fromSelector=parts[3];const toSelector=parts[4];values.$element.trigger($.Event("mouseenter"));const elementCenter=this._calculateCenter(values.$element);values.$element.trigger($.Event("mousedown",{which:1,pageX:elementCenter.left,pageY:elementCenter.top}));const fromCenter=this._calculateCenter(get_jquery_element_from_selector(fromSelector),fromSelector);values.$element.trigger($.Event("mousemove",{which:1,pageX:fromCenter.left+initialMoveOffset[0],pageY:fromCenter.top+initialMoveOffset[1],}));const toCenter=this._calculateCenter(get_jquery_element_from_selector(toSelector),toSelector);values.$element.trigger($.Event("mouseup",{which:1,pageX:toCenter.left,pageY:toCenter.top}));},_keydown:function(values,keyCodes){while(keyCodes.length){const eventOptions={};const keyCode=keyCodes.shift();let insertedText=null;if(isNaN(keyCode)){eventOptions.key=keyCode;}else{const code=parseInt(keyCode,10);eventOptions.keyCode=code;eventOptions.which=code;if(code===32||(code>47&&code<58)||(code>64&&code<91)||(code>95&&code<112)||(code>185&&code<193)||(code>218&&code<223)){insertedText=String.fromCharCode(code);}} 8349values.$element.trigger(Object.assign({type:"keydown"},eventOptions));if(insertedText){values.$element[0].ownerDocument.execCommand("insertText",0,insertedText);} 8350values.$element.trigger(Object.assign({type:"keyup"},eventOptions));}},});return RunningTourActionHelper;});; 8351 8352/* /web_tour/static/src/js/tip.js */ 8353odoo.define('web_tour.Tip',function(require){"use strict";var config=require('web.config');var core=require('web.core');var Widget=require('web.Widget');var _t=core._t;var Tip=Widget.extend({template:"Tip",events:{click:'_onTipClicked',mouseenter:'_onMouseEnter',mouseleave:'_onMouseLeave',transitionend:'_onTransitionEnd',},CENTER_ON_TEXT_TAGS:['P','H1','H2','H3','H4','H5','H6'],init:function(parent,info){this._super(parent);this.info=_.defaults(info,{position:"right",width:270,space:0,overlay:{x:50,y:50,},content:_t("Click here to go to the next step."),scrollContent:_t("Scroll to reach the next step."),});this.position={top:"50%",left:"50%",};this.initialPosition=this.info.position;this.viewPortState='in';this._onAncestorScroll=_.throttle(this._onAncestorScroll,0.1);},attach_to:async function($anchor,$altAnchor){this._setupAnchor($anchor,$altAnchor);this.is_anchor_fixed_position=this.$anchor.css("position")==="fixed";await this.appendTo(document.body);if(this.isDestroyed()){return new Promise(()=>{});}},start(){this.$tooltip_overlay=this.$(".o_tooltip_overlay");this.$tooltip_content=this.$(".o_tooltip_content");this.init_width=this.$el.outerWidth();this.init_height=this.$el.outerHeight();this.$el.addClass('active');this.el.style.setProperty('width',`${this.info.width}px`,'important');this.el.style.setProperty('height','auto','important');this.el.style.setProperty('transition','none','important');this.content_width=this.$el.outerWidth(true);this.content_height=this.$el.outerHeight(true);this.$tooltip_content.html(this.info.scrollContent);this.scrollContentWidth=this.$el.outerWidth(true);this.scrollContentHeight=this.$el.outerHeight(true);this.$el.removeClass('active');this.el.style.removeProperty('width');this.el.style.removeProperty('height');this.el.style.removeProperty('transition');this.$tooltip_content.html(this.info.content);this.$window=$(window);this.$tooltip_content[0].style.fontSize=getComputedStyle(this.$tooltip_content[0])['font-size'];this.$tooltip_content.css({width:"100%",height:"100%",});_.each(this.info.event_handlers,data=>{this.$tooltip_content.on(data.event,data.selector,data.handler);});this._bind_anchor_events();this._updatePosition(true);this.$el.toggleClass('d-none',!!this.info.hidden);this.el.classList.add('o_tooltip_visible');core.bus.on("resize",this,_.debounce(function(){if(this.isDestroyed()){return;} 8354if(this.tip_opened){this._to_bubble_mode(true);}else{this._reposition();}},500));return this._super.apply(this,arguments);},destroy:function(){this._unbind_anchor_events();clearTimeout(this.timerIn);clearTimeout(this.timerOut);clearTimeout(this._transitionEndTimer);const _removeParentClass=$el=>{if($el.children(".o_tooltip").not(this.$el[0]).length===0){$el.removeClass("o_tooltip_parent");}};if(this.$el&&this.$ideal_location){_removeParentClass(this.$ideal_location);} 8355if(this.$el&&this.$furtherIdealLocation){_removeParentClass(this.$furtherIdealLocation);} 8356return this._super.apply(this,arguments);},update:function($anchor,$altAnchor){this._unbind_anchor_events();if(!$anchor.is(this.$anchor)){this._setupAnchor($anchor,$altAnchor);} 8357this._bind_anchor_events();if(!this.$el){return;} 8358this._delegateEvents();this._updatePosition(true);},isShown(){return this.el&&!this.info.hidden;},_setupAnchor:function($anchor,$altAnchor){this.$anchor=$anchor;this.$altAnchor=$altAnchor;this.$ideal_location=this._get_ideal_location();this.$furtherIdealLocation=this._get_ideal_location(this.$ideal_location);},_updatePosition:function(forceReposition=false){if(this.info.hidden){return;} 8359if(this.isDestroyed()){return;} 8360let halfHeight=0;if(this.initialPosition==='right'||this.initialPosition==='left'){halfHeight=this.$anchor.innerHe
8360ight()/2;} 8361const paddingTop=parseInt(this.$ideal_location.css('padding-top'));const topViewport=window.pageYOffset+paddingTop;const botViewport=window.pageYOffset+window.innerHeight;const topOffset=this.$anchor.offset().top;const botOffset=topOffset+this.$anchor.innerHeight();let viewPortState='in';let position=this.info.position;if(botOffset-halfHeight<topViewport){viewPortState='up';position='bottom';}else if(topOffset+halfHeight>botViewport){viewPortState='down';position='top';}else{if(topOffset<topViewport+this.$el.innerHeight()){position=halfHeight?this.initialPosition:"bottom";}else if(botOffset>botViewport-this.$el.innerHeight()){position=halfHeight?this.initialPosition:"top";}} 8362if(forceReposition||this.info.position!==position||this.viewPortState!==viewPortState){this.$el.removeClass('top right bottom left').addClass(position);this.viewPortState=viewPortState;this.info.position=position;let $location;if(this.viewPortState==='in'){this.$tooltip_content.html(this.info.content);$location=this.$ideal_location;}else{this.$tooltip_content.html(this.info.scrollContent);$location=this.$furtherIdealLocation;} 8363const $oldLocation=this.$el.parent();if(!this.tip_opened){if(!$location.is($oldLocation)){$oldLocation.removeClass('o_tooltip_parent');const cssPosition=$location.css("position");if(cssPosition==="static"||cssPosition==="relative"){$location.addClass("o_tooltip_parent");} 8364this.$el.appendTo($location);} 8365this._reposition();}}},_get_ideal_location:function($anchor=this.$anchor){var $location=this.info.location?$(this.info.location):$anchor;if($location.is("html,body")){return $(document.body);} 8366var o;var p;do{$location=$location.parent();o=$location.css("overflow");p=$location.css("position");}while($location.hasClass('dropdown-menu')||$location.hasClass('o_notebook_headers')||$location.hasClass('o_forbidden_tooltip_parent')||((o==="visible"||o.includes("hidden"))&&p!=="fixed"&&$location[0].tagName.toUpperCase()!=='BODY'));return $location;},_reposition:function(){this.$el.removeClass("o_animated");var appendAt=this.info.position;var rtlMap={left:'right',right:'left'};if(rtlMap[appendAt]&&_t.database.parameters.direction==='rtl'){appendAt=rtlMap[appendAt];} 8367let $parent=this.$ideal_location;if($parent.is('html,body')&&this.viewPortState!=="in"){this.el.style.setProperty('position','fixed','important');}else{this.el.style.removeProperty('position');} 8368if(this.viewPortState==='in'){this.$el.position({my:this._get_spaced_inverted_position(appendAt),at:appendAt,of:this.$anchor,collision:"none",using:props=>{const{top}=props;let{left}=props;const anchorEl=this.$anchor[0];if(this.CENTER_ON_TEXT_TAGS.includes(anchorEl.nodeName)&&anchorEl.hasChildNodes()){const textContainerWidth=anchorEl.getBoundingClientRect().width;const textNode=anchorEl.firstChild;const range=document.createRange();range.selectNodeContents(textNode);const textWidth=range.getBoundingClientRect().width;const alignment=window.getComputedStyle(anchorEl).getPropertyValue('text-align');const posVertical=(this.info.position==='top'||this.info.position==='bottom');if(alignment==='left'){if(posVertical){left=left-textContainerWidth/2+textWidth/2;}else if(this.info.position==='right'){left=left-textContainerWidth+textWidth;}}else if(alignment==='right'){if(posVertical){left=left+textContainerWidth/2-textWidth/2;}else if(this.info.position==='left'){left=left+textContainerWidth-textWidth;}}else if(alignment==='center'){if(this.info.position==='left'){left=left+textContainerWidth/2-textWidth/2;}else if(this.info.position==='right'){left=left-textContainerWidth/2+textWidth/2;}}} 8369this.el.style.setProperty('top',`${top}px`,'important');this.el.style.setProperty('left',`${left}px`,'important');},});}else{const paddingTop=parseInt($parent.css('padding-top'));const paddingLeft=parseInt($parent.css('padding-left'));const paddingRight=parseInt($parent.css('padding-right'));const topPosition=$parent[0].offsetTop;const center=(paddingLeft+paddingRight)+((($parent[0].clientWidth-(paddingLeft+paddingRight))/2)-this.$el[0].offsetWidth/2);let top;
8369if(this.viewPortState==='up'){top=topPosition+this.$el.innerHeight()+paddingTop;}else{top=topPosition+$parent.innerHeight()-this.$el.innerHeight()*2;} 8370this.el.style.setProperty('top',`${top}px`,'important');this.el.style.setProperty('left',`${center}px`,'important');} 8371var positionRight=_t.database.parameters.direction==='rtl'?"right":"left";var positionLeft=_t.database.parameters.direction==='rtl'?"left":"right";const offset={top:this.$el[0].offsetTop,left:this.$el[0].offsetLeft};this.$tooltip_overlay.css({top:-Math.min((this.info.position==="bottom"?this.info.space:this.info.overlay.y),offset.top),right:-Math.min((this.info.position===positionRight?this.info.space:this.info.overlay.x),this.$window.width()-(offset.left+this.init_width)),bottom:-Math.min((this.info.position==="top"?this.info.space:this.info.overlay.y),this.$window.height()-(offset.top+this.init_height)),left:-Math.min((this.info.position===positionLeft?this.info.space:this.info.overlay.x),offset.left),});this.position=offset;this.$el.addClass("o_animated");},_bind_anchor_events:function(){this.consume_event=this.info.consumeEvent||Tip.getConsumeEventType(this.$anchor,this.info.run);this.$consumeEventAnchors=this._getAnchorAndCreateEvent(this.consume_event,this.$anchor);if(this.$altAnchor.length){const consumeEvent=this.info.consumeEvent||Tip.getConsumeEventType(this.$altAnchor,this.info.run);this.$consumeEventAnchors=this.$consumeEventAnchors.add(this._getAnchorAndCreateEvent(consumeEvent,this.$altAnchor));} 8372this.$anchor.on('mouseenter.anchor',()=>this._to_info_mode());this.$anchor.on('mouseleave.anchor',()=>this._to_bubble_mode());this.$scrolableElement=this.$ideal_location.is('html,body')?$(window):this.$ideal_location;this.$scrolableElement.on('scroll.Tip',()=>this._onAncestorScroll());},_getAnchorAndCreateEvent:function(consumeEvent,$anchor){let $consumeEventAnchors=$anchor;if(consumeEvent==="drag"){$consumeEventAnchors=$anchor.closest('.ui-draggable');}else if(consumeEvent==="input"&&!$anchor.is('textarea, input')){$consumeEventAnchors=$anchor.closest("[contenteditable='true']");}else if(consumeEvent.includes('apply.daterangepicker')){$consumeEventAnchors=$anchor.parent().children('.o_field_date_range');}else if(consumeEvent==="sort"){$consumeEventAnchors=$anchor.closest('.ui-sortable');} 8373$consumeEventAnchors.on(consumeEvent+".anchor",(function(e){if(e.type!=="mousedown"||e.which===1){if(this.info.consumeVisibleOnly&&!this.isShown()){return;} 8374this.trigger("tip_consumed");this._unbind_anchor_events();}}).bind(this));return $consumeEventAnchors;},_unbind_anchor_events:function(){if(this.$anchor){this.$anchor.off(".anchor");} 8375if(this.$consumeEventAnchors){this.$consumeEventAnchors.off(".anchor");} 8376if(this.$scrolableElement){this.$scrolableElement.off('.Tip');}},_get_spaced_inverted_position:function(position){if(position==="right")return"left+"+this.info.space;if(position==="left")return"right-"+this.info.space;if(position==="bottom")return"top+"+this.info.space;return"bottom-"+this.info.space;},_to_info_mode:function(force){if(this.timerOut!==undefined){clearTimeout(this.timerOut);this.timerOut=undefined;return;} 8377if(this.tip_opened){return;} 8378if(force===true){this._build_info_mode();}else{this.timerIn=setTimeout(this._build_info_mode.bind(this),100);}},_build_info_mode:function(){clearTimeout(this.timerIn);this.timerIn=undefined;this.tip_opened=true;var offset=this.$el.offset();if(!this.$el.parent().length){return;} 8379if(this.$el.parent()[0]!==this.$el[0].ownerDocument.body){this.$el.detach();this.el.style.setProperty('top',`${offset.top}px`,'important');this.el.style.setProperty('left',`${offset.left}px`,'important');this.$el.appendTo(this.$el[0].ownerDocument.body);} 8380var mbLeft=0;var mbTop=0;var overflow=false;var posVertical=(this.info.position==="top"||this.info.position==="bottom");if(posVertical){overflow=(offset.left+this.content_width+this.info.overlay.x>this.$window.width());}else{overflow=(offset.top+this.content_height+this.info.overlay.y>this.$window.height());} 8381if(posVertical&&overflow||this.info.position==="left"||(_t.database.parameters.direction==='rtl'&&this.info.position=="right")){mbLeft-=(this.content_width-this.init_width);} 8382if(!posVertical&&overflow||this.info.position==="top"){mbTop-=(this.viewPortState==='down')?this.init_height-5:(this.content_height-this.init_height);} 8383const[contentWidth,contentHeight]=this.viewPortState==='in'?[this.content_width,this.content_height]:[this.scrollContentWidth,this.scrollContentHeight];this.$el.toggleClass("inverse",overflow);this.$el.removeClass("o_animated").addClass("active");this.el.style.setProperty('width',`${contentWidth}px`,'important');this.el.style.setProperty('height',`${contentHeight}px`,'important');this.el.style.setProperty('margin-left',`${mbLeft}px`,'important');this.el.style.setProperty('margin-top',`${mbTop}px`,'important');this._transitionEndTimer=setTimeout(()=>this._onTransitionEnd(),400);},_to_bubble_mode:function(force){if(this.timerIn!==undefined){clearTimeout(this.timerIn);this.timerIn=undefined;return;} 8384if(!this.tip_opened){return;} 8385if(force===true){this._build_bubble_mode();}else{this.timerOut=setTimeout(this._build_bubble_mode.bind(this),300);}},_build_bubble_mode:function(){clearTimeout(this.timerOut);this.timerOut=undefined;this.tip_opened=false;this.$el.removeClass("active").addClass("o_animated");this.el.style.setProperty('width',`${this.init_width}px`,'important');this.el.style.setProperty('height',`${this.init_height}px`,'important');this.el.style.setProperty('margin','0','important');this._transitionEndTimer=setTimeout(()=>this._onTransitionEnd(),400);},_onAncestorScroll:function(){if(this.tip_opened){this._to_bubble_mode(true);}else{this._updatePosition(true);}},_onMouseEnter:function(){this._to_info_mode();},_onMouseLeave:function(){this._to_bubble_mode();},_onTipClicked:function(ev){if(config.device.touch&&this.tip_opened){this._to_bubble_mode();} 8386ev.stopPropagation();},_onTransitionEnd:function(){if(this._transitionEndTimer){clearTimeout(this._transitionEndTimer);this._transitionEndTimer=undefined;if(!this.tip_opened){this._updatePosition(true);}}},});Tip.getConsumeEventType=function($element,run){if($element.has("input.o-autocomplete--input.o_input").length>0){return'AutoComplete:OPTION_SELECTED';}else if($element.hasClass('o_field_many2one')||$element.hasClass('o_field_many2manytags')){return'autocompleteselect';}else if($element.is("textarea")||$element.filter("input").is(function(){var type=$(this).attr("type");return!type||!!type.match(/^(email|number|password|search|tel|text|url)$/);}
8386)){if($element.hasClass("o_field_date_range")){return"apply.daterangepicker input";} 8387if(config.device.isMobile&&$element.closest('.o_field_widget').is('.o_field_many2one, .o_field_many2many')){return"click";} 8388return"input";}else if($element.hasClass('ui-draggable-handle')){return"drag";}else if(typeof run==='string'&&run.indexOf('drag_and_drop')===0){if($element.closest('.ui-sortable').length){return'sort';} 8389if(run.indexOf("drag_and_drop_native")===0&&$element.hasClass('o_record_draggable')||$element.closest('.o_record_draggable').length){return'mousedown';}} 8390return"click";};return Tip;});; 8391 8392/* /web_tour/static/src/js/tour_manager.js */ 8393odoo.define('web_tour.TourManager',function(require){"use strict";var core=require('web.core');var config=require('web.config');var local_storage=require('web.local_storage');var mixins=require('web.mixins');var utils=require('web_tour.utils');var TourStepUtils=require('web_tour.TourStepUtils');var RunningTourActionHelper=require('web_tour.RunningTourActionHelper');var ServicesMixin=require('web.ServicesMixin');var session=require('web.session');var Tip=require('web_tour.Tip');const{Markup}=require('web.utils');const{config:transitionConfig}=require("@web/core/transition");var _t=core._t;const{markup}=require("@odoo/owl");var RUNNING_TOUR_TIMEOUT=10000;var get_step_key=utils.get_step_key;var get_debugging_key=utils.get_debugging_key;var get_running_key=utils.get_running_key;var get_running_delay_key=utils.get_running_delay_key;var get_first_visible_element=utils.get_first_visible_element;var do_before_unload=utils.do_before_unload;var get_jquery_element_from_selector=utils.get_jquery_element_from_selector;return core.Class.extend(mixins.EventDispatcherMixin,ServicesMixin,{init:function(parent,consumed_tours,disabled=false){mixins.EventDispatcherMixin.init.call(this);this.setParent(parent);this.$body=$('body');this.active_tooltips={};this.tours={};this.consumed_tours=(consumed_tours||[]).filter(tourName=>{return!local_storage.getItem(get_debugging_key(tourName));});this.disabled=disabled;this.running_tour=local_storage.getItem(get_running_key());if(this.running_tour){transitionConfig.disabled=true;} 8394this.running_step_delay=parseInt(local_storage.getItem(get_running_delay_key()),10)||0;this.edition=(_.last(session.server_version_info)==='e')?'enterprise':'community';this._log=[];console.log('Tour Manager is ready. running_tour='+this.running_tour);},register:function(){var args=Array.prototype.slice.call(arguments);var last_arg=args[args.length-1];var name=args[0];if(this.tours[name]){console.warn(_.str.sprintf("Tour %s is already defined",name));return;} 8395var options=args.length===2?{}:args[1];var steps=last_arg instanceof Array?last_arg:[last_arg];var tour={name:options.saveAs||name,steps:steps,url:options.url,rainbowMan:options.rainbowMan===undefined?true:!!options.rainbowMan,rainbowManMessage:options.rainbowManMessage,fadeout:options.fadeout||'medium',sequence:options.sequence||1000,test:options.test,wait_for:options.wait_for||Promise.resolve(),};if(options.skip_enabled){tour.skip_link=Markup`<p><span class="o_skip_tour">${_t('Skip tour')}</span></p>`;tour.skip_handler=function(tip){this._deactivate_tip(tip);this._consume_tour(name);};} 8396this.tours[tour.name]=tour;},_waitBeforeTourStart:function(){return new Promise(function(resolve){$(function(){setTimeout(resolve);});});},_register_all:function(do_update){var self=this;if(this._allRegistered){return Promise.resolve();} 8397this._allRegistered=true;return self._waitBeforeTourStart().then(function(){return Promise.all(_.map(self.tours,function(tour,name){return self._register(do_update,tour,name);})).then(()=>self.update());});},_register:function(do_update,tour,name){const debuggingTour=local_storage.getItem(get_debugging_key(name));if(this.disabled&&!this.running_tour&&!debuggingTour){this.consumed_tours.push(name);} 8398if(tour.ready)return Promise.resolve();const tour_is_consumed=this._isTourConsumed(name);return tour.wait_for.then((function(){tour.current_step=parseInt(local_storage.getItem(get_step_key(name)))||0;tour.steps=_.filter(tour.steps,(function(step){return(!step.edition||step.edition===this.edition)&&(step.mobile===undefined||step.mobile===config.device.isMobile);}).bind(this));if(tour_is_consumed||tour.current_step>=tour.steps.length){local_storage.removeItem(get_step_key(name));tour.current_step=0;} 8399tour.ready=true;if(debuggingTour||(do_update&&(this.running_tour===name||(!this.running_tour&&!tour.test&&!tour_is_consumed)))){this._to_next_step(name,0);}}
8399).bind(this));},reset:function(tourName){const index=this.consumed_tours.indexOf(tourName);if(index>=0){this.consumed_tours.splice(index,1);} 8400local_storage.setItem(get_debugging_key(tourName),true);const tour=this.tours[tourName];tour.current_step=0;local_storage.removeItem(get_step_key(tourName));this._to_next_step(tourName,0);window.location.href=window.location.origin+(tour.url||'/web');},run:async function(tour_name,step_delay){console.log(_.str.sprintf("Preparing tour %s",tour_name));if(this.running_tour){this._deactivate_tip(this.active_tooltips[this.running_tour]);this._consume_tour(this.running_tour,_.str.sprintf("Killing tour %s",this.running_tour));return;} 8401var tour=this.tours[tour_name];if(!tour){console.warn(_.str.sprintf("Unknown Tour %s",name));return;} 8402console.log(_.str.sprintf("Running tour %s",tour_name));this.running_tour=tour_name;this.running_step_delay=step_delay||this.running_step_delay;local_storage.setItem(get_running_key(),this.running_tour);local_storage.setItem(get_running_delay_key(),this.running_step_delay);this._deactivate_tip(this.active_tooltips[tour_name]);tour.current_step=0;this._to_next_step(tour_name,0);local_storage.setItem(get_step_key(tour_name),tour.current_step);if(tour.url){this.pause();do_before_unload(null,(function(){this.play();this.update();}).bind(this));window.location.href=window.location.origin+tour.url;}else{this.update();}},pause:function(){this.paused=true;},play:function(){this.paused=false;},update:function(tour_name){if(this.paused)return;tour_name=this.running_tour||tour_name;if(tour_name){var tour=this.tours[tour_name];if(!tour||!tour.ready)return;let self=this;self._check_for_skipping_step(self.active_tooltips[tour_name],tour_name);if(this.running_tour&&this.running_tour_timeout===undefined){this._set_running_tour_timeout(this.running_tour,this.active_tooltips[this.running_tour]);} 8403setTimeout(function(){self._check_for_tooltip(self.active_tooltips[tour_name],tour_name);});}else{const sortedTooltips=Object.keys(this.active_tooltips).sort((a,b)=>this.tours[a].sequence-this.tours[b].sequence);let visibleTip=false;for(const tourName of sortedTooltips){var tip=this.active_tooltips[tourName];this._check_for_skipping_step(tip,tourName) 8404tip.hidden=visibleTip;visibleTip=this._check_for_tooltip(tip,tourName)||visibleTip;}}},_check_for_skipping_step:function(step,tour_name){if(step&&step.skip_trigger){let $skip_trigger;$skip_trigger=get_jquery_element_from_selector(step.skip_trigger);let skipping=get_first_visible_element($skip_trigger).length;if(skipping){this._to_next_step(tour_name);this.update(tour_name);}}},_check_for_tooltip:function(tip,tour_name){if(tip===undefined){return true;} 8405if($('body').hasClass('o_ui_blocked')){this._deactivate_tip(tip);this._log.push("blockUI is preventing the tip to be consumed");return false;} 8406this.$modal_displayed=$('.modal:visible').last();var $trigger;if(tip.in_modal!==false&&this.$modal_displayed.length){$trigger=this.$modal_displayed.find(tip.trigger);}else{$trigger=get_jquery_element_from_selector(tip.trigger);} 8407var $visible_trigger=get_first_visible_element($trigger);var extra_trigger=true;var $extra_trigger;if(tip.extra_trigger){$extra_trigger=get_jquery_element_from_selector(tip.extra_trigger);extra_trigger=get_first_visible_element($extra_trigger).length;} 8408var $visible_alt_trigger=$();if(tip.alt_trigger){var $alt_trigger;if(tip.in_modal!==false&&this.$modal_displayed.length){$alt_trigger=this.$modal_displayed.find(tip.alt_trigger);}else{$alt_trigger=get_jquery_element_from_selector(tip.alt_trigger);} 8409$visible_alt_trigger=get_first_visible_element($alt_trigger);} 8410var triggered=$visible_trigger.length&&extra_trigger;if(triggered){if(!tip.widget){this._activate_tip(tip,tour_name,$visible_trigger,$visible_alt_trigger);}else{tip.widget.update($visible_trigger,$visible_alt_trigger);}}else{if($trigger.iframeContainer||($extra_trigger&&$extra_trigger.iframeContainer)){var $el=$();if($trigger.iframeContainer){$el=$el.add($trigger.iframeContainer);} 8411if(($extra_trigger&&$extra_trigger.iframeContainer)&&$trigger.iframeContainer!==$extra_trigger.iframeContainer){$el=$el.add($extra_trigger.iframeContainer);} 8412var self=this;$el.off('load').one('load',function(){$el.off('load');if(self.active_tooltips[tour_name]===tip){self.update(tour_name);}});} 8413this._deactivate_tip(tip);if(this.running_tour===tour_name){this._log.push("_check_for_tooltip");this._log.push("- modal_displayed: "+this.$modal_displayed.length);this._log.push("- trigger '"+tip.trigger+"': "+$trigger.length);this._log.push("- visible trigger '"+tip.trigger+"': "+$visible_trigger.length);if($extra_trigger!==undefined){this._log.push("- extra_trigger '"+tip.extra_trigger+"': "+$extra_trigger.length);this._log.push("- visible extra_trigger '"+tip.extra_trigger+"': "+extra_trigger);}}} 8414return!!triggered;},_activate_tip:function(tip,tour_name,$anchor,$alt_trigger){var tour=this.tours[tour_name];var tip_info=tip;if(tour.skip_link){tip_info=_.extend(_.omit(tip_info,'content'),{content:Markup`${tip.content}${tour.skip_link}`,event_handlers:[{event:'click',selector:'.o_skip_tour',handler:tour.skip_handler.bind(this,tip),}],});} 8415tip.widget=new Tip(this,tip_info);if(this.running_tour!==tour_name){tip.widget.on('tip_consumed',this,this._consume_tip.bind(this,tip,tour_name));} 8416tip.widget.attach_to($anchor,$alt_trigger).then(this._to_next_running_step.bind(this,tip,tour_name));},_deactivate_tip:function(tip){if(tip&&tip.widget){tip.widget.destroy();delete tip.widget;}},_describeTip:function(tip){return tip.content?tip.content+' (trigger: '+tip.trigger+')':tip.trigger;},_consume_tip:function(tip,tour_name){this._deactivate_tip(tip);this._to_next_step(tour_name);var is_running=(this.running_tour===tour_name);if(is_running){var stepDescription=this._describeTip(tip);console.log(_.str.sprintf("Tour %s: step '%s' succeeded",tour_name,stepDescription));} 8417if(this.active_tooltips[tour_name]){local_storage.setItem(get_step_key(tour_name),this.tours[tour_name].current_step);if(is_running){this._log=[];this._set_running_tour_timeout(tour_name,this.active_tooltips[tour_name]);} 8418this.update(tour_name);}else{this._consume_tour(tour_name);}},_to_next_step:function(tour_name,inc){var tour=this.tours[tour_name];tour.current_step+=(inc!==undefined?inc:1);if(this.running_tour!==tour_name){var index=_.findIndex(tour.steps.slice(tour.current_step),function(tip){return!tip.auto;});if(index>=0){tour.current_step+=index;}else{tour.current_step=tour.steps.length;}} 8419this.active_tooltips[tour_name]=tour.steps[tour.current_step];},_isTourConsumed(tourName){return this.consumed_tours.includes(tourName);},_consume_tour:function(tour_name,error){delete this.active_tooltips[tour_name];if(this.tours[tour_name].rainbowMan&&this.running_tour!==tour_name&&this.tours[tour_name].current_step===this.tours[tour_name].steps.length){let message=this.tours[tour_name].rainbowManMessage;if(message){message=typeof message==='function'?message():message;}else{message=markup(_t('<strong><b>Good job!</b> You went through all steps of this tour.</strong>'));} 8420const fadeout=this.tours[tour_name].fadeout;core.bus.trigger('show-effect',{type:"rainbow_man",message,fadeout,});} 8421this.tours[tour_name].current_step=0;local_storage.removeItem(get_step_key(tour_name));local_storage.removeItem(get_debugging_key(tour_name));if(this.running_tour===tour_name){this._stop_running_tour_timeout();local_storage.removeItem(get_running_key());local_storage.removeItem(get_running_delay_key());this.running_tour=undefined;this.running_step_delay=undefined;if(error){_.each(this._log,function(log){console.log(log);});let documentHTML=document.documentElement.outerHTML;const iframeEls=Array.from(document.body.querySelectorAll('iframe.o_iframe'));if(iframeEls.length){const matches=documentHTML.match(/<iframe[^>]+class=["'][^"']*\bo_iframe\b[^>]+><\/iframe>/g);for(let i=0;i<matches.length;i++){const iframeWithContent=matches[i].replace(/></,`>${iframeEls[i].contentDocument.documentElement.outerHTML}<`);documentHTML=documentHTML.replace(matches[i],`\n${iframeWithContent}\n`);}} 8422console.log(documentHTML);console.error(error);}else{console.log(_.str.sprintf("Tour %s succeeded",tour_name));console.log("test successful");} 8423this._log=[];}else{var self=this;this._rpc({model:'web_tour.tour',method:'consume',args:[[tour_name]],}).then(function(){self.consumed_tours.push(tour_name);});}},_set_running_tour_timeout:function(tour_name,step){this._stop_running_tour_timeout();this.running_tour_timeout=setTimeout((function(){var descr=this._describeTip(step);this._consume_tour(tour_name,_.str.sprintf("Tour %s failed at step %s",tour_name,descr));}).bind(this),(step.timeout||RUNNING_TOUR_TIMEOUT)+this.running_step_delay);},_stop_running_tour_timeout:function(){clearTimeout(this.running_tour_timeout);this.running_tour_timeout=undefined;},_to_next_running_step:function(tip,tour_name){if(this.running_tour!==tour_name)return;var self=this;this._stop_running_tour_timeout();if(this.running_step_delay){_.delay(exec,this.running_step_delay);}else{exec();} 8424function exec(){const anchorIsInDocument=tip.widget.$anchor[0].ownerDocument.contains(tip.widget.$anchor[0]);const uiIsBlocked=$('body').hasClass('o_ui_blocked');if(!anchorIsInDocument||uiIsBlocked){self._deactivate_tip(self.active_tooltips[tour_name]);self._to_next_step(tour_name,0);
8424self.update();return;} 8425var action_helper=new RunningTourActionHelper(tip.widget);do_before_unload(self._consume_tip.bind(self,tip,tour_name));var tour=self.tours[tour_name];if(typeof tip.run==="function"){try{tip.run.call(tip.widget,action_helper);}catch(e){console.error(`Tour ${tour_name} failed at step ${self._describeTip(tip)}: ${e.message}`);throw e;}}else if(tip.run!==undefined){var m=tip.run.match(/^([a-zA-Z0-9_]+) *(?:\(? *(.+?) *\)?)?$/);try{action_helper[m[1]](m[2]);}catch(e){console.error(`Tour ${tour_name} failed at step ${self._describeTip(tip)}: ${e.message}`);throw e;}}else if(tour.current_step===tour.steps.length-1){console.log('Tour %s: ignoring action (auto) of last step',tour_name);}else{action_helper.auto();}}},stepUtils:new TourStepUtils(this)});});; 8426 8427/* /web_tour/static/src/js/tour_service.js */ 8428odoo.define('web_tour.tour',function(require){"use strict";var rootWidget=require('root.widget');var rpc=require('web.rpc');var session=require('web.session');var TourManager=require('web_tour.TourManager');const{device}=require('web.config');const untrackedClassnames=["o_tooltip","o_tooltip_content","o_tooltip_overlay"];return session.is_bound.then(function(){var defs=[];if(session.is_frontend&&session.is_admin){var def=rpc.query({model:'web_tour.tour',method:'get_consumed_tours',});defs.push(def);} 8429return Promise.all(defs).then(function(results){var consumed_tours=session.is_frontend?results[0]:session.web_tours;const disabled=session.tour_disable||device.isMobile;var tour_manager=new TourManager(rootWidget,consumed_tours,disabled);const isInIframe=window.frameElement&&window.frameElement.classList.contains('o_iframe');if(isInIframe){return tour_manager;} 8430function _isTrackedNode(node){if(node.classList){return!untrackedClassnames.some(className=>node.classList.contains(className));} 8431return true;} 8432const classSplitRegex=/\s+/g;const tooltipParentRegex=/\bo_tooltip_parent\b/;let currentMutations=[];function _processMutations(){const hasTrackedMutation=currentMutations.some(mutation=>{if(!_isTrackedNode(mutation.target)){return false;} 8433if(mutation.type==='characterData'){return true;} 8434if(mutation.type==='childList'){for(const nodes of[mutation.addedNodes,mutation.removedNodes]){for(const node of nodes){if(_isTrackedNode(node)){return true;}}} 8435return false;}else if(mutation.type==='attributes'){const oldV=mutation.oldValue?mutation.oldValue.trim():'';const newV=(mutation.target.getAttribute(mutation.attributeName)||'').trim();if(oldV===newV){return false;} 8436if(mutation.attributeName==='id'){return!(oldV.includes('sizzle')||newV.includes('sizzle'));}else if(mutation.attributeName==='class'){const hadClass=tooltipParentRegex.test(oldV);const newClasses=mutation.target.classList;const hasClass=newClasses.contains('o_tooltip_parent');return!(hadClass!==hasClass&&Math.abs(oldV.split(classSplitRegex).length-newClasses.length)===1);}} 8437return true;});currentMutations=[];if(hasTrackedMutation){tour_manager.update();}} 8438let mutationTimer;const observer=new MutationObserver(mutations=>{clearTimeout(mutationTimer);currentMutations=currentMutations.concat(mutations);mutationTimer=setTimeout(()=>_processMutations(),750);});const observerOptions={attributes:true,childList:true,subtree:true,attributeOldValue:true,characterData:true,};var start_service=(function(){return function(observe){return new Promise(function(resolve,reject){tour_manager._register_all(observe).then(function(){if(observe){observer.observe(document.body,observerOptions);const findIframe=mutations=>{for(const mutation of mutations){for(const addedNode of Array.from(mutation.addedNodes)){if(addedNode.nodeType===Node.ELEMENT_NODE){if(addedNode.classList.contains('o_iframe')){return addedNode;} 8439const iframeChildEl=addedNode.querySelector('.o_iframe');if(iframeChildEl){return iframeChildEl;}}}}};const iframeObserver=new MutationObserver(mutations=>{const iframeEl=findIframe(mutations);if(iframeEl){iframeEl.addEventListener('load',()=>{observer.observe(iframeEl.contentDocument,observerOptions);});if(!iframeEl.src){observer.observe(iframeEl.contentDocument,observerOptions);}}});iframeObserver.observe(document.body,{childList:true,subtree:true});} 8440resolve();});});};})();start_service(session.is_admin||tour_manager.running_tour);
8440if(!session.is_admin){var run=tour_manager.run;tour_manager.run=function(){var self=this;var args=arguments;start_service(true).then(function(){run.apply(self,args);if(!self.running_tour){observer.disconnect();}});};var _consume_tour=tour_manager._consume_tour;tour_manager._consume_tour=function(){_consume_tour.apply(this,arguments);observer.disconnect();};} 8441odoo.startTour=tour_manager.run.bind(tour_manager);return tour_manager;});});});; 8442 8443/* /web_tour/static/src/js/tour_step_utils.js */ 8444odoo.define('web_tour.TourStepUtils',function(require){'use strict';const{_t,Class}=require('web.core');const{Markup}=require('web.utils');return Class.extend({_getHelpMessage:(functionName,...args)=>`Generated by function tour utils ${functionName}(${args.join(', ')})`,addDebugHelp:helpMessage=>step=>{if(typeof step.debugHelp==='string'){step.debugHelp=step.debugHelp+'\n'+helpMessage;}else{step.debugHelp=helpMessage;} 8445return step;},editionEnterpriseModifier(step){step.edition='enterprise';return step;},mobileModifier(step){step.mobile=true;return step;},showAppsMenuItem(){return{edition:'community',trigger:'.o_navbar_apps_menu button',auto:true,position:'bottom',};},toggleHomeMenu(){return{edition:'enterprise',trigger:'.o_main_navbar .o_menu_toggle',content:Markup(_t('Click on the <i>Home icon</i> to navigate across apps.')),position:'bottom',};},autoExpandMoreButtons(extra_trigger){return{trigger:'.oe_button_box',extra_trigger:extra_trigger,auto:true,run:actions=>{const $more=$('.oe_button_box .o_button_more');
8445if($more.length){actions.click($more);}},};},goBackBreadcrumbsMobile(description,...extraTrigger){return extraTrigger.map(element=>({mobile:true,trigger:'.breadcrumb-item.o_back_button',extra_trigger:element,content:description,position:'bottom',debugHelp:this._getHelpMessage('goBackBreadcrumbsMobile',description,...extraTrigger),}));},goToAppSteps(dataMenuXmlid,description){return[this.showAppsMenuItem(),{trigger:`.o_app[data-menu-xmlid="${dataMenuXmlid}"]`,content:description,position:'right',edition:'community',},{trigger:`.o_app[data-menu-xmlid="${dataMenuXmlid}"]`,content:description,position:'bottom',edition:'enterprise',},].map(this.addDebugHelp(this._getHelpMessage('goToApp',dataMenuXmlid,description)));},openBuggerMenu(extraTrigger){return{mobile:true,trigger:'.o_mobile_menu_toggle',extra_trigger:extraTrigger,content:_t('Open bugger menu.'),position:'bottom',debugHelp:this._getHelpMessage('openBuggerMenu',extraTrigger),};},statusbarButtonsSteps(innerTextButton,description,extraTrigger){return[{mobile:true,auto:true,trigger:'.o_statusbar_buttons',extra_trigger:extraTrigger,run:actions=>{const $action=$('.o_statusbar_buttons .btn.dropdown-toggle:contains(Action)');if($action.length){actions.click($action);}},},{trigger:`.o_statusbar_buttons button:enabled:contains('${innerTextButton}')`,content:description,position:'bottom',},].map(this.addDebugHelp(this._getHelpMessage('statusbarButtonsSteps',innerTextButton,description,extraTrigger)));},simulateEnterKeyboardInSearchModal(){return{mobile:true,trigger:'.o_searchview_input',extra_trigger:'.modal:not(.o_inactive_modal) .dropdown-menu.o_searchview_autocomplete',position:'bottom',run:action=>{const keyEventEnter=new KeyboardEvent('keydown',{bubbles:true,cancelable:true,key:'Enter',code:'Enter',which:13,keyCode:13,});action.tip_widget.$anchor[0].dispatchEvent(keyEventEnter);},debugHelp:this._getHelpMessage('simulateEnterKeyboardInSearchModal'),};},mobileKanbanSearchMany2X(modalTitle,valueSearched){return[{mobile:true,trigger:'.o_searchview_input',extra_trigger:`.modal:not(.o_inactive_modal) .modal-title:contains('${modalTitle}')`,position:'bottom',run:`text ${valueSearched}`,},this.simulateEnterKeyboardInSearchModal(),{mobile:true,trigger:`.o_kanban_record .o_kanban_record_t
8445itle :contains('${valueSearched}')`,position:'bottom',},].map(this.addDebugHelp(this._getHelpMessage('mobileKanbanSearchMany2X',modalTitle,valueSearched)));},saveForm(options={}){return[{content:options.content||"save form",trigger:".o_form_button_save",extra_trigger:options.extra_trigger,run:"click",auto:true,},{content:"wait for save completion",trigger:'.o_form_readonly, .o_form_saved',run(){},auto:true,}];},discardForm(options={}){return[{content:options.content||"exit the form",trigger:".o_form_button_cancel",extra_trigger:options.extra_trigger,run:"click",auto:true,},{content:"wait for cancellation to complete",trigger:".o_list_view, .o_form_view > div > div > .o_form_readonly, .o_form_view > div > div > .o_form_saved",run(){},auto:true,}];}});});; 8446 8447/* /web_tour/static/src/js/tour_utils.js */ 8448odoo.define('web_tour.utils',function(require){"use strict";const{_legacyIsVisible}=require("@web/core/utils/ui");function get_step_key(name){return'tour_'+name+'_step';} 8449function get_running_key(){return'running_tour';} 8450function get_debugging_key(name){return`debugging_tour_${name}`;} 8451function get_running_delay_key(){return get_running_key()+"_delay";} 8452function get_first_visible_element($elements){for(var i=0;i<$elements.length;i++){var $i=$elements.eq(i);if(_legacyIsVisible($i[0])){return $i;}} 8453return $();} 8454function do_before_unload(if_unload_callback,if_not_unload_callback){if_unload_callback=if_unload_callback||function(){};if_not_unload_callback=if_not_unload_callback||if_unload_callback;var old_before=window.onbeforeunload;var reload_timeout;window.onbeforeunload=function(){clearTimeout(reload_timeout);window.onbeforeunload=old_before;if_unload_callback();if(old_before)return old_before.apply(this,arguments);};reload_timeout=_.defer(function(){window.onbeforeunload=old_before;if_not_unload_callback();});} 8455function get_jquery_element_from_selector(selector){const iframeSplit=_.isString(selector)&&selector.match(/(.*\biframe[^ ]*)(.*)/);if(iframeSplit&&iframeSplit[2]){var $iframe=$(`${iframeSplit[1]}:not(.o_ignore_in_tour)`);if($iframe.is('[is-ready="false"]')){return $();} 8456var $el=$iframe.contents().find(iframeSplit[2]);$el.iframeContainer=$iframe[0];return $el;}else{return $(selector);}} 8457return{get_debugging_key:get_debugging_key,'get_step_key':get_step_key,'get_running_key':get_running_key,'get_running_delay_key':get_running_delay_key,'get_first_visible_element':get_first_visible_element,'do_before_unload':do_before_unload,'get_jquery_element_from_selector':get_jquery_element_from_selector,};});; 8458 8459/* /web_tour/static/src/js/public/tour_manager.js */ 8460odoo.define('web_tour.public.TourManager',function(require){'use strict';var TourManager=require('web_tour.TourManager');var lazyloader=require('web.public.lazyloader');TourManager.include({_waitBeforeTourStart:function(){return this._super.apply(this,arguments).then(function(){return lazyloader.allScriptsLoaded;}).then(function(){return new Promise(function(resolve){setTimeout(resolve);});});},});});; 8461 8462/* /web_editor/static/src/components/media_dialog/document_selector.js */ 8463odoo.define('@web_editor/components/media_dialog/document_selector',async function(require){'use strict';let __exports={};const{Attachment,FileSelector,IMAGE_MIMETYPES}=require("@web_editor/components/media_dialog/file_selector");const DocumentAttachment=__exports.DocumentAttachment=class DocumentAttachment extends Attachment{} 8464DocumentAttachment.template='web_editor.DocumentAttachment';const DocumentSelector=__exports.DocumentSelector=class DocumentSelector extends FileSelector{setup(){super.setup();this.uploadText=this.env._t("Upload a document");this.urlPlaceholder="https://www.odoo.com/mydocument";this.addText=this.env._t("Add URL");this.searchPlaceholder=this.env._t("Search a document");this.allLoadedText=this.env._t("All documents have been loaded");} 8465get attachmentsDomain(){const domain=super.attachmentsDomain;domain.push(['mimetype','not in',IMAGE_MIMETYPES]);domain.unshift('&','|',['url','=',null],'!',['url','=like','/web/assets/%']);return domain;} 8466async onClickDocument(document){this.selectAttachment(document);await this.props.save();} 8467async fetchAttachments(...args){const attachments=await super.fetchAttachments(...args);if(this.selectInitialMedia()){for(const attachment of attachments){if(`/web/content/${attachment.id}`===this.props.media.getAttribute('href').replace(/[?].*/,'')){this.selectAttachment(attachment);}}} 8468return attachments;} 8469static async createElements(selectedMedia,{orm}){return Promise.all(selectedMedia.map(async attachment=>{const linkEl=document.createElement('a');let href=`/web/content/${encodeURIComponent(attachment.id)}?unique=${encodeURIComponent(attachment.checksum)}&download=true`;if(!attachment.public){let accessToken=attachment.access_token;if(!accessToken){[accessToken]=await orm.call('ir.attachment','generate_access_token',[attachment.id],);} 8470href+=`&access_token=${encodeURIComponent(accessToken)}`;} 8471linkEl.href=href;linkEl.title=attachment.name;linkEl.dataset.mimetype=attachment.mimetype;return linkEl;}));}}
8472DocumentSelector.mediaSpecificClasses=['o_image'];DocumentSelector.mediaSpecificStyles=[];DocumentSelector.mediaExtraClasses=[];DocumentSelector.tagNames=['A'];DocumentSelector.attachmentsListTemplate='web_editor.DocumentsListTemplate';DocumentSelector.components={...FileSelector.components,DocumentAttachment,};return __exports;});; 8473 8474/* /web_editor/static/src/components/media_dialog/file_selector.js */ 8475odoo.define('@web_editor/components/media_dialog/file_selector',async function(require){'use strict';let __exports={};const{useService}=require('@web/core/utils/hooks');const{ConfirmationDialog}=require('@web/core/confirmation_dialog/confirmation_dialog');const{Dialog}=require('@web/core/dialog/dialog');const{KeepLast}=require("@web/core/utils/concurrency");const{useDebounced}=require("@web/core/utils/timing");const{SearchMedia}=require("@web_editor/components/media_dialog/search_media");const{Component,xml,useState,useRef,onWillStart}=require("@odoo/owl");const IMAGE_MIMETYPES=__exports.IMAGE_MIMETYPES=['image/jpg','image/jpeg','image/jpe','image/png','image/svg+xml','image/gif'];const IMAGE_EXTENSIONS=__exports.IMAGE_EXTENSIONS=['.jpg','.jpeg','.jpe','.png','.svg','.gif'];class RemoveButton extends Component{setup(){this.removeTitle=this.env._t("This file is attached to the current record.");if(this.props.model==='ir.ui.view'){this.removeTitle=this.env._t("This file is a public view attachment.");}} 8476remove(ev){ev.stopPropagation();this.props.remove();}} 8477RemoveButton.template=xml`<i class="fa fa-trash o_existing_attachment_remove position-absolute top-0 end-0 p-2 bg-white-25 cursor-pointer opacity-0 opacity-100-hover z-index-1 transition-base" t-att-title="removeTitle" role="img" t-att-aria-label="removeTitle" t-on-click="this.remove"/>`;const AttachmentError=__exports.AttachmentError=class AttachmentError extends Component{setup(){this.title=this.env._t("Alert");}} 8478AttachmentError.components={Dialog};AttachmentError.template=xml` 8479<Dialog title="title"> 8480 <div class="form-text"> 8481 <p>The image could not be deleted because it is used in the 8482 following pages or views:</p> 8483 <ul t-foreach="props.views" t-as="view" t-key="view.id"> 8484 <li> 8485 <a t-att-href="'/web#model=ir.ui.view&id=' + window.encodeURIComponent(view.id)"> 8486 <t t-esc="view.name"/> 8487 </a> 8488 </li> 8489 </ul> 8490 </div> 8491 <t t-set-slot="footer"> 8492 <button class="btn btn-primary" t-on-click="() => this.props.close()"> 8493 Ok 8494 </button> 8495 </t> 8496</Dialog>`;const Attachment=__exports.Attachment=class Attachment extends Component{setup(){this.dialogs=useService('dialog');this.rpc=useService('rpc');} 8497remove(){this.dialogs.add(ConfirmationDialog,{body:this.env._t("Are you sure you want to delete this file ?"),confirm:async()=>{const prevented=await this.rpc('/web_editor/attachment/remove',{ids:[this.props.id],});if(!Object.keys(prevented).length){this.props.onRemoved(this.props.id);}else{this.dialogs.add(AttachmentError,{views:prevented[this.props.id],});}},});}} 8498Attachment.components={RemoveButton,};const FileSelectorControlPanel=__exports.FileSelectorControlPanel=class FileSelectorControlPanel extends Component{setup(){this.state=useState({showUrlInput:false,urlInput:'',isValidUrl:false,isValidFileFormat:false});this.fileInput=useRef('file-input');} 8499get showSearchServiceSelect(){return this.props.searchService&&this.props.needle;} 8500get enableUrlUploadClick(){return!this.state.showUrlInput||(this.state.urlInput&&this.state.isValidUrl&&this.state.isValidFileFormat);} 8501async onUrlUploadClick(){if(!this.state.showUrlInput){this.state.showUrlInput=true;}else{await this.props.uploadUrl(this.state.urlInput);this.state.urlInput='';}} 8502onUrlInput(ev){const{isValidUrl,isValidFileFormat}=this.props.validateUrl(ev.target.value);this.state.isValidFileFormat=isValidFileFormat;this.state.isValidUrl=isValidUrl;} 8503onClickUpload(){this.fileInput.el.click();} 8504async onChangeFileInput(){const inputFiles=this.fileInput.el.files;if(!inputFiles.length){return;} 8505await this.props.uploadFiles(inputFiles);const fileInputEl=this.fileInput.el;if(fileInputEl){fileInputEl.value="";}}} 8506FileSelectorControlPanel.template='web_editor.FileSelectorControlPanel';FileSelectorControlPanel.components={SearchMedia,};const FileSelector=__exports.FileSelector=class FileSelector extends Component{setup(){this.orm=useService('orm');this.uploadService=useService('upload');this.keepLast=new KeepLast();this.loadMoreButtonRef=useRef('load-more-button');this.state=useState({attachments:[],canLoadMoreAttachments:true,is
8506FetchingAttachments:false,needle:'',});this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY=30;onWillStart(async()=>{this.state.attachments=await this.fetchAttachments(this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY,0);});this.debouncedScroll=useDebounced(this.scrollToLoadMoreButton,500);} 8507get canLoadMore(){return this.state.canLoadMoreAttachments;} 8508get hasContent(){return this.state.attachments.length;} 8509get isFetching(){return this.state.isFetchingAttachments;} 8510get selectedAttachmentIds(){return this.props.selectedMedia[this.props.id].filter(media=>media.mediaType==='attachment').map(({id})=>id);} 8511get attachmentsDomain(){const domain=['&',['res_model','=',this.props.resModel],['res_id','=',this.props.resId||0]];domain.unshift('|',['public','=',true]);domain.push(['name','ilike',this.state.needle]);return domain;} 8512validateUrl(url){const path=url.split('?')[0];const isValidUrl=/^.+\..+$/.test(path);const isValidFileFormat=true;return{isValidUrl,isValidFileFormat,path};} 8513async fetchAttachments(limit,offset){this.state.isFetchingAttachments=true;let attachments=[];try{attachments=await this.orm.call('ir.attachment','search_read',[],{domain:this.attachmentsDomain,fields:['name','mimetype','description','checksum','url','type','res_id','res_model','public','access_token','image_src','image_width','image_height','original_id'],order:'id desc',limit,offset,});attachments.forEach(attachment=>attachment.mediaType='attachment');}catch(e){if(e.exceptionName!=='odoo.exceptions.AccessError'){throw e;}} 8514this.state.canLoadMoreAttachments=attachments.length>=this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY;this.state.isFetchingAttachments=false;return attachments;} 8515async handleLoadMore(){await this.loadMore();this.debouncedScroll();} 8516async loadMore(){return this.keepLast.add(this.fetchAttachments(this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY,this.state.attachments.length)).then((newAttachments)=>{this.state.attachments.push(...newAttachments);});} 8517async handleSearch(needle){await this.search(needle);this.debouncedScroll();} 8518async search(needle){this.state.attachments=[];this.state.needle=needle;return this.keepLast.add(this.fetchAttachments(this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY,0)).then((attachments)=>{this.state.attachments=attachments;});} 8519async uploadFiles(files){await this.uploadService.uploadFiles(files,{resModel:this.props.resModel,resId:this.props.resId},attachment=>this.onUploaded(attachment));} 8520async uploadUrl(url){await this.uploadService.uploadUrl(url,{resModel:this.props.resModel,resId:this.props.resId},attachment=>this.onUploaded(attachment));} 8521async onUploaded(attachment){this.state.attachments=[attachment,...this.state.attachments.filter(attach=>attach.id!==attachment.id)];this.selectAttachment(attachment);if(!this.props.multiSelect){await this.props.save();} 8522if(this.props.onAttachmentChange){this.props.onAttachmentChange(attachment);}} 8523onRemoved(attachmentId){this.state.attachments=this.state.attachments.filter(attachment=>attachment.id!==attachmentId);} 8524selectAttachment(attachment){this.props.selectMedia({...attachment,mediaType:'attachment'});} 8525selectInitialMedia(){return this.props.media&&this.constructor.tagNames.includes(this.props.media.tagName)&&!this.selectedAttachmentIds.length;} 8526scrollToLoadMoreButton(){if(this.state.needle||this.state.attachments.length>this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY){this.loadMoreButtonRef.el.scrollIntoView({block:'end',inline:'nearest',behavior:'smooth'});}}} 8527FileSelector.template='web_editor.FileSelector';FileSelector.components={FileSelectorControlPanel,};return __exports;});; 8528 8529/* /web_editor/static/src/components/media_dialog/icon_selector.js */ 8530odoo.define('@web_editor/components/media_dialog/icon_selector',async function(require){'use strict';let __exports={};const fonts=require('wysiwyg.fonts');const{SearchMedia}=require("@web_editor/components/media_dialog/search_media");const{Component,useState}=require("@odoo/owl");const IconSelector=__exports.IconSelector=class IconSelector extends Component{setup(){this.state=useState({fonts:this.props.fonts,needle:'',});this.searchPlaceholder=this.env._t("Search a pictogram");} 8531get selectedMediaIds(){return this.props.selectedMedia[this.props.id].map(({id})=>id);} 8532search(needle){this.state.needle=needle;if(!this.state.needle){this.state.fonts=this.props.fonts;}else{this.state.fonts=this.props.fonts.map(font=>{const icons=font.icons.filter(icon=>icon.alias.indexOf(this.state.needle)>=0);return{...font,icons};});}} 8533async onClickIcon(font,icon){this.props.selectMedia({...icon,fontBase:font.base,initialIconChanged:this.props.media&&!icon.names.some(name=>this.props.media.classList.contains(name)),});await this.props.save();} 8534static createElements(selectedMedia){return selectedMedia.map(icon=>{const iconEl=document.createElement('span');iconEl.classList.add(icon.fontBase,icon.names[0]);return iconEl;});} 8535static initFonts(){fonts.computeFonts();const allFonts=fonts.fontIcons.map(({cssData,base})=>{const uniqueIcons=Array.from(new Map(cssData.map(icon=>{const alias=icon.names.join(',');const id=`${base}_${alias}`;return[id,{...icon,alias,id}];})).values());return{base,icons:uniqueIcons};});return allFonts;}}
8536IconSelector.mediaSpecificClasses=['fa'];IconSelector.mediaSpecificStyles=['color','background-color'];IconSelector.mediaExtraClasses=['rounded-circle','rounded','img-thumbnail','shadow',/^text-\S+$/,/^bg-\S+$/,/^fa-\S+$/,];IconSelector.tagNames=['SPAN','I'];IconSelector.template='web_editor.IconSelector';IconSelector.components={SearchMedia,};return __exports;});; 8537 8538/* /web_editor/static/src/components/media_dialog/image_selector.js */ 8539odoo.define('@web_editor/components/media_dialog/image_selector',async function(require){'use strict';let __exports={};const{useService}=require('@web/core/utils/hooks');const{getCSSVariableValue,DEFAULT_PALETTE}=require('web_editor.utils');const{Attachment,FileSelector,IMAGE_MIMETYPES,IMAGE_EXTENSIONS}=require("@web_editor/components/media_dialog/file_selector");const{KeepLast}=require("@web/core/utils/concurrency");const{useRef,useState,useEffect}=require("@odoo/owl");const AutoResizeImage=__exports.AutoResizeImage=class AutoResizeImage extends Attachment{setup(){super.setup();this.image=useRef('auto-resize-image');this.container=useRef('auto-resize-image-container');this.state=useState({loaded:false,});useEffect(()=>{this.image.el.addEventListener('load',()=>this.onImageLoaded());return this.image.el.removeEventListener('load',()=>this.onImageLoaded());},()=>[]);} 8540async onImageLoaded(){if(!this.image.el){return;} 8541if(this.props.onLoaded){await this.props.onLoaded(this.image.el);if(!this.image.el){return;}} 8542const aspectRatio=this.image.el.offsetWidth/this.image.el.offsetHeight;const width=aspectRatio*this.props.minRowHeight;this.container.el.style.flexGrow=width;this.container.el.style.flexBasis=`${width}px`;this.state.loaded=true;}} 8543AutoResizeImage.template='web_editor.AutoResizeImage';const ImageSelector=__exports.ImageSelector=class ImageSelector extends FileSelector{setup(){super.setup();this.rpc=useService('rpc');this.keepLastLibraryMedia=new KeepLast();this.state.libraryMedia=[];this.state.libraryResults=null;this.state.isFetchingLibrary=false;this.state.searchService='all';this.state.showOptimized=false;this.NUMBER_OF_MEDIA_TO_DISPLAY=10;this.uploadText=this.env._t("Upload an image");this.urlPlaceholder="https://www.odoo.com/logo.png";this.addText=this.env._t("Add URL");this.searchPlaceholder=this.env._t("Search an image");this.urlWarningTitle=this.env._t("Uploaded image's format is not supported. Try with: "+IMAGE_EXTENSIONS.join(', '));this.allLoadedText=this.env._t("All images have been loaded");this.showOptimizedOption=this.env.debug;this.MIN_ROW_HEIGHT=128;this.fileMimetypes=IMAGE_MIMETYPES.join(',');} 8544get canLoadMore(){if(this.state.searchService==='media-library'){return this.state.libraryResults&&this.state.libraryMedia.length<this.state.libraryResults;} 8545return super.canLoadMore;} 8546get hasContent(){if(this.state.searchService==='all'){return super.hasContent||!!this.state.libraryMedia.length;}else if(this.state.searchService==='media-library'){return!!this.state.libraryMedia.length;} 8547return super.hasContent;} 8548get isFetching(){return super.isFetching||this.state.isFetchingLibrary;} 8549get selectedMediaIds(){return this.props.selectedMedia[this.props.id].filter(media=>media.mediaType==='libraryMedia').map(({id})=>id);} 8550get attachmentsDomain(){const domain=super.attachmentsDomain;domain.push(['mimetype','in',IMAGE_MIMETYPES]);if(!this.props.useMediaLibrary){domain.push('|',['url','=',false],'!',['url','=ilike','/web_editor/shape/%']);} 8551domain.push('!',['name','=like','%.crop']);domain.push('|',['type','=','binary'],'!',['url','=like','/%/static/%']);if(!this.env.debug){const subDomain=[false];const originalId=this.props.media&&this.props.media.dataset.originalId;if(originalId){subDomain.push(originalId);} 8552domain.push(['original_id','in',subDomain]);} 8553return domain;} 8554async uploadFiles(files){await this.uploadService.uploadFiles(files,{resModel:this.props.resModel,resId:this.props.resId,isImage:true},(attachment)=>this.onUploaded(attachment));} 8555validateUrl(...args){const{isValidUrl,path}=super.validateUrl(...args);const isValidFileFormat=IMAGE_EXTENSIONS.some(format=>path.endsWith(format));return{isValidFileFormat,isValidUrl};} 8556isInitialMedia(attachment){if(this.props.media.dataset.originalSrc){return this.props.media.dataset.originalSrc===attachment.image_src;} 8557return this.props.media.getAttribute('src')===attachment.image_src;} 8558async fetchAttachments(limit,offset){const attachments=await super.fetchAttachments(limit,offset);const primaryColors={};for(let color=1;color<=5;color++){primaryColors[color]=getCSSVariableValue('o-color-'+color);} 8559return attachments.map(attachment=>{if(attachment.image_src.startsWith('/')){const newURL=new URL(attachment.image_src,window.location.origin);if(attachment.image_src.startsWith('/web_editor/shape/')){newURL.searchParams.forEac
8559h((value,key)=>{const match=key.match(/^c([1-5])$/);if(match){newURL.searchParams.set(key,primaryColors[match[1]]);}});}else{newURL.searchParams.set('height',2*this.MIN_ROW_HEIGHT);} 8560attachment.thumbnail_src=newURL.pathname+newURL.search;} 8561if(this.selectInitialMedia()&&this.isInitialMedia(attachment)){this.selectAttachment(attachment);} 8562return attachment;});} 8563async fetchLibraryMedia(offset){if(!this.state.needle){return{media:[],results:null};} 8564this.state.isFetchingLibrary=true;try{const response=await this.rpc('/web_editor/media_library_search',{'query':this.state.needle,'offset':offset,},{silent:true,});this.state.isFetchingLibrary=false;const media=(response.media||[]).slice(0,this.NUMBER_OF_MEDIA_TO_DISPLAY);media.forEach(record=>record.mediaType='libraryMedia');return{media,results:response.results};}catch{console.error(`Couldn't reach API endpoint.`);this.state.isFetchingLibrary=false;return{media:[],results:null};}} 8565async loadMore(...args){await super.loadMore(...args);if(!this.props.useMediaLibrary||this.state.searchService!=='media-library'){return;} 8566return this.keepLastLibraryMedia.add(this.fetchLibraryMedia(this.state.libraryMedia.length)).then(({media})=>{this.state.libraryMedia.push(...media);});} 8567async search(...args){await super.search(...args);if(!this.props.useMediaLibrary){return;} 8568if(!this.state.needle){this.state.searchService='all';} 8569this.state.libraryMedia=[];this.state.libraryResults=0;return this.keepLastLibraryMedia.add(this.fetchLibraryMedia(0)).then(({media,results})=>{this.state.libraryMedia=media;this.state.libraryResults=results;});} 8570async onClickAttachment(attachment){this.selectAttachment(attachment);if(!this.props.multiSelect){await this.props.save();}} 8571async onClickMedia(media){this.props.selectMedia({...media,mediaType:'libraryMedia'});if(!this.props.multiSelect){await this.props.save();}} 8572static async createElements(selectedMedia,{orm,rpc}){const toSave=Object.fromEntries(selectedMedia.filter(media=>media.mediaType==='libraryMedia').map(media=>[media.id,{query:media.query||'',is_dynamic_svg:!!media.isDynamicSVG,dynamic_colors:media.dynamicColors,}
8572]));let savedMedia=[];if(Object.keys(toSave).length!==0){savedMedia=await rpc('/web_editor/save_library_media',{media:toSave});} 8573const selected=selectedMedia.filter(media=>media.mediaType==='attachment').concat(savedMedia).map(attachment=>{if(attachment.image_src&&attachment.image_src.startsWith('/web_editor/shape/')){const colorCustomizedURL=new URL(attachment.image_src,window.location.origin);colorCustomizedURL.searchParams.forEach((value,key)=>{const match=key.match(/^c([1-5])$/);if(match){colorCustomizedURL.searchParams.set(key,getCSSVariableValue(`o-color-${match[1]}`));}});attachment.image_src=colorCustomizedURL.pathname+colorCustomizedURL.search;} 8574return attachment;});return Promise.all(selected.map(async(attachment)=>{const imageEl=document.createElement('img');let src=attachment.image_src;if(!attachment.public&&!attachment.url){let accessToken=attachment.access_token;if(!accessToken){[accessToken]=await orm.call('ir.attachment','generate_access_token',[attachment.id],);} 8575src+=`?access_token=${encodeURIComponent(accessToken)}`;} 8576imageEl.src=src;imageEl.alt=attachment.description||'';return imageEl;}));} 8577async onImageLoaded(imgEl,attachment){this.debouncedScroll();if(attachment.mediaType==='libraryMedia'&&!imgEl.src.startsWith('blob')){await this.onLibraryImageLoaded(imgEl,attachment);}} 8578async onLibraryImageLoaded(imgEl,media){const mediaUrl=imgEl.src;try{const response=await fetch(mediaUrl);const contentType=response.headers.get("content-type");if(contentType&&contentType.startsWith("image/svg+xml")){let svg=await response.text();const dynamicColors={};const combinedColorsRegex=new RegExp(Object.values(DEFAULT_PALETTE).join('|'),'gi');svg=svg.replace(combinedColorsRegex,match=>{const colorId=Object.keys(DEFAULT_PALETTE).find(key=>DEFAULT_PALETTE[key]===match.toUpperCase());const colorKey='c'+colorId 8579dynamicColors[colorKey]=getCSSVariableValue('o-color-'+colorId);return dynamicColors[colorKey];});const fileName=mediaUrl.split('/').pop();const file=new File([svg],fileName,{type:"image/svg+xml",});imgEl.src=URL.createObjectURL(file);if(Object.keys(dynamicColors).length){media.isDynamicSVG=true;media.dynamicColors=dynamicColors;}}}catch(_e){console.error('CORS is misconfigured on the API server, image will be treated as non-dynamic.');}}} 8580ImageSelector.mediaSpecificClasses=['img','img-fluid','o_we_custom_image'];ImageSelector.mediaSpecificStyles=[];ImageSelector.mediaExtraClasses=['rounded-circle','rounded','img-thumbnail','shadow','w-25','w-50','w-75','w-100',];ImageSelector.tagNames=['IMG'];ImageSelector.attachmentsListTemplate='web_editor.ImagesListTemplate';ImageSelector.components={...FileSelector.components,AutoResizeImage,};return __exports;});; 8581 8582/* /web_editor/static/src/components/media_dialog/media_dialog.js */ 8583odoo.define('@web_editor/components/media_dialog/media_dialog',async function(require){'use strict';let __exports={};const{_lt}=require("@web/core/l10n/translation");const{useService}=require('@web/core/utils/hooks');const{Mutex}=require("@web/core/utils/concurrency");const{useWowlService}=require('@web/legacy/utils');const{Dialog}=require('@web/core/dialog/dialog');const{Notebook}=require('@web/core/notebook/notebook');const{ImageSelector}=require("@web_editor/components/media_dialog/image_selector");const{DocumentSelector}=require("@web_editor/components/media_dialog/document_selector");const{IconSelector}=require("@web_editor/components/media_dialog/icon_selector");const{VideoSelector}=require("@web_editor/components/media_dialog/video_selector");const{Component,useState,onRendered,xml}=require("@odoo/owl");const TABS=__exports.TABS={IMAGES:{id:'IMAGES',title:_lt("Images"),Component:ImageSelector,},DOCUMENTS:{id:'DOCUMENTS',title:_lt("Documents"),Component:DocumentSelector,},ICONS:{id:'ICONS',title:_lt("Icons"),Component:IconSelector,},VIDEOS:{id:'VIDEOS',title:_lt("Videos"),Component:VideoSelector,},};const MediaDialog=__exports.MediaDialog=class MediaDialog extends Component{setup(){this.size='xl';this.contentClass='o_select_media_dialog';this.title=this.env._t("Select a media");this.rpc=useService('rpc');this.orm=useService('orm');this.notificationService=useService('notification');this.mutex=new Mutex();this.tabs=[];this.selectedMedia=useState({});this.initialIconClasses=[];this.addTabs();this.errorMessages={};this.state=useState({activeTab:this.initialActiveTab,});} 8584get initialActiveTab(){if(this.props.activeTab){return this.props.activeTab;} 8585if(this.props.media){const correspondingTab=Object.keys(TABS).find(id=>TABS[id].Component.tagNames.includes(this.props.media.tagName));if(correspondingTab){return correspondingTab;}} 8586return this.tabs[0].id;} 8587addTab(tab,additionalProps={}){this.selectedMedia[tab.id]=[];this.tabs.push({...tab,props:{...tab.props,...additionalProps,id:tab.id,resModel:this.props.resModel,resId:this.props.resId,media:this.props.media,multiImages:this.props.multiImages,selectedMedia:this.selectedMedia,selectMedia:(...args)=>this.selectMedia(...args,tab.id,additionalProps.multiSelect),save:this.save.bind(this),onAttachmentChange:this.props.onAttachmentChange,errorMessages:(errorMessage)=>this.errorMessages[tab.id]=errorMessage,},});} 8588addTabs(){const onlyImages=this.props.onlyImages||this.props.multiImages||(this.props.media&&this.props.media.parentElement&&(this.props.media.parentElement.dataset.oeField==='image'||this.props.media.parentElement.dataset.oeType==='image'));const noDocuments=onlyImages||this.props.noDocuments;const noIcons=onlyImages||this.props.noIcons;const noVideos=onlyImages||this.props.noVideos;if(!this.props.noImages){this.addTab(TABS.IMAGES,{useMediaLibrary:this.props.useMediaLibrary,multiSelect:this.props.multiImages,});} 8589if(!noDocuments){this.addTab(TABS.DOCUMENTS);} 8590if(!noIcons){const fonts=TABS.ICONS.Component.initFonts();this.addTab(TABS.ICONS,{fonts,});if(this.props.media&&TABS.ICONS.Component.tagNames.includes(this.props.media.tagName)){const classes=this.props.media.className.split(/\s+/);const mediaFont=fonts.find(font=>classes.includes(font.base));if(mediaFont){const selectedIcon=mediaFont.icons.find(icon=>icon.names.some(name=>classes.includes(name)));if(selectedIcon){this.initialIconClasses.push(...selectedIcon.names);this.selectMedia(selectedIcon,TABS.ICONS.id);}}}} 8591if(!noVideos){this.addTab(TABS.VIDEOS,{vimeoPreviewIds:this.props.vimeoPreviewIds,isForBgVideo:this.props.isForBgVideo,});}} 8592selectMedia(media,tabId,multiSelect){if(multiSelect){const isMediaSelected=this.selectedMedia[tabId].map(({id})=>id).includes(media.id);if(!isMediaSelected){this.selectedMedia[tabId].push(media);}else{this.selectedMedia[tabId]=this.selectedMedia[tabId].filter(m=>m.id!==media.id);}}else{this.selectedMedia[tabId]=[media];}} 8593async save(){if(this.errorMessages[this.state.activeTab]){this.notificationService.add(this.errorMessages[this.state.activeTab],{type:'danger',});return;} 8594const selectedMedia=this.selectedMedia[this.state.activeTab];const saveSelectedMedia=selectedMedia.length&&(this.state.activeTab!==TABS.ICONS.id||selectedMedia[0].initialIconChanged||!this.props.media);if(saveSelectedMedia){const elements=await this.mutex.exec(async()=>await TABS[this.state.activeTab].Component.createElements(selectedMedia,{rpc:this.rpc,orm:this.orm}));
8594elements.forEach(element=>{if(this.props.media){element.classList.add(...this.props.media.classList);const style=this.props.media.getAttribute('style');if(style){element.setAttribute('style',style);} 8595if(this.state.activeTab===TABS.IMAGES.id){if(this.props.media.dataset.shape){element.dataset.shape=this.props.media.dataset.shape;} 8596if(this.props.media.dataset.shapeColors){element.dataset.shapeColors=this.props.media.dataset.shapeColors;}}else if([TABS.VIDEOS.id,TABS.DOCUMENTS.id].includes(this.state.activeTab)){const parentEl=this.props.media.parentElement;if(parentEl&&parentEl.tagName==="A"&&parentEl.children.length===1&&this.props.media.tagName==="IMG"){parentEl.replaceWith(parentEl.firstElementChild);}}} 8597for(const otherTab of Object.keys(TABS).filter(key=>key!==this.state.activeTab)){for(const property of TABS[otherTab].Component.mediaSpecificStyles){element.style.removeProperty(property);} 8598element.classList.remove(...TABS[otherTab].Component.mediaSpecificClasses);const extraClassesToRemove=[];for(const name of TABS[otherTab].Component.mediaExtraClasses){if(typeof(name)==='string'){extraClassesToRemove.push(name);}else{for(const className of element.classList){if(className.match(name)){extraClassesToRemove.push(className);}}}} 8599element.classList.remove(...extraClassesToRemove.filter(candidateName=>{for(const name of TABS[this.state.activeTab].Component.mediaExtraClasses){if(typeof(name)==='string'){if(candidateName===name){return false;}}else{for(const className of element.classList){if(className.match(candidateName)){return false;}}}} 8600return true;}));} 8601element.classList.remove(...this.initialIconClasses);element.classList.remove('o_modified_image_to_save');element.classList.remove('oe_edited_link');element.classList.add(...TABS[this.state.activeTab].Component.mediaSpecificClasses);});if(this.props.multiImages){await this.props.save(elements);}else{await this.props.save(elements[0]);}} 8602this.props.close();} 8603onTabChange(tab){this.state.activeTab=tab;}} 8604MediaDialog.template='web_editor.MediaDialog';MediaDialog.defaultProps={useMediaLibrary:true,};MediaDialog.components={...Object.keys(TABS).map(key=>TABS[key].Component),Dialog,Notebook,};const MediaDialogWrapper=__exports.MediaDialogWrapper=class MediaDialogWrapper extends Component{setup(){this.dialogs=useWowlService('dialog');onRendered(()=>{this.dialogs.add(MediaDialog,this.props);});}} 8605MediaDialogWrapper.template=xml``;return __exports;});; 8606 8607/* /web_editor/static/src/components/media_dialog/search_media.js */ 8608odoo.define('@web_editor/components/media_dialog/search_media',async function(require){'use strict';let __exports={};const{useDebounced}=require('@web/core/utils/timing');const{useAutofocus}=require('@web/core/utils/hooks');const{Component,xml,useEffect,useState}=require("@odoo/owl");const SearchMedia=__exports.SearchMedia=class SearchMedia extends Component{setup(){useAutofocus();this.debouncedSearch=useDebounced(this.props.search,1000);this.state=useState({input:this.props.needle||'',});useEffect((input)=>{if(this.hasRendered){this.debouncedSearch(input);}else{this.hasRendered=true;}},()=>[this.state.input]);}} 8609SearchMedia.template=xml` 8610<div class="position-relative mw-lg-25 flex-grow-1 me-auto"> 8611 <input type="text" class="o_we_search o_input form-control" t-att-placeholder="props.searchPlaceholder.trim()" t-model="state.input" t-ref="autofocus"/> 8612 <i class="oi oi-search input-group-text position-absolute end-0 top-50 me-n3 px-2 py-1 translate-middle bg-transparent border-0" title="Search" role="img" aria-label="Search"/> 8613</div>`;return __exports;});; 8614 8615/* /web_editor/static/src/components/media_dialog/video_selector.js */ 8616odoo.define('@web_editor/components/media_dialog/video_selector',async function(require){'use strict';let __exports={};const{useService}=require('@web/core/utils/hooks');const{throttle}=require('@web/core/utils/timing');const{qweb}=require('web.core');const{Component,useState,useRef,onMounted,onWillStart}=require("@odoo/owl");class VideoOption extends Component{} 8617VideoOption.template='web_editor.VideoOption';const VideoSelector=__exports.VideoSelector=class VideoSelector extends Component{setup(){this.rpc=useService('rpc');this.http=useService('http');this.PLATFORMS={youtube:'youtube',dailymotion:'dailymotion',vimeo:'vimeo',youku:'youku',};this.OPTIONS={autoplay:{label:this.env._t("Autoplay"),description:this.env._t("Videos are muted when autoplay is enabled"),platforms:[this.PLATFORMS.youtube,this.PLATFORMS.dailymotion,this.PLATFORMS.vimeo],urlParameter:'autoplay=1',}
8617,loop:{label:this.env._t("Loop"),platforms:[this.PLATFORMS.youtube,this.PLATFORMS.vimeo],urlParameter:'loop=1',},hide_controls:{label:this.env._t("Hide player controls"),platforms:[this.PLATFORMS.youtube,this.PLATFORMS.dailymotion,this.PLATFORMS.vimeo],urlParameter:'controls=0',},hide_fullscreen:{label:this.env._t("Hide fullscreen button"),platforms:[this.PLATFORMS.youtube],urlParameter:'fs=0',isHidden:()=>this.state.options.filter(option=>option.id==='hide_controls')[0].value,},hide_dm_logo:{label:this.env._t("Hide Dailymotion logo"),platforms:[this.PLATFORMS.dailymotion],urlParameter:'ui-logo=0',},hide_dm_share:{label:this.env._t("Hide sharing button"),platforms:[this.PLATFORMS.dailymotion],urlParameter:'sharing-enable=0',},};this.state=useState({options:[],src:'',urlInput:'',platform:null,vimeoPreviews:[],errorMessage:'',});this.urlInputRef=useRef('url-input');onWillStart(async()=>{if(this.props.media){const src=this.props.media.dataset.oeExpression||this.props.media.dataset.src||(this.props.media.tagName==='IFRAME'&&this.props.media.getAttribute('src'))||'';if(src){this.state.urlInput=src;await this.updateVideo();this.state.options=this.state.options.map((option)=>{const{urlParameter}=this.OPTIONS[option.id];return{...option,value:src.indexOf(urlParameter)>=0};});}}});onMounted(async()=>{await Promise.all(this.props.vimeoPreviewIds.map(async(videoId)=>{try{const{thumbnail_url:thumbnailSrc}=await this.http.get(`https://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/${encodeURIComponent(videoId)}`);this.state.vimeoPreviews.push({id:videoId,thumbnailSrc,src:`https://player.vimeo.com/video/${encodeURIComponent(videoId)}`});}catch(err){console.warn(`Could not get video #${videoId} from vimeo: ${err}`);}}));});this.onChangeUrl=throttle((ev)=>this.updateVideo(ev.target.value),500);} 8618get shownOptions(){if(this.props.isForBgVideo){return[];} 8619return this.state.options.filter(option=>!this.OPTIONS[option.id].isHidden||!this.OPTIONS[option.id].isHidden());} 8620async onChangeOption(optionId){this.state.options=this.state.options.map(option=>{if(option.id===optionId){return{...option,value:!option.value};} 8621return option;});await this.updateVideo();} 8622async onClickSuggestion(src){this.state.urlInput=src;await this.updateVideo();} 8623async updateVideo(){if(!this.state.urlInput){this.state.src='';this.state.urlInput='';this.state.options=[];this.state.platform=null;this.state.errorMessage='';return;} 8624const embedMatch=this.state.urlInput.match(/(src|href)=["']?([^"']+)?/);if(embedMatch&&embedMatch[2].length>0&&embedMatch[2].indexOf('instagram')){embedMatch[1]=embedMatch[2];} 8625const url=embedMatch?embedMatch[1]:this.state.urlInput;const options={};if(this.props.isForBgVideo){Object.keys(this.OPTIONS).forEach(key=>{options[key]=true;});}else{for(const option of this.shownOptions){options[option.id]=option.value;}} 8626const{embed_url:src,platform}=await this._getVideoURLData(url,options);if(!src){this.state.errorMessage=this.env._t("The provided url is not valid");}else if(!platform){this.state.errorMessage=this.env._t("The provided url does not reference any supported video");}else{this.state.errorMessage='';} 8627this.props.errorMessages(this.state.errorMessage);const newOptions=[];if(platform&&platform!==this.state.platform){Object.keys(this.OPTIONS).forEach(key=>{if(this.OPTIONS[key].platforms.includes(platform)){const{label,description}=this.OPTIONS[key];newOptions.push({id:key,label,description});}});} 8628this.state.src=src;this.props.selectMedia({id:src,src});if(platform!==this.state.platform){this.state.platform=platform;this.state.options=newOptions;}} 8629async _getVideoURLData(url,options){return await this.rpc('/web_editor/video_url/data',{video_url:url,...options,});} 8630static createElements(selectedMedia){return selectedMedia.map(video=>{const template=document.createElement('template');template.innerHTML=qweb.render('web_editor.videoWrapper',{src:video.src});return template.content.firstChild;});}} 8631VideoSelector.mediaSpecificClasses=['media_iframe_video'];VideoSelector.mediaSpecificStyles=[];VideoSelector.mediaExtraClasses=[];VideoSelector.tagNames=['IFRAME','DIV'];VideoSelector.template='web_editor.VideoSelector';VideoSelector.components={VideoOption,};VideoSelector.defaultProps={vimeoPreviewIds:[],isForBgVideo:false,};return __exports;});; 8632 8633/* /web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js */ 8634odoo.define('@web_editor/components/upload_progress_toast/upload_progress_toast',async function(require){'use strict';let __exports={};const{useService}=require('@web/core/utils/hooks');const{Component,useState}=require("@odoo/owl");const ProgressBar=__exports.ProgressBar=class ProgressBar extends Component{get progress(){return Math.round(this.props.progress);}} 8635ProgressBar.template='web_editor.ProgressBar';const UploadProgressToast=__exports.UploadProgressToast=class UploadProgressToast extends Component{setup(){this.uploadService=useService('upload');this.state=useState(this.uploadService.progressToast);}} 8636UploadProgressToast.template='web_editor.UploadProgressToast';UploadProgressToast.components={ProgressBar};return __exports;});; 8637 8638/* /web_editor/static/src/components/upload_progress_toast/upload_service.js */ 8639odoo.define('@web_editor/components/upload_progress_toast/upload_service',async function(require){'use strict';let __exports={};const{registry}=require('@web/core/registry');const{UploadProgressToast}=require("@web_editor/components/upload_progress_toast/upload_progress_toast");const{getDataURLFromFile}=require('web.utils');const{_t}=require("@web/core/l10n/translation");const{checkFileSize}=require("@web/core/utils/files");const{humanNumber}=require("@web/core/utils/numbers");const{sprintf}=require("@web/core/utils/strings");const{reactive}=require("@odoo/owl");const AUTOCLOSE_DELAY=__exports.AUTOCLOSE_DELAY=3000;const uploadService=__exports.uploadService={dependencies:['rpc'],start(env,{rpc}){let fileId=0;const progressToast=reactive({files:{},isVisible:false,});registry.category('main_components').add('UploadProgressToast',{
8639Component:UploadProgressToast,props:{close:()=>progressToast.isVisible=false,}});const addFile=(file)=>{progressToast.files[file.id]=file;progressToast.isVisible=true;return progressToast.files[file.id];};const deleteFile=(fileId)=>{delete progressToast.files[fileId];if(!Object.keys(progressToast.files).length){progressToast.isVisible=false;}};return{get progressToast(){return progressToast;},get fileId(){return fileId;},addFile,deleteFile,incrementId(){fileId++;},uploadUrl:async(url,{resModel,resId},onUploaded)=>{const attachment=await rpc('/web_editor/attachment/add_url',{url,'res_model':resModel,'res_id':resId,});await onUploaded(attachment);},uploadFiles:async(files,{resModel,resId,isImage},onUploaded)=>{const sortedFiles=Array.from(files).sort((a,b)=>a.size-b.size);for(const file of sortedFiles){let fileSize=file.size;if(!checkFileSize(fileSize,env.services.notification)){return null;} 8640if(!fileSize){fileSize=null;}else{fileSize=humanNumber(fileSize)+"B";} 8641const id=++fileId;file.progressToastId=id;addFile({id,name:file.name,size:fileSize,progress:0,hasError:false,uploaded:false,errorMessage:'',});} 8642for(const sortedFile of sortedFiles){const file=progressToast.files[sortedFile.progressToastId];let dataURL;try{dataURL=await getDataURLFromFile(sortedFile);}catch{deleteFile(file.id);env.services.notification.add(sprintf(_t('Could not load the file "%s".'),sortedFile.name),{type:'danger'});continue} 8643try{const xhr=new XMLHttpRequest();xhr.upload.addEventListener('progress',ev=>{const rpcComplete=ev.loaded/ev.total*100;file.progress=rpcComplete;});xhr.upload.addEventListener('load',function(){file.progress=100;});const attachment=await rpc('/web_editor/attachment/add_data',{'name':file.name,'data':dataURL.split(',')[1],'res_id':resId,'res_model':resModel,'is_image':!!isImage,'width':0,'quality':0,},{xhr});if(attachment.error){file.hasError=true;file.errorMessage=attachment.error;}else{file.uploaded=true;await onUploaded(attachment);} 8644setTimeout(()=>deleteFile(file.id),AUTOCLOSE_DELAY);}catch(error){file.hasError=true;setTimeout(()=>deleteFile(file.id),AUTOCLOSE_DELAY);throw error;}}}};},};registry.category('services').add('upload',uploadService);return __exports;});; 8645 8646/* /website/static/src/components/media_dialog/image_selector.js */ 8647odoo.define('@website/components/media_dialog/image_selector',async function(require){'use strict';let __exports={};const{patch}=require('@web/core/utils/patch');const{ImageSelector}=require('@web_editor/components/media_dialog/image_selector');patch(ImageSelector.prototype,'media_dialog_website',{get attachmentsDomain(){const domain=this._super();domain.push('|',['url','=',false],'!',['url','=like','/web/image/website.%']);domain.push(['key','=',false]);return domain;}});return __exports;});; 8648 8649/* /web_unsplash/static/src/components/media_dialog/image_selector.js */ 8650odoo.define('@web_unsplash/components/media_dialog/image_selector',async function(require){'use strict';let __exports={};const{patch}=require('web.utils');const{KeepLast}=require("@web/core/utils/concurrency");const{MediaDialog,TABS}=require('@web_editor/components/media_dialog/media_dialog');const{ImageSelector}=require('@web_editor/components/media_dialog/image_selector');const{useService}=require('@web/core/utils/hooks');const{uploadService,AUTOCLOSE_DELAY}=require('@web_editor/components/upload_progress_toast/upload_service');const{useState,Component}=require("@odoo/owl");class UnsplashCredentials extends Component{setup(){this.state=useState({key:'',appId:'',hasKeyError:this.props.hasCredentialsError,hasAppIdError:this.props.hasCredentialsError,});} 8651submitCredentials(){if(this.state.key===''){this.state.hasKeyError=true;}else if(this.state.appId===''){this.state.hasAppIdError=true;}else{this.props.submitCredentials(this.state.key,this.state.appId);}}} 8652UnsplashCredentials.template='web_unsplash.UnsplashCredentials';const UnsplashError=__exports.UnsplashError=class UnsplashError extends Component{} 8653UnsplashError.template='web_unsplash.UnsplashError';UnsplashError.components={UnsplashCredentials,};patch(ImageSelector.prototype,'image_selector_unsplash',{setup(){this._super();this.unsplash=useService('unsplash');this.keepLastUnsplash=new KeepLast();this.state.unsplashRecords=[];this.state.isFetchingUnsplash=false;this.state.isMaxed=false;this.state.unsplashError=null;this.state.useUnsplash=true;this.NUMBER_OF_RECORDS_TO_DISPLAY=30;this.errorMessages={'key_not_found':{title:this.env._t("Setup Unsplash to access royalty free photos."),subtitle:"",},401:{title:this.env._t("Unauthorized Key"),subtitle:this.env._t("Please check your Unsplash access key and application ID."),},403:{title:this.env._t("Search is temporarily unavailable"),subtitle:this.env._t("The max number of searches is exceeded. Please retry in an hour or extend to a better account."),},};},get canLoadMore(){if(this.state.searchService==='all'){return this._super()||this.state.needle&&!this.state.isMaxed&&!this.state.unsplashError;}else if(this.state.searchService==='unsplash'){return this.state.needle&&!this.state.isMaxed&&!this.state.unsplashError;} 8654return this._super();},get hasContent(){if(this.state.searchService==='all'){return this._super()||!!this.state.unsplashRecords.length;}else if(this.state.searchService==='unsplash'){return!!this.state.unsplashRecords.length;} 8655return this._super();},get errorTitle(){if(this.errorMessages[this.state.unsplashError]){return this.errorMessages[this.state.unsplashError].title;} 8656return this.env._t("Something went wrong");},get errorSubtitle(){if(this.errorMessages[this.state.unsplashError]){return this.errorMessages[this.state.unsplashError].subtitle;} 8657return this.env._t("Please check your internet connection or contact administrator.");},get selectedRecordIds(){return this.props.selectedMedia[this.props.id].filter(media=>media.mediaType==='unsplashRecord').map(({id})=>id);},get isFetching(){return this._super()||this.state.isFetchingUnsplash;},set canLoadMore(_){},set hasContent(_){},set isFetching(_){},set selectedMediaIds(_){},set attachmentsDomain(_){},set errorTitle(_){},set errorSubtitle(_){},set selectedRecordIds(_){},async fetchUnsplashRecords(offset){if(!this.state.needle){return{records:[],isMaxed:false};} 8658this.state.isFetchingUnsplash=true;try{const{isMaxed,images}=await this.unsplash.getImages(this.state.needle,offset,this.NUMBER_OF_RECORDS_TO_DISPLAY,this.props.orientation);this.state.isFetchingUnsplash=false;this.state.unsplashError=false;const existingIds=this.state.unsplashRecords.map(existing=>existing.id);const newImages=images.filter(record=>!existingIds.includes(record.id));const records=newImages.map(record=>{const url=new URL(record.urls.regular);url.searchParams.set('h',2*this.MIN_ROW_HEIGHT);url.searchParams.delete('w');return Object.assign({},record,{url:url.toString(),mediaType:'unsplashRecord',});});return{isMaxed,records};}catch(e){this.state.isFetchingUnsplash=false;if(e==='no_access'){this.state.useUnsplash=false;}else{this.state.unsplashError=e;} 8659return{records:[],isMaxed:true};}},async loadMore(...args){await this._super(...args);return this.keepLastUnsplash.add(this.fetchUnsplashRecords(this.state.unsplashRecords.length)).then(({records,isMaxed})=>{this.state.unsplashRecords.push(...records);this.state.isMaxed=isMaxed;});},async search(...args){await this._super(...args);await this.searchUnsplash();},async searchUnsplash(){if(!this.state.needle){this.state.unsplashError=false;this.state.unsplashRecords=[];this.state.isMaxed=false;} 8660return this.keepLastUnsplash.add(this.fetchUnsplashRecords(0)).then(({records,isMaxed})=>{this.state.unsplashRecords=records;this.state.isMaxed=isMaxed;});},async onClickRecord(media){this.props.selectMedia({...media,mediaType:'unsplashRecord',query:this.state.needle});if(!this.props.multiSelect){await this.props.save();}},async submitCredentials(key,appId){this.state.unsplashError=null;await this.rpc('/web_unsplash/save_unsplash',{key,appId});await this.searchUnsplash();},});ImageSelector.components={...ImageSelector.components,UnsplashError,};patch(MediaDialog.prototype,'media_dialog_unsplash',{setup(){this._super();this.uploadService=useService('upload');},async save(){const _super=this._super.bind(this);const selectedImages=this.selectedMedia[TABS.IMAGES.id];if(selectedImages){const unsplashRecords=selectedImages.filter(media=>media.mediaType==='unsplashRecord');if(unsplashRecords.length){await this.uploadService.uploadUnsplashRecords(unsplashRecords,{resModel:this.props.resModel,resId:this.props.resId},(attachments)=>{this.selectedMedia[TABS.IMAGES.id]=this.selectedMedia[TABS.IMAGES.id].filter(media=>media.mediaType!=='unsplashRecord');this.selectedMedia[TABS.IMAGES.id]=this.selectedMedia[TABS.IMAGES.id].concat(attachments.map(attachment=>({...attachment,mediaType:'attachment'})));});}} 8661return _super(...arguments);},});patch(uploadService,'upload_service_unsplash',{start(env,{rpc}){const service=this._super(...arguments);return{...service,async uploadUnsplashRecords(records,{resModel,resId},onUploaded){service.incrementId();
8661const file=service.addFile({id:service.fileId,name:records.length>1?_.str.sprintf(env._t("Uploading %s '%s' images."),records.length,records[0].query):_.str.sprintf(env._t("Uploading '%s' image."),records[0].query),size:null,progress:0,});try{const urls={};for(const record of records){const _1920Url=new URL(record.urls.regular);_1920Url.searchParams.set('w','1920');urls[record.id]={url:_1920Url.href,download_url:record.links.download_location,description:record.alt_description,};} 8662const xhr=new XMLHttpRequest();xhr.upload.addEventListener('progress',ev=>{const rpcComplete=ev.loaded/ev.total*100;file.progress=rpcComplete;});xhr.upload.addEventListener('load',function(){file.progress=100;});const attachments=await rpc('/web_unsplash/attachment/add',{'res_id':resId,'res_model':resModel,'unsplashurls':urls,'query':records[0].query,},{xhr});if(attachments.error){file.hasError=true;file.errorMessage=attachments.error;}else{file.uploaded=true;await onUploaded(attachments);} 8663setTimeout(()=>service.deleteFile(file.id),AUTOCLOSE_DELAY);}catch(error){file.hasError=true;setTimeout(()=>service.deleteFile(file.id),AUTOCLOSE_DELAY);throw error;}}};}});return __exports;});; 8664 8665/* /web_unsplash/static/src/services/unsplash_service.js */ 8666odoo.define('@web_unsplash/services/unsplash_service',async function(require){'use strict';let __exports={};const{registry}=require('@web/core/registry');const unsplashService=__exports.unsplashService={dependencies:['rpc'],async start(env,{rpc}){const _cache={};return{async getImages(query,offset=0,pageSize=30,orientation){const from=offset;const to=offset+pageSize;let cachedData=orientation?_cache[query+orientation]:_cache[query];if(cachedData&&(cachedData.images.length>=to||(cachedData.totalImages!==0&&cachedData.totalImages<to))){return{images:cachedData.images.slice(from,to),isMaxed:to>cachedData.totalImages};} 8667cachedData=await this._fetchImages(query,orientation);return{images:cachedData.images.slice(from,to),isMaxed:to>cachedData.totalImages};},async _fetchImages(query,orientation){const key=orientation?query+orientation:query;if(!_cache[key]){_cache[key]={images:[],maxPages:0,totalImages:0,pageCached:0};} 8668const cachedData=_cache[key];const payload={query:query,page:cachedData.pageCached+1,per_page:30,};if(orientation){payload.orientation=orientation;} 8669const result=await rpc('/web_unsplash/fetch_images',payload);if(result.error){return Promise.reject(result.error);} 8670cachedData.pageCached++;cachedData.images.push(...result.results);cachedData.maxPages=result.total_pages;cachedData.totalImages=result.total;return cachedData;},};},};registry.category('services').add('unsplash',unsplashService);return __exports;});; 8671 8672/* /web_editor/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js */ 8673(function(){function createShiftArr(step){var space=' ';if(isNaN(parseInt(step))){space=step;}else{switch(step){case 1:space=' ';break;case 2:space=' ';break;case 3:space=' ';break;case 4:space=' ';break;case 5:space=' ';break;case 6:space=' ';break;case 7:space=' ';break;case 8:space=' ';break;case 9:space=' ';break;case 10:space=' ';break;case 11:space=' ';break;case 12:space=' ';break;}} 8674var shift=['\n'];for(ix=0;ix<100;ix++){shift.push(shift[ix]+space);} 8675return shift;} 8676function vkbeautify(){this.step=' ';this.shift=createShiftArr(this.step);};vkbeautify.prototype.xml=function(text,step){var ar=text.replace(/>\s{0,}</g,"><").replace(/</g,"~::~<").replace(/\s*xmlns\:/g,"~::~xmlns:").replace(/\s*xmlns\=/g,"~::~xmlns=").split('~::~'),len=ar.length,inComment=false,deep=0,str='',ix=0,shift=step?createShiftArr(step):this.shift;for(ix=0;ix<len;ix++){if(ar[ix].search(/<!/)>-1){str+=shift[deep]+ar[ix];inComment=true;if(ar[ix].search(/-->/)>-1||ar[ix].search(/\]>/)>-1||ar[ix].search(/!DOCTYPE/)>-1){inComment=false;}}else 8677if(ar[ix].search(/-->/)>-1||ar[ix].search(/\]>/)>-1){str+=ar[ix];inComment=false;}else 8678if(/^<\w/.exec(ar[ix-1])&&/^<\/\w/.exec(ar[ix])&&/^<[\w:\-\.\,]+/.exec(ar[ix-1])==/^<\/[\w:\-\.\,]+/.exec(ar[ix])[0].replace('/','')){str+=ar[ix];if(!inComment)deep--;}else 8679if(ar[ix].search(/<\w/)>-1&&ar[ix].search(/<\//)==-1&&ar[ix].search(/\/>/)==-1){str=!inComment?str+=shift[deep++]+ar[ix]:str+=ar[ix];}else 8680if(ar[ix].search(/<\w/)>-1&&ar[ix].search(/<\//)>-1){str=!inComment?str+=shift[deep]+ar[ix]:str+=ar[ix];}else 8681if(ar[ix].search(/<\//)>-1){str=!inComment?str+=shift[--deep]+ar[ix]:str+=ar[ix];}else 8682if(ar[ix].search(/\/>/)>-1){str=!inComment?str+=shift[deep]+ar[ix]:str+=ar[ix];}else 8683if(ar[ix].search(/<\?/)>-1){str+=shift[deep]+ar[ix];}else 8684if(ar[ix].search(/xmlns\:/)>-1||ar[ix].search(/xmlns\=/)>-1){str+=shift[deep]+ar[ix];} 8685else{str+=ar[ix];}} 8686return(str[0]=='\n')?str.slice(1):str;} 8687vkbeautify.prototype.json=function(text,step){var step=step?step:this.step;if(typeof JSON==='undefined')return text;if(typeof text==="string")return JSON.stringify(JSON.parse(text),null,step);if(typeof text==="object")return JSON.stringify(text,null,step);return text;} 8688vkbeautify.prototype.css=function(text,step){var ar=text.replace(/\s{1,}/g,' ').replace(/\{/g,"{~::~").replace(/\}/g,"~::~}~::~").replace(/\;/g,";~::~").replace(/\/\*/g,"~::~/*").replace(/\*\//g,"*/~::~").replace(/~::~\s{0,}~::~/g,"~::~").split('~::~'),len=ar.length,deep=0,str='',ix=0,shift=step?createShiftArr(step):this.shift;for(ix=0;ix<len;ix++){if(/\{/.exec(ar[ix])){str+=shift[deep++]+ar[ix];}else 8689if(/\}/.exec(ar[ix])){str+=shift[--deep]+ar[ix];}else 8690if(/\*\\/.exec(ar[ix])){str+=shift[deep]+ar[ix];} 8691else{str+=shift[deep]+ar[ix];}} 8692return str.replace(/^\n{1,}/,'');} 8693function isSubquery(str,parenthesisLevel){return parenthesisLevel-(str.replace(/\(/g,'').length-str.replace(/\)/g,'').length)} 8694function split_sql(str,tab){return str.replace(/\s{1,}/g," ").replace(/ AND /ig,"~::~"+tab+tab+"AND ").replace(/ BETWEEN /ig,"~::~"+tab+"BETWEEN ").replace(/ CASE /ig,"~::~"+tab+"CA
8694SE ").replace(/ ELSE /ig,"~::~"+tab+"ELSE ").replace(/ END /ig,"~::~"+tab+"END ").replace(/ FROM /ig,"~::~FROM ").replace(/ GROUP\s{1,}BY/ig,"~::~GROUP BY ").replace(/ HAVING /ig,"~::~HAVING ").replace(/ IN /ig," IN ").replace(/ JOIN /ig,"~::~JOIN ").replace(/ CROSS~::~{1,}JOIN /ig,"~::~CROSS JOIN ").replace(/ INNER~::~{1,}JOIN /ig,"~::~INNER JOIN ").replace(/ LEFT~::~{1,}JOIN /ig,"~::~LEFT JOIN ").replace(/ RIGHT~::~{1,}JOIN /ig,"~::~RIGHT JOIN ").replace(/ ON /ig,"~::~"+tab+"ON ").replace(/ OR /ig,"~::~"+tab+tab+"OR ").replace(/ ORDER\s{1,}BY/ig,"~::~ORDER BY ").replace(/ OVER /ig,"~::~"+tab+"OVER ").replace(/\(\s{0,}SELECT /ig,"~::~(SELECT ").replace(/\)\s{0,}SELECT /ig,")~::~SELECT ").replace(/ THEN /ig," THEN~::~"+tab+"").replace(/ UNION /ig,"~::~UNION~::~").replace(/ USING /ig,"~::~USING ").replace(/ WHEN /ig,"~::~"+tab+"WHEN ").replace(/ WHERE /ig,"~::~WHERE ").replace(/ WITH /ig,"~::~WITH ").replace(/ ALL /ig," ALL ").replace(/ AS /ig," AS ").replace(/ ASC /ig," ASC ").replace(/ DESC /ig," DESC ").replace(/ DISTINCT /ig," DISTINCT ").replace(/ EXISTS /ig," EXISTS ").replace(/ NOT /ig," NOT ").replace(/ NULL /ig," NULL ").replace(/ LIKE /ig," LIKE ").replace(/\s{0,}SELECT /ig,"SELECT ").replace(/\s{0,}UPDATE /ig,"UPDATE ").replace(/ SET /ig," SET ").replace(/~::~{1,}/g,"~::~").split('~::~');} 8695vkbeautify.prototype.sql=function(text,step){var ar_by_quote=text.replace(/\s{1,}/g," ").replace(/\'/ig,"~::~\'").split('~::~'),len=ar_by_quote.length,ar=[],deep=0,tab=this.step,inComment=true,inQuote=false,parenthesisLevel=0,str='',ix=0,shift=step?createShiftArr(step):this.shift;;for(ix=0;ix<len;ix++){if(ix%2){ar=ar.concat(ar_by_quote[ix]);}else{ar=ar.concat(split_sql(ar_by_quote[ix],tab));}} 8696len=ar.length;for(ix=0;ix<len;ix++){parenthesisLevel=isSubquery(ar[ix],parenthesisLevel);if(/\s{0,}\s{0,}SELECT\s{0,}/.exec(ar[ix])){ar[ix]=ar[ix].replace(/\,/g,",\n"+tab+tab+"")} 8697if(/\s{0,}\s{0,}SET\s{0,}/.exec(ar[ix])){ar[ix]=ar[ix].replace(/\,/g,",\n"+tab+tab+"")} 8698if(/\s{0,}\(\s{0,}SELECT\s{0,}/.exec(ar[ix])){deep++;str+=shift[deep]+ar[ix];}else 8699if(/\'/.exec(ar[ix])){if(parenthesisLevel<1&&deep){deep--;} 8700str+=ar[ix];} 8701else{str+=shift[deep]+ar[ix];if(parenthesisLevel<1&&deep){deep--;}} 8702var junk=0;} 8703str=str.replace(/^\n{1,}/,'').replace(/\n{1,}/g,"\n");return str;} 8704vkbeautify.prototype.xmlmin=function(text,preserveComments){var str=preserveComments?text:text.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g,"").replace(/[ \r\n\t]{1,}xmlns/g,' xmlns');return str.replace(/>\s{0,}</g,"><");} 8705vkbeautify.prototype.jsonmin=function(text){if(typeof JSON==='undefined')return text;return JSON.stringify(JSON.parse(text),null,0);} 8706vkbeautify.prototype.cssmin=function(text,preserveComments){var str=preserveComments?text:text.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g,"");return str.replace(/\s{1,}/g,' ').replace(/\{\s{1,}/g,"{").replace(/\}\s{1,}/g,"}").replace(/\;\s{1,}/g,";").replace(/\/\*\s{1,}/g,"/*").replace(/\*\/\s{1,}/g,"*/");} 8707vkbeautify.prototype.sqlmin=function(text){return text.replace(/\s{1,}/g," ").replace(/\s{1,}\(/,"(").replace(/\s{1,}\)/,")");} 8708window.vkbeautify=new vkbeautify();})();; 8709 8710/* /web_editor/static/src/js/common/ace.js */ 8711odoo.define('web_editor.ace',function(require){'use strict';var config=require('web.config');var concurrency=require('web.concurrency');var core=require('web.core');var dom=require('web.dom');var Dialog=require('web.Dialog');var Widget=require('web.Widget');var localStorage=require('web.local_storage');var _t=core._t;function _getCheckReturn(isValid,errorLine,errorMessage){return{isValid:isValid,error:isValid?null:{line:errorLine,message:errorMessage,},};} 8712function checkXML(xml){if(typeof window.DOMParser!='undefined'){var xmlDoc=(new window.DOMParser()).parseFromString(xml,'text/xml');var error=xmlDoc.getElementsByTagName('parsererror');if(error.length>0){const errorEl=error[0];const sourceTextEls=errorEl.querySelectorAll('sourcetext');let codeEls=null;if(sourceTextEls.length){codeEls=[...sourceTextEls].map(el=>{const codeEl=document.createElement('code');codeEl.textContent=el.textContent;const brEl=document.createElement('br');brEl.classList.add('o_we_source_text_origin');el.parentElement.insertBefore(brEl,el);return codeEl;});for(const el of sourceTextEls){el.remove();}} 8713for(const el of[...errorEl.querySelectorAll(':not(code):not(pre):not(br)')]){const pEl=document.createElement('p');for(const cEl of[...el.childNodes]){pEl.appendChild(cEl);} 8714el.parentElement.insertBefore(pEl,el);el.remove();} 8715errorEl.innerHTML=errorEl.innerHTML.replace(/\r?\n/g,'<br/>');errorEl.querySelectorAll('.o_we_source_text_origin').forEach((el,i)=>{el.after(codeEls[i]);});return _getCheckReturn(false,parseInt(error[0].innerHTML.match(/[Ll]ine[^\d]+(\d+)/)[1],10),errorEl.innerHTML);}}else if(typeof window.ActiveXObject!='undefined'&&new window.ActiveXObject('Microsoft.XMLDOM')){var xmlDocIE=new window.ActiveXObject('Microsoft.XMLDOM');xmlDocIE.async='false';xmlDocIE.loadXML(xml);if(xmlDocIE.parseError.line>0){return _getCheckReturn(false,xmlDocIE.parseError.line,xmlDocIE.parseError.reason);}} 8716return _getCheckReturn(true);} 8717function formatXML(xml){if(/<script(?: [^>]*)?>[^<][\s\S]*<\/script>/i.test(xml)){return xml;} 8718return window.vkbeautify.xml(xml,4);} 8719var checkSCSS=(function(){var mapping={'{':'}','}':'{','(':')',')':'(','[':']',']':'[',};var openings=['{','(','['];var closings=['}',')',']'];return function(scss){var stack=[];var line=1;for(var i=0;i<scss.length;i++){if(_.contains(openings,scss[i])){stack.push(scss[i]);}else if(_.contains(closings,scss[i])){if(stack.pop()!==mapping[scss[i]]){return _getCheckReturn(false,line,_t("Unexpected ")+scss[i]);}}else if(scss[i]==='\n'){line++;}} 8720if(stack.length>0){return _getCheckReturn(false,line,_t("Expected ")+mapping[stack.pop()]);} 8721return _getCheckReturn(true);};})();function formatSCSS(scss){return scss;} 8722var ViewEditor=Widget.extend({template:'web_editor.ace_view_editor',jsLibs:['/web/static/lib/ace/ace.js',['/web/static/lib/ace/javascript_highlight_rules.js','/web/static/lib/ace/mode-xml.js','/web/static/lib/ace/mode-qweb.js','/web/static/lib/ace/mode-scss.js','/web/static/lib/ace/mode-js.js','/web/static/lib/ace/theme-monokai.js']],events:{'click .o_ace_type_switcher_choice':'_onTypeChoice','change .o_res_list':'_onResChange','click .o_ace_filter':'_onFilterChange','click button[data-action=save]':'_onSaveClick','click button[data-action=reset]':'_onResetClick','click button[data-action=format]':'_onFormatClick','click button[data-action=close]':'_onCloseClick','click #ace-view-id > .alert-warning .btn-close':'_onCloseWarningClick'},init:function(parent,viewKey,options){this._super.apply(this,arguments);this.context=options.context;this.viewKey=viewKey;this.options=_.defaults({},options,{position:'right',doNotLoadViews:false,doNotLoadSCSS:false,doNotLoadJS:false,includeBundles:false,filesFilter:'custom',defaultBundlesRestriction:[],});this.resources={xml:{},scss:{},js:{}};this.editingSessions={xml:{},scss:{},js:{}};this.currentType='xml';this.views=this.resources.xml;this.scss=this.resources.scss;this.js=this.resources.js;},willStart:function(){return Promise.all([this._super.apply(this,arguments),this._loadResources()]);},start:function(){this.$viewEditor=this.$('#ace-view-editor');this.$typeSwitcherChoices=this.$('.o_ace_type_switcher_choice');this.$typeSwitcherBtn=this.$('.o_ace_type_switcher > .dropdown-toggle');this.$lists={xml:this.$('#ace-view-list'),scss:this.$('#ace-scss-list'),js:this.$('#ace-js-list'),};this.$includeBundlesArea=this.$('.oe_include_bundles');this.$includeAllSCSSArea=this.$('.o_include_all_scss');this.$viewID=this.$('#ace-view-id > span');this.$warningMessage=this.$('#ace-view-id > .alert-warning');this.$formatButton=this.$('button[data-action=format]');this.$resetButton=this.$('button[data-action=reset]');this.aceEditor=window.ace.edit(this.$viewEditor[0]);this.aceEditor.setTheme('ace/theme/monokai');this.$editor=this.$('.ace_editor');var refX=0;var resizing=false;var minWidth=400;var debounceStoreEditorWidth=_.debounce(storeEditorWidth,500);this._updateViewSelectDOM();var initResID;var initType;if(this.options.initialResID){initResID=this.options.initialResID;if(_.isString(initResID)&&initResID[0]==='/'){if(_.str.endsWith(initResID,'.scss')){initType='scss';}else{initType='js';}}else{initType='xml';}}else{if(!this.options.doNotLoadSCSS){initResID=this.sortedSCSS[0][1][0].url;initType='scss';} 8723if(!this.options.doNotLoadJS){initResID=this.sortedJS[0][1][0].url;initType='js';} 8724if(!this.options.doNotLoadViews){if(typeof this.viewKey==="number"){initResID=this.viewKey;}else{var view=_.findWhere(this.views,{xml_id:this.viewKey});if(!view){view=_.findWhere(this.views,{key:this.viewKey});} 8725initResID=view.id;} 8726initType='xml';}}
8727if(initResID){this._displayResource(initResID,initType);} 8728if(!this.sortedViews.length||!this.sortedSCSS.length){_.defer((function(){this._switchType(this.sortedViews.length?'xml':'scss');this.$typeSwitcherBtn.parent('.btn-group').addClass('d-none');}).bind(this));} 8729$(document).on('mouseup.ViewEditor',stopResizing.bind(this)).on('mousemove.ViewEditor',updateWidth.bind(this));if(this.options.position==='left'){this.$('.ace_scroller').after($('<div>').addClass('ace_resize_bar'));this.$('.ace_gutter').css({'cursor':'default'});this.$el.on('mousedown.ViewEditor','.ace_resize_bar',startResizing.bind(this));}else{this.$el.on('mousedown.ViewEditor','.ace_gutter',startResizing.bind(this));} 8730resizeEditor.call(this,readEditorWidth.call(this));return this._super.apply(this,arguments);function resizeEditor(target){var width=Math.min(document.body.clientWidth,Math.max(parseInt(target,10),minWidth));this.$editor.width(width);this.aceEditor.resize();this.$el.width(width);if(this.$errorLine){this.$errorLine.popover('update');}} 8731function storeEditorWidth(){localStorage.setItem('ace_editor_width',this.$el.width());} 8732function readEditorWidth(){var width=localStorage.getItem('ace_editor_width');return parseInt(width||720,10);} 8733function startResizing(e){refX=e.pageX;resizing=true;document.body.classList.add("o_ace_view_editor_resizing");} 8734function stopResizing(){if(resizing){resizing=false;document.body.classList.remove("o_ace_view_editor_resizing");if(this.errorSession){this.errorSession.setScrollTop(this.errorSession.getScrollTop()+1);}}} 8735function updateWidth(e){if(!resizing)return;var offset=e.pageX-refX;if(this.options.position==='left'){offset=-offset;} 8736var width=this.$el.width()-offset;refX=e.pageX;resizeEditor.call(this,width);debounceStoreEditorWidth.call(this);}},destroy:function(){this._super.apply(this,arguments);this.$el.off('.ViewEditor');$(document).off('.ViewEditor');},_buildEditingSession:function(resID,type){var self=this;type=type||this.currentType;var editingSession=new window.ace.EditSession(this.resources[type][resID].arch);editingSession.setUseWorker(false);let mode=(type||this.currentType);editingSession.setMode('ace/mode/'+(mode==='xml'?'qweb':mode));editingSession.setUndoManager(new window.ace.UndoManager());editingSession.on('change',function(){_.defer(function(){self._toggleDirtyInfo(resID);self._showErrorLine();});});return editingSession;},_displayResource:function(resID,type){if(type){this._switchType(type);} 8737if(!this.resources[this.currentType].hasOwnProperty(resID)){return;} 8738var editingSession=this.editingSessions[this.currentType][resID];if(!editingSession){editingSession=this.editingSessions[this.currentType][resID]=this._buildEditingSession(resID);} 8739this.aceEditor.setSession(editingSession);if(this.currentType==='xml'){this.$viewID.text(_.str.sprintf(_t("Template ID: %s"),this.views[resID].key));}else if(this.currentType==='scss'){this.$viewID.text(_.str.sprintf(_t("SCSS file: %s"),resID));}else{this.$viewID.text(_.str.sprintf(_t("JS file: %s"),resID));} 8740const isCustomized=this._isCustomResource(resID);this.$lists[this.currentType].select2('val',resID);this.$resetButton.toggleClass('d-none',this.currentType==='xml'||!isCustomized);this.$warningMessage.toggleClass('d-none',this.currentType!=='xml'&&(resID.indexOf('/user_custom_')>=0)||isCustomized);this.aceEditor.resize(true);},_formatResource:function(){var res=this.aceEditor.getValue();var check=(this.currentType==='xml'?checkXML:checkSCSS)(res);if(check.isValid){this.aceEditor.setValue((this.currentType==='xml'?formatXML:formatSCSS)(res));}else{this._showErrorLine(check.error.line,check.error.message,this._getSelectedResource());}},_getSelectedResource:function(){var value=this.$lists[this.currentType].select2('val');return parseInt(value,10)||value;},_isCustomResource(resID){let isCustomized=false;if(this.currentType==='scss'){isCustomized=this.scss[resID].customized;}else if(this.currentType==='js'){isCustomized=this.js[resID].customized;} 8741return isCustomized;},_loadResources:function(){this.resources={xml:{},scss:{},js:{}};this.editingSessions={xml:{},scss:{},js:{}};this.views=this.resources.xml;this.scss=this.resources.scss;this.js=this.resources.js;return this._rpc({route:'/web_editor/get_assets_editor_resources',params:{key:this.viewKey,get_views:!this.options.doNotLoadViews,get_scss:!this.options.doNotLoadSCSS,get_js:!this.options.doNotLoadJS,bundles:this.options.includeBundles,bundles_restriction:this.options.filesFilter==='all'?[]:this.options.defaultBundlesRestriction,only_user_custom_files:this.options.filesFilter==='custom',},}).then((function(resources){_processViews.call(this,resources.views||[]);_processJSorSCSS.call(this,resources.scss||[],'scss');_processJSorSCSS.call(this,resources.js||[],'js');}).bind(this));function _processViews(views){_.extend(this.views,_.indexBy(_.filter(views,function(view){return view.active;}),'id'));var self=this;var roots=[];_.each(this.views,function(view){view.level=0;view.children=[];});_.each(this.views,function(view){var parentId=view.inherit_id[0];var parent=parentId&&self.views[parentId];if(parent){parent.children.push(view);}else{roots.push(view);}});this.sortedViews=[];function visit(view,level){view.level=level;self.sortedViews.push(view);_.each(view.children,function(child){visit(child,level+1);});} 8742_.each(roots,function(root){visit(root,0);});} 8743function _processJSorSCSS(data,type){if(type==='scss'){this.sortedSCSS=data;}else{this.sortedJS=data;} 8744var resources=type==='scss'?this.scss:this.js;_.each(data,function(bundleInfos){_.each(bundleInfos[1],function(info){info.bundle=bundleInfos[0];});_.extend(resources,_.indexBy(bundleInfos[1],'url'));});}},_resetResource:function(resID,type){resID=resID||this._getSelectedResource();type=type||this.currentType;if(this.currentType==='xml'){return Promise.reject(_t("Reseting views is not supported yet"));}else{var resource=type==='scss'?this.scss[resID]:this.js[resID];return this._rpc({model:'web_editor.assets',method:'reset_asset',args:[resID,resource.bundle],});}},_saveSCSSorJS:function(session){var self=this;var sessionIdEndsWithJS=_.string.endsWith(session.id,'.js');var bundle=sessionIdEndsWithJS?this.js[session.id].bundle:this.scss[session.id].bundle;var fileType=sessionIdEndsWithJS?'js':'scss';return self._rpc({model:'web_editor.assets',method:'save_asset',args:[session.id,bundle,session.text,fileType],}).then(function(){self._toggleDirtyInfo(session.id,fileType,false);});},_saveResources:function(){var self=this;var toSave={};var errorFound=false;_.each(this.editingSessions,(function(editingSessions,type){if(errorFound)return;var dirtySessions=_.pick(editingSessions,function(session){return session.getUndoManager().hasUndo();});toSave[type]=_.map(dirtySessions,function(session,resID){return{id:parseInt(resID,10)||resID,text:session.getValue(),};});this._showErrorLine();for(var i=0;i<toSave[type].length&&!errorFound;i++){var check=(type==='xml'?checkXML:checkSCSS)(toSave[type][i].text);if(!check.isValid){this._showErrorLine(check.error.line,check.error.message,toSave[type][i].id,type);errorFound=toSave[type][i];}}}).bind(this));if(errorFound)return Promise.reject(errorFound);var defs=[];var mutex=new concurrency.Mutex();_.each(toSave,(function(_toSave,type){_toSave=_.sortBy(_toSave,'id').reverse();_.each(_toSave,function(session){defs.push(mutex.exec(function(){return(type==='xml'?self._saveView(session):self._saveSCSSorJS(session));}));});}).bind(this));var self=this;return Promise.all(defs).guardedCatch(function(results){if(results===undefined){return;} 8745var error=results[1];Dialog.alert(self,'',{title:_t("Server error"),$content:$('<div/>').html(_t("A server error occured. Please check you correctly signed in and that the file you are saving is correctly formatted.") 8746+'<br/>' 8747+error)});});},_saveView:function(session){var self=this;return new Promise(function(resolve,reject){self._rpc({model:'ir.ui.view',method:'write',args:[[session.id],{arch:session.text}
8747],},{noContextKeys:'lang',}).then(function(){self._toggleDirtyInfo(session.id,'xml',false);resolve();},function(source,error){reject(session,error);});});},_showErrorLine:function(line,message,resID,type){if(line===undefined||line<=0){__restore.call(this);return;} 8748if(type){this._switchType(type);} 8749if(this._getSelectedResource()===resID){__showErrorLine.call(this,line);}else{var onChangeSession=(function(){this.aceEditor.off('changeSession',onChangeSession);_.delay(__showErrorLine.bind(this,line),400);}).bind(this);this.aceEditor.on('changeSession',onChangeSession);this._displayResource(resID,this.currentType);} 8750function __restore(){if(this.errorSession){this.errorSession.off('change',this.errorSessionChangeCallback);this.errorSession.off('changeScrollTop',this.errorSessionScrollCallback);this.errorSession=undefined;} 8751__restoreErrorLine.call(this);if(this.$errorContent){this.$errorContent.removeClass('o_error');this.$errorContent=undefined;}} 8752function __restoreErrorLine(){if(this.$errorLine){this.$errorLine.removeClass('o_error');this.$errorLine.popover('hide');this.$errorLine.popover('dispose');this.$errorLine=undefined;}} 8753function __updateErrorLineDisplay(line){__restoreErrorLine.call(this);const $lines=this.$viewEditor.find('.ace_gutter-cell');this.$errorLine=$lines.filter(function(i,el){return parseInt($(el).text())===line;});if(!this.$errorLine.length){const $firstLine=$lines.first();const firstLineNumber=parseInt($firstLine.text());this.$errorLine=line<firstLineNumber?$lines.eq(1):$lines.eq($lines.length-2);} 8754this.$errorLine.addClass('o_error');this.$errorLine.popover({animation:false,html:true,content:message,placement:'left',container:'body',trigger:'manual',template:'<div class="popover o_ace_error_popover" role="tooltip"><div class="tooltip-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'});this.$errorLine.popover('show');} 8755function __showErrorLine(line){this.$errorContent=this.$viewEditor.find('.ace_scroller').addClass('o_error');this.errorSession=this.aceEditor.getSession();this.errorSessionChangeCallback=__restore.bind(this);this.errorSession.on('change',this.errorSessionChangeCallback);this.errorSessionScrollCallback=_.debounce(__updateErrorLineDisplay.bind(this,line),10);this.errorSession.on('changeScrollTop',this.errorSessionScrollCallback);__updateErrorLineDisplay.call(this,line);setTimeout(()=>this.aceEditor.gotoLine(line),100);}},_switchType:function(type){this.currentType=type;this.$typeSwitcherBtn.html(this.$typeSwitcherChoices.filter('[data-type='+type+']').html());_.each(this.$lists,function($list,_type){$list.toggleClass('d-none',type!==_type);});this.$lists[type].change();this.$includeBundlesArea.toggleClass('d-none',this.currentType!=='xml'||!config.isDebug());this.$includeAllSCSSArea.toggleClass('d-none',this.currentType!=='scss'||!config.isDebug());this.$includeAllSCSSArea.find('[data-value="restricted"]').toggleClass('d-none',this.options.defaultBundlesRestriction.length===0);this.$formatButton.toggleClass('d-none',this.currentType!=='xml');},_toggleDirtyInfo:function(resID,type,isDirty){type=type||this.currentType;if(!resID||!this.editingSessions[type][resID])return;var $option=this.$lists[type].find('[value="'+resID+'"]');if(isDirty===undefined){isDirty=this.editingSessions[type][resID].getUndoManager().hasUndo();} 8756$option.data('dirty',isDirty);},_updateViewSelectDOM:function(){var currentId=this._getSelectedResource();var self=this;this.$lists.xml.empty();_.each(this.sortedViews,function(view){self.$lists.xml.append($('<option/>',{value:view.id,text:view.name,selected:currentId===view.id,'data-level':view.level,'data-debug':view.xml_id,}));});this.$lists.scss.empty();_populateList(this.sortedSCSS,this.$lists.scss,5);this.$lists.js.empty();_populateList(this.sortedJS,this.$lists.js,3);this.$lists.xml.select2('destroy');this.$lists.xml.select2({formatResult:_formatDisplay.bind(this,false),formatSelection:_formatDisplay.bind(this,true),});this.$lists.xml.data('select2').dropdown.addClass('o_ace_select2_dropdown');this.$lists.scss.select2('destroy');this.$lists.scss.select2({formatResult:_formatDisplay.bind(this,false),formatSelection:_formatDisplay.bind(this,true),});this.$lists.scss.data('select2').dropdown.addClass('o_ace_select2_dropdown');this.$lists.js.select2('destroy');this.$lists.js.select2({formatResult:_formatDisplay.bind(this,false),formatSelection:_formatDisplay.bind(this,true),});this.$lists.js.data('select2').dropdown.addClass('o_ace_select2_dropdown');function _populateList(sortedData,$list,lettersToRemove){_.each(sortedData,function(bundleInfos){var $optgroup=$('<optgroup/>',{label:bundleInfos[0],}).appendTo($list);_.each(bundleInfos[1],function(dataInfo){var name=dataInfo.url.substring(_.lastIndexOf(dataInfo.url,'/')+1,dataInfo.url.length-lettersToRemove);$optgroup.append($('<option/>',{value:dataInfo.url,text:name,selected:currentId===dataInfo.url,'data-debug'
8756:dataInfo.url,'data-customized':dataInfo.customized}));});});} 8757function _formatDisplay(isSelected,data){var $elem=$(data.element);var text=data.text||'';if(!isSelected){text=Array(($elem.data('level')||0)+1).join('-')+' '+text;} 8758var $div=$('<div/>',{text:text,class:'o_ace_select2_result',});if($elem.data('dirty')||$elem.data('customized')){$div.prepend($('<span/>',{class:'mr8 fa fa-floppy-o '+($elem.data('dirty')?'text-warning':'text-success'),}));} 8759if(!isSelected&&config.isDebug()&&$elem.data('debug')){$div.append($('<span/>',{text:' ('+$elem.data('debug')+')',class:'ml4 small text-muted',}));} 8760return $div;}},_onCloseClick:function(){this._showErrorLine();this.do_hide();},_onFormatClick:function(){this._formatResource();},_onFilterChange:function(ev){var $item=$(ev.target);$item.addClass('active').siblings().removeClass('active');if($item.data('type')==='xml'){this.options.includeBundles=$(ev.target).data('value')==='all';}else{this.options.filesFilter=$item.data('value');} 8761this._loadResources().then(this._updateViewSelectDOM.bind(this));},_onResChange:function(){this._displayResource(this._getSelectedResource());},_onResetClick:function(){var self=this;Dialog.confirm(this,_t("If you reset this file, all your customizations will be lost as it will be reverted to the default file."),{title:_t("Careful !"),confirm_callback:function(){self._resetResource(self._getSelectedResource());},});},_onSaveClick:function(ev){const restoreSave=dom.addButtonLoadingEffect(ev.currentTarget);const restore=()=>{restoreSave();this.$resetButton[0].disabled=false;};this.$resetButton[0].disabled=true;this._saveResources().then(restore).guardedCatch(restore);},_onTypeChoice:function(ev){ev.preventDefault();this._switchType($(ev.target).data('type'));},_onCloseWarningClick:function(){this.$warningMessage.addClass('d-none');},});return ViewEditor;});; 8762 8763/* /web_editor/static/src/js/common/browser_extensions.js */ 8764odoo.define('@web_editor/js/common/browser_extensions',async function(require){'use strict';let __exports={};const originalGetRangeAt=Selection.prototype.getRangeAt;Selection.prototype.getRangeAt=function(){let range=originalGetRangeAt.apply(this,arguments);if(range.startContainer&&!Object.getPrototypeOf(range.startContainer)){range=document.createRange();range.setStart(this.anchorNode,0);range.setEnd(this.focusNode,0);} 8765return range;};return __exports;});; 8766 8767/* /web_editor/static/src/js/common/grid_layout_utils.js */ 8768odoo.define('@web_editor/js/common/grid_layout_utils',async function(require){'use strict';let __exports={};'use strict';const{qweb}=require('web.core');const{descendants,preserveCursor}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");const rowSize=50;const additionalRowLimit=__exports.additionalRowLimit=10;const defaultGridPadding=10;__exports._getGridProperties=_getGridProperties;function _getGridProperties(rowEl){const style=window.getComputedStyle(rowEl);const rowGap=parseFloat(style.rowGap);const columnGap=parseFloat(style.columnGap);const columnSize=(rowEl.clientWidth-11*columnGap)/12;return{rowGap:rowGap,rowSize:rowSize,columnGap:columnGap,columnSize:columnSize};} 8769__exports._setElementToMaxZindex=_setElementToMaxZindex;function _setElementToMaxZindex(element,rowEl){const childrenEls=[...rowEl.children].filter(el=>el!==element);element.style.zIndex=Math.max(...childrenEls.map(el=>el.style.zIndex))+1;} 8770__exports._addBackgroundGrid=_addBackgroundGrid;function _addBackgroundGrid(rowEl,gridHeight){const gridProp=_getGridProperties(rowEl);const rowCount=Math.max(rowEl.dataset.rowCount,gridHeight);const backgroundGrid=qweb.render('web_editor.background_grid',{rowCount:rowCount+1,rowGap:gridProp.rowGap,rowSize:gridProp.rowSize,columnGap:gridProp.columnGap,columnSize:gridProp.columnSize,});rowEl.insertAdjacentHTML("afterbegin",backgroundGrid);return rowEl.firstElementChild;} 8771__exports._resizeGrid=_resizeGrid;function _resizeGrid(rowEl){const columnEls=[...rowEl.children].filter(c=>c.classList.contains('o_grid_item'));rowEl.dataset.rowCount=Math.max(...columnEls.map(el=>el.style.gridRowEnd))-1;} 8772__exports._gridCleanUp=_gridCleanUp;function _gridCleanUp(rowEl,columnEl){columnEl.style.removeProperty('position');columnEl.style.removeProperty('top');columnEl.style.removeProperty('left');columnEl.style.removeProperty('height');columnEl.style.removeProperty('width');rowEl.style.removeProperty('position');} 8773__exports._toggleGridMode=_toggleGridMode;function _toggleGridMode(containerEl){let rowEl=containerEl.querySelector(':scope > .row');const outOfRowEls=[...containerEl.children].filter(el=>!el.classList.contains('row'));const avoidRollback=(el)=>{for(const node of descendants(el)){node.ouid=undefined;}};const restoreCursor=!rowEl||outOfRowEls.length>0?preserveCursor(containerEl.ownerDocument):()=>{};if(rowEl&&outOfRowEls.length>0){const columnEl=document.createElement('div');columnEl.classList.add('col-lg-12');for(let i=outOfRowEls.length-1;i>=0;i--){columnEl.prepend(outOfRowEls[i]);} 8774avoidRollback(columnEl);rowEl.prepend(columnEl);} 8775if(!rowEl){rowEl=document.createElement('div');rowEl.classList.add('row');const columnEl=document.createElement('div');columnEl.classList.add('col-lg-12');const containerChildren=containerEl.children;for(let i=containerChildren.length-1;i>=0;i--){columnEl.prepend(containerChildren[i]);} 8776avoidRollback(columnEl);rowEl.appendChild(columnEl);containerEl.appendChild(rowEl);}
8777restoreCursor();const columnEls=rowEl.children;const columnSize=(rowEl.clientWidth)/12;rowEl.style.position='relative';const rowCount=_placeColumns(columnEls,rowSize,0,columnSize,0)-1;rowEl.style.removeProperty('position');rowEl.dataset.rowCount=rowCount;const classesToRemove=[...rowEl.classList].filter(c=>{return/^align-items/.test(c);});rowEl.classList.remove(...classesToRemove);rowEl.classList.add('o_grid_mode');} 8778function _placeColumns(columnEls,rowSize,rowGap,columnSize,columnGap){let maxRowEnd=0;const columnSpans=[];let zIndex=1;const imageColumns=[];const allBackgroundColor=[...columnEls].every(columnEl=>columnEl.classList.contains('o_cc'));for(const columnEl of columnEls){let isImageColumn=_checkIfImageColumn(columnEl);const imageEl=columnEl.querySelector('img');const style=window.getComputedStyle(columnEl);const borderLeft=parseFloat(style.borderLeft);const columnLeft=isImageColumn&&!borderLeft?imageEl.offsetLeft:columnEl.offsetLeft;const paddingLeft=parseFloat(style.paddingLeft);let width=isImageColumn?parseFloat(imageEl.scrollWidth):parseFloat(columnEl.scrollWidth)-(allBackgroundColor?0:2*paddingLeft);const borderX=borderLeft+parseFloat(style.borderRight);width+=borderX+(allBackgroundColor||isImageColumn?0:2*defaultGridPadding);let columnSpan=Math.round((width+columnGap)/(columnSize+columnGap));if(columnSpan<1){columnSpan=1;} 8779const columnStart=Math.round(columnLeft/(columnSize+columnGap))+1;const columnEnd=columnStart+columnSpan;const borderTop=parseFloat(style.borderTop);const columnTop=isImageColumn&&!borderTop?imageEl.offsetTop:columnEl.offsetTop;const paddingTop=parseFloat(style.paddingTop);const paddingBottom=parseFloat(style.paddingBottom);const rowOffsetTop=Math.floor((paddingTop+rowGap)/(rowSize+rowGap));let height=isImageColumn?parseFloat(imageEl.scrollHeight):parseFloat(columnEl.scrollHeight)-(allBackgroundColor?0:paddingTop+paddingBottom);const borderY=borderTop+parseFloat(style.borderBottom);height+=borderY+(allBackgroundColor||isImageColumn?0:2*defaultGridPadding);const rowSpan=Math.ceil((height+rowGap)/(rowSize+rowGap));const rowStart=Math.round(columnTop/(rowSize+rowGap))+1+(allBackgroundColor||isImageColumn?0:rowOffsetTop);const rowEnd=rowStart+rowSpan;columnEl.style.gridArea=`${rowStart} / ${columnStart} / ${rowEnd} / ${columnEnd}`;columnEl.classList.add('o_grid_item');columnEl.classList.add('g-col-lg-'+columnSpan,'g-height-'+rowSpan);columnEl.style.zIndex=zIndex++;_reloadLazyImages(columnEl);maxRowEnd=Math.max(rowEnd,maxRowEnd);columnSpans.push(columnSpan);imageColumns.push(isImageColumn);} 8780if(allBackgroundColor){const style=window.getComputedStyle(columnEls[0]);const paddingY=style.paddingTop;const paddingX=style.paddingLeft;const rowEl=columnEls[0].parentNode;rowEl.style.setProperty('--grid-item-padding-y',paddingY);rowEl.style.setProperty('--grid-item-padding-x',paddingX);} 8781for(const[i,columnEl]of[...columnEls].entries()){const regex=/^(pt|pb|col-|offset-)/;const toRemove=[...columnEl.classList].filter(c=>{return regex.test(c);});columnEl.classList.remove(...toRemove);columnEl.classList.add('col-lg-'+columnSpans[i]);if(imageColumns[i]){_convertImageColumn(columnEl);}} 8782return maxRowEnd;} 8783__exports._reloadLazyImages=_reloadLazyImages;function _reloadLazyImages(columnEl){const imageEls=columnEl.querySelectorAll('img');for(const imageEl of imageEls){const src=imageEl.getAttribute("src");imageEl.src='';imageEl.src=src;}} 8784__exports._convertColumnToGrid=_convertColumnToGrid;function _convertColumnToGrid(rowEl,columnEl,columnWidth,columnHeight){if(_checkIfImageColumn(columnEl)){_convertImageColumn(columnEl);} 8785const paddingX=parseFloat(rowEl.style.getPropertyValue("--grid-item-padding-x"))||defaultGridPadding;const paddingY=parseFloat(rowEl.style.getPropertyValue("--grid-item-padding-y"))||defaultGridPadding;columnWidth+=2*paddingX;columnHeight+=2*paddingY;const gridProp=_getGridProperties(rowEl);const columnColCount=Math.round((columnWidth+gridProp.columnGap)/(gridProp.columnSize+gridProp.columnGap));const columnRowCount=Math.ceil((columnHeight+gridProp.rowGap)/(gridProp.rowSize+gridProp.rowGap));const regex=/^(pt|pb|col-|offset-)/;const toRemove=[...columnEl.classList].filter(c=>regex.test(c));columnEl.classList.remove(...toRemove);columnEl.classList.add('g-col-lg-'+columnColCount,'g-height-'+columnRowCount,'col-lg-'+columnColCount);columnEl.classList.add('o_grid_item');return{columnColCount:columnColCount,columnRowCount:columnRowCount};} 8786__exports._checkIfImageColumn=_checkIfImageColumn;function _checkIfImageColumn(columnEl){let isImageColumn=false;const imageEls=columnEl.querySelectorAll(":scope > img, :scope > a > img");const columnChildrenEls=[...columnEl.children].filter(el=>el.nodeName!=='BR');if(imageEls.length===1&&columnChildrenEls.length===1){const textNodeEls=[...columnEl.childNodes].filter(el=>el.nodeType===Node.TEXT_NODE);const areTextNodesEmpty=[...textNodeEls].every(textNodeEl=>textNodeEl.nodeValue.trim()==='');isImageColumn=areTextNodesEmpty;} 8787return isImageColumn;} 8788function _convertImageColumn(columnEl){columnEl.querySelectorAll('br').forEach(el=>el.remove());const textNodeEls=[...columnEl.childNodes].filter(el=>el.nodeType===Node.TEXT_NODE);
8788textNodeEls.forEach(el=>el.remove());const imageEl=columnEl.querySelector('img');columnEl.classList.add('o_grid_item_image');imageEl.style.removeProperty('width');} 8789return __exports;});; 8790 8791/* /web_editor/static/src/js/common/utils.js */ 8792odoo.define('web_editor.utils',function(require){'use strict';const{ColorpickerWidget}=require('web.Colorpicker');let editableWindow=window;const _setEditableWindow=(ew)=>editableWindow=ew;const COLOR_PALETTE_COMPATIBILITY_COLOR_NAMES=['primary','secondary','alpha','beta','gamma','delta','epsilon','success','info','warning','danger'];const EDITOR_COLOR_CSS_VARIABLES=[...COLOR_PALETTE_COMPATIBILITY_COLOR_NAMES];for(let i=1;i<=5;i++){EDITOR_COLOR_CSS_VARIABLES.push(`o-color-${i}`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-bg`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-headings`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-text`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-btn-primary`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-btn-primary-text`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-btn-secondary`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-btn-secondary-text`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-btn-primary-border`);EDITOR_COLOR_CSS_VARIABLES.push(`o-cc${i}-btn-secondary-border`);} 8793for(let i=100;i<=900;i+=100){EDITOR_COLOR_CSS_VARIABLES.push(`${i}`);} 8794const CSS_SHORTHANDS={'border-width':['border-top-width','border-right-width','border-bottom-width','border-left-width'],'border-radius':['border-top-left-radius','border-top-right-radius','border-bottom-right-radius','border-bottom-left-radius'],'border-color':['border-top-color','border-right-color','border-bottom-color','border-left-color'],'border-style':['border-top-style','border-right-style','border-bottom-style','border-left-style'],'padding':['padding-top','padding-right','padding-bottom','padding-left'],};const CSS_UNITS_CONVERSION={'s-ms':()=>1000,'ms-s':()=>0.001,'rem-px':()=>_computePxByRem(),'px-rem':()=>_computePxByRem(true),'%-px':()=>-1,'px-%':()=>-1,};const DEFAULT_PALETTE={'1':'#3AADAA','2':'#7C6576','3':'#F6F6F6','4':'#FFFFFF','5':'#383E45',};const BACKGROUND_IMAGE_ATTRIBUTES=new Set(["originalId","originalSrc","mimetype","resizeWidth","glFilter","quality","bgSrc","filterOptions",]);function _computePxByRem(toRem){if(_computePxByRem.PX_BY_REM===undefined){const htmlStyle=editableWindow.getComputedStyle(editableWindow.document.documentElement);_computePxByRem.PX_BY_REM=parseFloat(htmlStyle['font-size']);} 8795return toRem?(1/_computePxByRem.PX_BY_REM):_computePxByRem.PX_BY_REM;} 8796function _convertValueToUnit(value,unitTo,cssProp,$target){const m=_getNumericAndUnit(value);if(!m){return NaN;} 8797const numValue=parseFloat(m[0]);const valueUnit=m[1];return _convertNumericToUnit(numValue,valueUnit,unitTo,cssProp,$target);} 8798function _convertNumericToUnit(value,unitFrom,unitTo,cssProp,$target){if(Math.abs(value)<Number.EPSILON||unitFrom===unitTo){return value;} 8799const converter=CSS_UNITS_CONVERSION[`${unitFrom}-${unitTo}`];if(converter===undefined){throw new Error(`Cannot convert '${unitFrom}' units into '${unitTo}' units !`);} 8800return value*converter(cssProp,$target);} 8801function _getNumericAndUnit(value){const m=value.trim().match(/^(-?[0-9.]+(?:e[+|-]?[0-9]+)?)\s*([^\s]*)$/);if(!m){return null;} 8802return[m[1].trim(),m[2].trim()];} 8803function _areCssValuesEqual(value1,value2,cssProp,$target){if(value1===value2){return true;} 8804if(cssProp&&cssProp.endsWith('-size')){const pseudoPartProp=cssProp+'-part';const re=/-?[0-9.]+(?:e[+|-]?[0-9]+)?\s*[A-Za-z%-]+|auto/g;const parts1=value1.match(re);const parts2=value2.match(re);for(const index of[0,1]){const part1=parts1&&parts1.length>index?parts1[index]:'auto';const part2=parts2&&parts2.length>index?parts2[index]:'auto';if(!_areCssValuesEqual(part1,part2,pseudoPartProp,$target)){return false;}} 8805return true;} 8806if(value1.startsWith('var(--')){value1=_getCSSVariableValue(value1.substring(6,value1.length-1));} 8807if(value2.startsWith('var(--')){value2=_getCSSVariableValue(value2.substring(6,value2.length-1));} 8808if(value1===value2){return true;} 8809const color1=ColorpickerWidget.normalizeCSSColor(value1);const color2=ColorpickerWidget.normalizeCSSColor(value2);
8809if(color1===color2){return true;} 8810const value1IsGradient=_isColorGradient(value1);const value2IsGradient=_isColorGradient(value2);if(value1IsGradient!==value2IsGradient){return false;} 8811if(value1IsGradient){const temp1El=document.createElement('div');temp1El.style.backgroundImage=value1;document.body.appendChild(temp1El);value1=getComputedStyle(temp1El).backgroundImage;document.body.removeChild(temp1El);const temp2El=document.createElement('div');temp2El.style.backgroundImage=value2;document.body.appendChild(temp2El);value2=getComputedStyle(temp2El).backgroundImage;document.body.removeChild(temp2El);return value1===value2;} 8812if(cssProp==='box-shadow'){const temp1El=document.createElement('div');temp1El.style.boxShadow=value1;document.body.appendChild(temp1El);value1=getComputedStyle(temp1El).boxShadow;document.body.removeChild(temp1El);const temp2El=document.createElement('div');temp2El.style.boxShadow=value2;document.body.appendChild(temp2El);value2=getComputedStyle(temp2El).boxShadow;document.body.removeChild(temp2El);return value1===value2;} 8813const data=_getNumericAndUnit(value1);if(!data){return false;} 8814const numValue1=data[0];const numValue2=_convertValueToUnit(value2,data[1],cssProp,$target);return(Math.abs(numValue1-numValue2)<Number.EPSILON);} 8815function _isColorCombinationName(name){const number=parseInt(name);return(!isNaN(number)&&number%100!==0);} 8816function _computeColorClasses(colorNames,prefix='bg-'){let hasCCClasses=false;const isBgPrefix=(prefix==='bg-');const classes=colorNames.map(c=>{if(isBgPrefix&&_isColorCombinationName(c)){hasCCClasses=true;return`o_cc${c}`;} 8817return(prefix+c);});if(hasCCClasses){classes.push('o_cc');} 8818return classes;} 8819function _getCSSVariableValue(key,htmlStyle){if(htmlStyle===undefined){htmlStyle=editableWindow.getComputedStyle(editableWindow.document.documentElement);} 8820let value=htmlStyle.getPropertyValue(`--${key}`).trim();value=ColorpickerWidget.normalizeCSSColor(value);return value.replace(/"/g,"'");} 8821function _normalizeColor(color){if(ColorpickerWidget.isCSSColor(color)){return color;} 8822return _getCSSVariableValue(color);} 8823function _getBgImageURL(el){const parts=_backgroundImageCssToParts($(el).css('background-image'));const string=parts.url||'';const match=string.match(/^url\((['"])(.*?)\1\)$/);if(!match){return'';} 8824const matchedURL=match[2];const fullURL=new URL(matchedURL,window.location.origin);if(fullURL.origin===window.location.origin){return fullURL.href.slice(fullURL.origin.length);} 8825return matchedURL;} 8826function _backgroundImageCssToParts(css){const parts={};css=css||'';if(css.startsWith('url(')){const urlEnd=css.indexOf(')')+1;parts.url=css.substring(0,urlEnd).trim();const commaPos=css.indexOf(',',urlEnd);css=commaPos>0?css.substring(commaPos+1):'';} 8827if(_isColorGradient(css)){parts.gradient=css.trim();} 8828return parts;} 8829function _backgroundImagePartsToCss(parts){let css=parts.url||'';if(parts.gradient){css+=(css?', ':'')+parts.gradient;} 8830return css||'none';} 8831function _isColorGradient(value){return value&&value.includes('-gradient(');} 8832function _generateHTMLId(){return`o${Math.random().toString(36).substring(2, 15)}`;} 8833function _getColorClass(el,colorNames,prefix){const prefixedColorNames=_computeColorClasses(colorNames,prefix);return el.classList.value.split(' ').filter(cl=>prefixedColorNames.includes(cl)).join(' ');} 8834function _addBackgroundImageAttributes(...newAttributes){BACKGROUND_IMAGE_ATTRIBUTES.add(...newAttributes);} 8835function _isBackgroundImageAttribute(attribute){return BACKGROUND_IMAGE_ATTRIBUTES.has(attribute);} 8836function _shouldEditableMediaBeEditable(mediaEl){const parentEl=mediaEl.parentElement;const nonEditableAncestorRootEl=parentEl&&parentEl.closest('[contenteditable="false"]');return nonEditableAncestorRootEl&&nonEditableAncestorRootEl.parentElement&&nonEditableAncestorRootEl.parentElement.isContentEditable;} 8837return{COLOR_PALETTE_COMPATIBILITY_COLOR_NAMES:COLOR_PALETTE_COMPATIBILITY_COLOR_NAMES,CSS_SHORTHANDS:CSS_SHORTHANDS,CSS_UNITS_CONVERSION:CSS_UNITS_CONVERSION,DEFAULT_PALETTE:DEFAULT_PALETTE,EDITOR_COLOR_CSS_VARIABLES:EDITOR_COLOR_CSS_VARIABLES,computePxByRem:_computePxByRem,convertValueToUnit:_convertValueToUnit,convertNumericToUnit:_convertNumericToUnit,getNumericAn
8837dUnit:_getNumericAndUnit,areCssValuesEqual:_areCssValuesEqual,isColorCombinationName:_isColorCombinationName,isColorGradient:_isColorGradient,computeColorClasses:_computeColorClasses,getCSSVariableValue:_getCSSVariableValue,normalizeColor:_normalizeColor,getBgImageURL:_getBgImageURL,backgroundImageCssToParts:_backgroundImageCssToParts,backgroundImagePartsToCss:_backgroundImagePartsToCss,generateHTMLId:_generateHTMLId,getColorClass:_getColorClass,setEditableWindow:_setEditableWindow,addBackgroundImageAttributes:_addBackgroundImageAttributes,isBackgroundImageAttribute:_isBackgroundImageAttribute,shouldEditableMediaBeEditable:_shouldEditableMediaBeEditable,};});; 8838 8839/* /web_editor/static/src/js/common/wysiwyg_utils.js */ 8840odoo.define('@web_editor/js/common/wysiwyg_utils',async function(require){'use strict';let __exports={};__exports.isImg=isImg;function isImg(node){return(node&&(node.nodeName==="IMG"||(node.className&&node.className.match(/(^|\s)(media_iframe_video|o_image|fa)(\s|$)/i))));} 8841__exports.ancestors=ancestors;function ancestors(node,stopElement){if(!node||!node.parentElement||node===stopElement)return[];return[node.parentElement,...ancestors(node.parentElement,stopElement)];} 8842return __exports;});; 8843 8844/* /web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js */ 8845odoo.define('@web_editor/js/editor/odoo-editor/src/utils/utils',async function(require){'use strict';let __exports={};const DIRECTIONS=__exports.DIRECTIONS={LEFT:false,RIGHT:true,};const CTYPES=__exports.CTYPES={CONTENT:1,SPACE:2,BLOCK_OUTSIDE:4,BLOCK_INSIDE:8,BR:16,};__exports.ctypeToString=ctypeToString;function ctypeToString(ctype){return Object.keys(CTYPES).find((key)=>CTYPES[key]===ctype);} 8846const CTGROUPS=__exports.CTGROUPS={INLINE:CTYPES.CONTENT|CTYPES.SPACE,BLOCK:CTYPES.BLOCK_OUTSIDE|CTYPES.BLOCK_INSIDE,BR:CTYPES.BR,};const tldWhitelist=['com','net','org','ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az','ba','bb','bd','be','bf','bg','bh','bi','bj','bl','bm','bn','bo','br','bq','bs','bt','bv','bw','by','bz','ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cs','cu','cv','cw','cx','cy','cz','dd','de','dj','dk','dm','do','dz','ec','ee','eg','eh','er','es','et','eu','fi','fj','fk','fm','fo','fr','ga','gb','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw','gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je','jm','jo','jp','ke','kg','kh','ki','km','kn','kp','kr','kw','ky','kz','la','lb','lc','li','lk','lr','ls','lt','lu','lv','ly','ma','mc','md','me','mf','mg','mh','mk','ml','mm','mn','mo','mp','mq','mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np','nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pm','pn','pr','ps','pt','pw','py','qa','re','ro','rs','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sj','sk','sl','sm','sn','so','sr','ss','st','su','sv','sx','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tp','tr','tt','tv','tw','tz','ua','ug','uk','um','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yt','yu','za','zm','zr','zw','co\\.uk'];const urlRegexBase=`|(?:www.))[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-zA-Z][a-zA-Z0-9]{1,62}|(?:[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.(?:${tldWhitelist.join('|')})\\b))(?:(?:[/?#])[^\\s]*[^!.,})\\]'"\\s]|(?:[^!(){}.,[\\]'"\\s]+))?`;const httpRegex=`(?:https?:\\/\\/)`;const httpCapturedRegex=`(https?:\\/\\/)`;const URL_REGEX=__exports.URL_REGEX=new RegExp(`((?:(?:${httpRegex}${urlRegexBase})`,'gi');const URL_REGEX_WITH_INFOS=__exports.URL_REGEX_WITH_INFOS=new RegExp(`((?:(?:${httpCapturedRegex}${urlRegexBase})`,'gi');const YOUTUBE_URL_GET_VIDEO_ID=__exports.YOUTUBE_URL_GET_VIDEO_ID=/^(?:(?:https?:)?\/\/)?(?:(?:www|m)\.)?(?:youtube\.com|youtu\.be)(?:\/(?:[\w-]+\?v=|embed\/|v\/)?)([^\s?&#]+)(?:\S+)?$/i;const EMAIL_REGEX=__exports.EMAIL_REGEX=/^(mailto:)?[\w-.]+@(?:[\w-]+\.)+[\w-]{2,4}$/i;const PROTECTED_BLOCK_TAG=__exports.PROTECTED_BLOCK_TAG=['TR','TD','TABLE','TBODY','UL','OL','LI'];const ZERO_WIDTH_CHARS=__exports.ZERO_WIDTH_CHARS=['\u200b','\ufeff'];const ZERO_WIDTH_CHARS_REGEX=__exports.ZERO_WIDTH_CHARS_REGEX=new RegExp(`[${ZERO_WIDTH_CHARS.join('')}]`,'g');__exports.leftPos=leftPos;function leftPos(node){return[node.parentNode,childNodeIndex(node)];} 8847__exports.rightPos=rightPos;function rightPos(node){return[node.parentNode,childNodeIndex(node)+1];} 8848__exports.boundariesOut=boundariesOut;function boundariesOut(node){const index=childNodeIndex(node);return[node.parentNode,index,node.parentNode,index+1];} 8849__exports.startPos=startPos;function startPos(node){return[node,0];} 8850__exports.endPos=endPos;function endPos(node){return[node,nodeSize(node)];} 8851__exports.boundariesIn=boundariesIn;function boundariesIn(node){return[node,0,node,nodeSize(node)];} 8852__exports.childNodeIndex=childNodeIndex;function childNodeIndex(node){let i=0;while(node.previousSibling){i++;node=node.previousSibling;} 8853return i;} 8854__exports.nodeSize=nodeSize;function nodeSize(node){const isTextNode=node.nodeType===Node.TEXT_NODE;return isTextNode?node.length:node.childNodes.length;} 8855const closestPath=__exports.closestPath=function*(node){while(node){yield node;node=node.parentNode;}};const PATH_END_REASONS={NO_NODE:0,BLOCK_OUT:1,BLOCK_HIT:2,OUT_OF_SCOPE:3,};__exports.createDOMPathGenerator=createDOMPathGenerator;function createDOMPathGenerator(direction,{leafOnly=false,inScope=false,stopTraverseFunction,stopFunction}={},){const nextDeepest=direction===DIRECTIONS.LEFT?node=>lastLeaf(node.previousSibling,stopTraverseFunction):node=>firstLeaf(node.nextSibling,stopTraverseFunction);const firstNode=direction===DIRECTIONS.LEFT?(node,offset)=>lastLeaf(node.childNodes[offset-1],stopTraverseFunction):(node,offset)=>firstLeaf(node.childNodes[offset],stopTraverseFunction);return function*(node,offset,reasons=[]){let movedUp=false;let currentNode=firstNode(node,offset);if(!currentNode){movedUp=true;currentNode=node;} 8856while(currentNode){if(stopFunction&&stopFunction(currentNode)){reasons.push(movedUp?PATH_END_REASONS.BLOCK_OUT:PATH_END_REASONS.BLOCK_HIT);break;} 8857if(inScope&¤tNode===node){reasons.push(PATH_END_REASONS.OUT_OF_SCOPE);break;} 8858if(!(leafOnly&&movedUp)){yield currentNode;} 8859movedUp=false;let nextNode=nextDeepest(currentNode);
8859if(!nextNode){movedUp=true;nextNode=currentNode.parentNode;} 8860currentNode=nextNode;} 8861reasons.push(PATH_END_REASONS.NO_NODE);};} 8862__exports.findNode=findNode;function findNode(domPath,findCallback=()=>true,stopCallback=()=>false){for(const node of domPath){if(findCallback(node)){return node;} 8863if(stopCallback(node)){break;}} 8864return null;} 8865__exports.getFurthestUneditableParent=getFurthestUneditableParent;function getFurthestUneditableParent(node,parentLimit){if(node===parentLimit||(parentLimit&&!parentLimit.contains(node))){return undefined;} 8866let parent=node&&node.parentElement;let nonEditableElement;while(parent&&(!parentLimit||parent!==parentLimit)){if(!parent.isContentEditable){nonEditableElement=parent;} 8867if(parent.oid==="root"){break;} 8868parent=parent.parentElement;} 8869return nonEditableElement;} 8870__exports.closestElement=closestElement;function closestElement(node,selector){let element=node;while(element&&element.nodeType!==Node.ELEMENT_NODE){element=element.parentNode;} 8871if(element&&selector){element=element.closest(selector);} 8872return element&&element.querySelector('.odoo-editor-editable')?null:element;} 8873__exports.ancestors=ancestors;function ancestors(node,editable){if(!node||!node.parentElement||node===editable)return[];return[node.parentElement,...ancestors(node.parentElement,editable)];} 8874__exports.descendants=descendants;function descendants(node){const posterity=[];for(const child of(node.childNodes||[])){posterity.push(child,...descendants(child));} 8875return posterity;} 8876__exports.closestBlock=closestBlock;function closestBlock(node){return findNode(closestPath(node),node=>isBlock(node));} 8877__exports.lastLeaf=lastLeaf;function lastLeaf(node,stopTraverseFunction){while(node&&node.lastChild&&!(stopTraverseFunction&&stopTraverseFunction(node))){node=node.lastChild;} 8878return node;} 8879__exports.firstLeaf=firstLeaf;function firstLeaf(node,stopTraverseFunction){while(node&&node.firstChild&&!(stopTraverseFunction&&stopTraverseFunction(node))){node=node.firstChild;} 8880return node;} 8881__exports.previousLeaf=previousLeaf;function previousLeaf(node,editable,skipInvisible=false){let ancestor=node;while(ancestor&&!ancestor.previousSibling&&ancestor!==editable){ancestor=ancestor.parentElement;} 8882if(ancestor&&ancestor!==editable){if(skipInvisible&&!isVisible(ancestor.previousSibling)){return previousLeaf(ancestor.previousSibling,editable,skipInvisible);}else{const last=lastLeaf(ancestor.previousSibling);if(skipInvisible&&!isVisible(last)){return previousLeaf(last,editable,skipInvisible);}else{return last;}}}} 8883__exports.nextLeaf=nextLeaf;function nextLeaf(node,editable,skipInvisible=false){let ancestor=node;while(ancestor&&!ancestor.nextSibling&&ancestor!==editable){ancestor=ancestor.parentElement;} 8884if(ancestor&&ancestor!==editable){if(skipInvisible&&ancestor.nextSibling&&!isVisible(ancestor.nextSibling)){return nextLeaf(ancestor.nextSibling,editable,skipInvisible);}else{const first=firstLeaf(ancestor.nextSibling);if(skipInvisible&&!isVisible(first)){return nextLeaf(first,editable,skipInvisible);}else{return first;}}}} 8885__exports.getAdjacentPreviousSiblings=getAdjacentPreviousSiblings;function getAdjacentPreviousSiblings(node,predicate=n=>!!n){let previous=node.previousSibling;const list=[];while(previous&&predicate(previous)){list.push(previous);previous=previous.previousSibling;} 8886return list;} 8887__exports.getAdjacentNextSiblings=getAdjacentNextSiblings;function getAdjacentNextSiblings(node,predicate=n=>!!n){let next=node.nextSibling;const list=[];while(next&&predicate(next)){list.push(next);next=next.nextSibling;} 8888return list;} 8889__exports.getAdjacents=getAdjacents;function getAdjacents(node,predicate=n=>!!n){const previous=getAdjacentPreviousSiblings(node,predicate);const next=getAdjacentNextSiblings(node,predicate);return predicate(node)?[...previous.reverse(),node,...next]:[];} 8890__exports.hasTableSelection=hasTableSelection;function hasTableSelection(editable){return!!editable.querySelector('.o_selected_table');} 8891__exports.hasValidSelection=hasValidSelection;function hasValidSelection(editable){return hasTableSelection(editable)||editable.ownerDocument.getSelection().rangeCount>0;} 8892__exports.getNormalizedCursorPosition=getNormalizedCursorPosition;function getNormalizedCursorPosition(node,offset,full=true){const editable=closestElement(node,'.odoo-editor-editable');let closest=closestElement(node);while(closest&&closest!==editable&&(isVisibleEmpty(node)||!closest.isContentEditable)){[node,offset]=offset||!nodeSize(node)?rightPos(node):leftPos(node);closest=closestElement(node);}
8893offset=Math.min(Math.max(offset,0),nodeSize(node));if(full){let el;let elOffset;if(node.nodeType===Node.ELEMENT_NODE){el=node;elOffset=offset;}else if(node.nodeType===Node.TEXT_NODE){if(offset===0){el=node.parentNode;elOffset=childNodeIndex(node);}else if(offset===node.length){el=node.parentNode;elOffset=childNodeIndex(node)+1;}} 8894if(el){const leftInlineNode=leftLeafOnlyInScopeNotBlockEditablePath(el,elOffset).next().value;let leftVisibleEmpty=false;if(leftInlineNode){leftVisibleEmpty=isVisibleEmpty(leftInlineNode)||!closestElement(leftInlineNode).isContentEditable;[node,offset]=leftVisibleEmpty?rightPos(leftInlineNode):endPos(leftInlineNode);} 8895if(!leftInlineNode||leftVisibleEmpty){const rightInlineNode=rightLeafOnlyInScopeNotBlockEditablePath(el,elOffset).next().value;if(rightInlineNode){const closest=closestElement(rightInlineNode);const rightVisibleEmpty=isVisibleEmpty(rightInlineNode)||!closest||!closest.isContentEditable;if(!(leftVisibleEmpty&&rightVisibleEmpty)){[node,offset]=rightVisibleEmpty?leftPos(rightInlineNode):startPos(rightInlineNode);}}}}} 8896const prevNode=node.nodeType===Node.ELEMENT_NODE&&node.childNodes[offset-1];if(prevNode&&prevNode.nodeName==='BR'&&isFakeLineBreak(prevNode)){offset--;} 8897return[node,offset];} 8898__exports.insertSelectionChars=insertSelectionChars;function insertSelectionChars(anchorNode,anchorOffset,focusNode,focusOffset,startChar='[',endChar=']'){if(anchorNode===focusNode&&anchorOffset<=focusOffset){focusOffset+=(focusNode.nodeType===Node.TEXT_NODE?startChar.length:1);} 8899insertCharsAt(startChar,anchorNode,anchorOffset);insertCharsAt(endChar,focusNode,focusOffset);} 8900__exports.logSelection=logSelection;function logSelection(root,options={}){const sel=options.selection||root.ownerDocument.getSelection();if(!root.contains(sel.anchorNode)||!root.contains(sel.focusNode)){console.warn('The selection is not contained in the root.');return;} 8901let anchorClone,focusClone;const cloneTree=node=>{const clone=node.cloneNode();if(options.includeOids){clone.oid=node.oid;} 8902anchorClone=anchorClone||(node===sel.anchorNode&&clone);focusClone=focusClone||(node===sel.focusNode&&clone);for(const child of node.childNodes||[]){clone.append(cloneTree(child));} 8903return clone;} 8904const rootClone=cloneTree(root);insertSelectionChars(anchorClone,sel.anchorOffset,focusClone,sel.focusOffset,'%c[%c','%c]%c');rootClone.removeAttribute('data-last-history-steps');if(options.doFormat){const formatHtml=(node,spaces=0)=>{node.before(document.createTextNode('\n'+' '.repeat(spaces)));for(const child of[...node.childNodes]){formatHtml(child,spaces+4);} 8905if(node.nodeType!==Node.TEXT_NODE){node.appendChild(document.createTextNode('\n'+' '.repeat(spaces)));} 8906if(options.includeOids){if(node.nodeType===Node.TEXT_NODE){node.textContent+=` (${node.oid})`;}else{node.setAttribute('oid',node.oid);}}} 8907formatHtml(rootClone);} 8908const selectionCharacterStyle='color: #75bfff; font-weight: 700;';const defaultStyle='color: inherit; font-weight: inherit;';console.log(makeZeroWidthCharactersVisible(rootClone.outerHTML),selectionCharacterStyle,defaultStyle,selectionCharacterStyle,defaultStyle,);} 8909__exports.ensureFocus=ensureFocus;function ensureFocus(element){const activeElement=element.ownerDocument.activeElement;if(activeElement!==element&&(!element.contains(activeElement)||!activeElement.isContentEditable)){element.focus();}} 8910__exports.setSelection=setSelection;function setSelection(anchorNode,anchorOffset,focusNode=anchorNode,focusOffset=anchorOffset,normalize=true,){if(!anchorNode||!anchorNode.parentElement||!anchorNode.parentElement.closest('body')||!focusNode||!focusNode.parentElement||!focusNode.parentElement.closest('body')){return null;} 8911const document=anchorNode.ownerDocument;const seemsCollapsed=anchorNode===focusNode&&anchorOffset===focusOffset;[anchorNode,anchorOffset]=getNormalizedCursorPosition(anchorNode,anchorOffset,normalize);[focusNode,focusOffset]=seemsCollapsed?[anchorNode,anchorOffset]:getNormalizedCursorPosition(focusNode,focusOffset,normalize);const direction=getCursorDirection(anchorNode,anchorOffset,focusNode,focusOffset);const sel=document.getSelection();if(!sel){return null;} 8912try{const range=new Range();if(direction===DIRECTIONS.RIGHT){range.setStart(anchorNode,anchorOffset);range.collapse(true);}else{range.setEnd(anchorNode,anchorOffset);range.collapse(false);} 8913sel.removeAllRanges();sel.addRange(range);sel.extend(focusNode,focusOffset);}catch(e){if(e.name!=='NS_ERROR_FAILURE'){throw e;}}
8914return[anchorNode,anchorOffset,focusNode,focusOffset];} 8915__exports.setCursorStart=setCursorStart;function setCursorStart(node,normalize=true){const pos=startPos(node);return setSelection(...pos,...pos,normalize);} 8916__exports.setCursorEnd=setCursorEnd;function setCursorEnd(node,normalize=true){const pos=endPos(node);return setSelection(...pos,...pos,normalize);} 8917__exports.getCursorDirection=getCursorDirection;function getCursorDirection(anchorNode,anchorOffset,focusNode,focusOffset){if(anchorNode===focusNode){if(anchorOffset===focusOffset)return false;return anchorOffset<focusOffset?DIRECTIONS.RIGHT:DIRECTIONS.LEFT;} 8918return anchorNode.compareDocumentPosition(focusNode)&Node.DOCUMENT_POSITION_FOLLOWING?DIRECTIONS.RIGHT:DIRECTIONS.LEFT;} 8919__exports.getTraversedNodes=getTraversedNodes;function getTraversedNodes(editable,range=getDeepRange(editable)){const selectedTableCells=editable.querySelectorAll('.o_selected_td');const document=editable.ownerDocument;if(!range)return[];const iterator=document.createNodeIterator(range.commonAncestorContainer);let node;do{node=iterator.nextNode();}while(node&&node!==range.startContainer&&!(selectedTableCells.length&&node===selectedTableCells[0]));if(node&&!(selectedTableCells.length&&node===selectedTableCells[0])&&!range.collapsed&&node.nodeType===Node.ELEMENT_NODE&&node.childNodes.length&&range.startOffset&&node.childNodes[range.startOffset-1].nodeName==="BR"){const targetBr=node.childNodes[range.startOffset-1];while(node!=targetBr){node=iterator.nextNode();} 8920node=iterator.nextNode();} 8921if(node&&!range.collapsed&&node===range.startContainer&&range.startOffset===nodeSize(node)&&node.nextSibling&&node.nextSibling.nodeName==="BR"){node=iterator.nextNode();} 8922const traversedNodes=new Set([node,...descendants(node)]);while(node&&node!==range.endContainer){node=iterator.nextNode();if(node){const selectedTable=closestElement(node,'.o_selected_table');if(selectedTable){for(const selectedTd of selectedTable.querySelectorAll('.o_selected_td')){traversedNodes.add(selectedTd);descendants(selectedTd).forEach(descendant=>traversedNodes.add(descendant));}}else if(!(node===range.endContainer&&range.endOffset===0&&!range.collapsed&&node.previousSibling&&node.previousSibling.nodeName==="BR")){traversedNodes.add(node);}}} 8923if(node){for(const descendant of descendants(node)){if(descendant.parentElement===node&&childNodeIndex(descendant)>=range.endOffset){break;} 8924traversedNodes.add(descendant);}} 8925return[...traversedNodes];} 8926__exports.getSelectedNodes=getSelectedNodes;function getSelectedNodes(editable){const selectedTableCells=editable.querySelectorAll('.o_selected_td');const document=editable.ownerDocument;const sel=document.getSelection();if(!sel.rangeCount&&!selectedTableCells.length){return[];} 8927const range=sel.getRangeAt(0);return[...new Set(getTraversedNodes(editable).flatMap(node=>{const td=closestElement(node,'.o_selected_td');if(td){return descendants(td);}else if(range.isPointInRange(node,0)&&range.isPointInRange(node,nodeSize(node))){return node;}else{return[];}},))];} 8928__exports.getDeepRange=getDeepRange;function getDeepRange(editable,{range,sel,splitText,select,correctTripleClick}={}){sel=sel||editable.parentElement&&editable.ownerDocument.getSelection();if(sel&&sel.isCollapsed&&sel.anchorNode&&sel.anchorNode.nodeName==="BR"){setCursorStart(sel.anchorNode.parentElement,false);} 8929range=range?range.cloneRange():sel&&sel.rangeCount&&sel.getRangeAt(0).cloneRange();if(!range)return;let start=range.startContainer;let startOffset=range.startOffset;let end=range.endContainer;let endOffset=range.endOffset;const isBackwards=!range.collapsed&&start===sel.focusNode&&startOffset===sel.focusOffset;[start,startOffset]=getDeepestPosition(start,startOffset);[end,endOffset]=getDeepestPosition(end,endOffset);if(splitText){const isInSingleContainer=start===end;if(end.nodeType===Node.TEXT_NODE&&endOffset!==0&&endOffset!==end.textContent.length){const endParent=end.parentNode;const splitOffset=splitTextNode(end,endOffset);end=endParent.childNodes[splitOffset-1]||endParent.firstChild;if(isInSingleContainer){start=end;} 8930endOffset=end.textContent.length;} 8931if(start.nodeType===Node.TEXT_NODE&&startOffset!==0&&startOffset!==start.textContent.length){splitTextNode(start,startOffset);startOffset=0;if(isInSingleContainer){endOffset=start.textContent.length;}}} 8932const endLeaf=firstLeaf(end);const beforeEnd=endLeaf.previousSibling;const isInsideColumn=closestElement(end,'.o_text_columns') 8933if(correctTripleClick&&!endOffset&&(start!==end||startOffset!==endOffset)&&(!beforeEnd||(beforeEnd.nodeType===Node.TEXT_NODE&&!isVisibleStr(beforeEnd)))&&!closestElement(endLeaf,'table')&&!isInsideColumn){const previous=previousLeaf(endLeaf,editable,true);if(previous&&closestElement(previous).isContentEditable){[end,endOffset]=[previous,nodeSize(previous)];}} 8934if(select){if(isBackwards){[start,end,startOffset,endOffset]=[end,start,endOffset,startOffset];range.setEnd(start,startOffset);range.collapse(false);}else{range.setStart(start,startOffset);range.collapse(true);} 8935sel.removeAllRanges();sel.addRange(range);try{sel.extend(end,endOffset);}catch{} 8936range=sel.getRangeAt(0);}else{range.setStart(start,startOffset);range.setEnd(end,endOffset);} 8937return range;} 8938__exports.getAdjacentCharacter=getAdjacentCharacter;function getAdjacentCharacter(editable,side){let{focusNode,focusOffset}=editable.ownerDocument.getSelection();const originalBlock=closestBlock(focusNode);let adjacentCharacter;while(!adjacentCharacter&&focusNode){if(side==='previous'){adjacentCharacter=focusOffset>0&&focusNode.textContent[focusOffset-1];}else{adjacentCharacter=focusNode.textContent[focusOffset];} 8939if(!adjacentCharacter){if(side==='previous'){focusNode=previousLeaf(focusNode,editable);focusOffset=focusNode&&nodeSize(focusNode);}else{focusNode=nextLeaf(focusNode,editable);focusOffset=0;} 8940const characterIndex=side==='previous'?focusOffset-1:focusOffset;adjacentCharacter=focusNode&&focusNode.textContent[characterIndex];}} 8941return closestBlock(focusNode)===originalBlock?adjacentCharacter:undefined;} 8942function isZwnbsp(node){return node.nodeType===Node.TEXT_NODE&&node.textContent==='\ufeff';} 8943function isTangible(node){return isVisible(node)||isZwnbsp(node);} 8944function getNextTangibleNode(node){while(node&&!isTangible(node)){node=node.nextSibling;} 8945return node;} 8946__exports.getDeepestPosition=getDeepestPosition;function getDeepestPosition(node,offset){let found=false;while(node.hasChildNodes()){let newNode=node.childNodes[offset];if(newNode){newNode=getNextTangibleNode(newNode);if(!newNode||isVisibleEmpty(newNode))break;found=true;node=newNode;offset=0;}else{break;}} 8947if(!found){while(node.hasChildNodes()){let newNode=node.childNodes[offset-1];newNode=getNextTangibleNode(newNode);if(!newNode||isVisibleEmpty(newNode))break;node=newNode;offset=nodeSize(node);}} 8948let didMove=false;let reversed=false;while(!isTangible(node)&&(node.previousSibling||(!reversed&&node.nextSibling))){reversed=reversed||!node.nextSibling;node=reversed?node.previousSibling:node.nextSibling;offset=reversed?nodeSize(node):0;didMove=true;} 8949return didMove&&isTangible(node)?getDeepestPosition(node,offset):[node,offset];} 8950__exports.getCursors=getCursors;function getCursors(document){const sel=document.getSelection();if(getCursorDirection(sel.anchorNode,sel.anchorOffset,sel.focusNode,sel.focusOffset)===DIRECTIONS.LEFT) 8951return[[sel.focusNode,sel.focusOffset],[sel.anchorNode,sel.anchorOffset],];return[[sel.anchorNode,sel.anchorOffset],[sel.focusNode,sel.focusOffset],];} 8952__exports.preserveCursor=preserveCursor;function preserveCursor(document){const sel=document.getSelection();const cursorPos=[sel.anchorNode,sel.anchorOffset,sel.focusNode,sel.focusOffset];return replace=>{replace=replace||new Map();
8952cursorPos[0]=replace.get(cursorPos[0])||cursorPos[0];cursorPos[2]=replace.get(cursorPos[2])||cursorPos[2];setSelection(...cursorPos,false);};} 8953__exports.getOffsetAndCharSize=getOffsetAndCharSize;function getOffsetAndCharSize(nodeValue,offset,direction){const splittedNodeValue=[...nodeValue];let charSize=1;let newOffset=offset;let currentSize=0;for(const item of splittedNodeValue){currentSize+=item.length;if(currentSize>=offset){newOffset=direction==DIRECTIONS.LEFT?currentSize:currentSize-item.length;charSize=item.length;break;}} 8954return[newOffset,charSize];} 8955const formatsSpecs=__exports.formatsSpecs={italic:{tagName:'em',isFormatted:isItalic,isTag:(node)=>['EM','I'].includes(node.tagName),hasStyle:(node)=>Boolean(node.style&&node.style['font-style']),addStyle:(node)=>node.style['font-style']='italic',addNeutralStyle:(node)=>node.style['font-style']='normal',removeStyle:(node)=>removeStyle(node,'font-style'),},bold:{tagName:'strong',isFormatted:isBold,isTag:(node)=>['STRONG','B'].includes(node.tagName),hasStyle:(node)=>Boolean(node.style&&node.style['font-weight']),addStyle:(node)=>node.style['font-weight']='bolder',addNeutralStyle:(node)=>{node.style['font-weight']='normal'},removeStyle:(node)=>removeStyle(node,'font-weight'),},underline:{tagName:'u',isFormatted:isUnderline,isTag:(node)=>node.tagName==='U',hasStyle:(node)=>node.style&&node.style['text-decoration-line'].includes('underline'),addStyle:(node)=>node.style['text-decoration-line']+=' underline',removeStyle:(node)=>removeStyle(node,'text-decoration-line','underline'),},strikeThrough:{tagName:'s',isFormatted:isStrikeThrough,isTag:(node)=>node.tagName==='S',hasStyle:(node)=>node.style&&node.style['text-decoration-line'].includes('line-through'),addStyle:(node)=>node.style['text-decoration-line']+=' line-through',removeStyle:(node)=>removeStyle(node,'text-decoration-line','line-through'),},fontSize:{isFormatted:isFontSize,hasStyle:(node)=>node.style&&node.style['font-size'],addStyle:(node,props)=>node.style['font-size']=props.size,removeStyle:(node)=>removeStyle(node,'font-size'),},switchDirection:{isFormatted:isDirectionSwitched,}} 8956const removeStyle=(node,styleName,item)=>{if(item){const newStyle=node.style[styleName].split(' ').filter(x=>x!==item).join(' ');node.style[styleName]=newStyle||null;}else{node.style[styleName]=null;} 8957if(node.getAttribute('style')===''){node.removeAttribute('style');}};const getOrCreateSpan=(node,ancestors)=>{const span=ancestors.find((element)=>element.tagName==='SPAN'&&element.isConnected);const lastInlineAncestor=ancestors.findLast((element)=>!isBlock(element)&&element.isConnected);if(span){return span;}else{const span=document.createElement('span');if(lastInlineAncestor){lastInlineAncestor.after(span);span.append(lastInlineAncestor);}else{node.after(span);span.append(node);} 8958return span;}} 8959const removeFormat=(node,formatSpec)=>{node=closestElement(node);if(formatSpec.hasStyle(node)){formatSpec.removeStyle(node);if(['SPAN','FONT'].includes(node.tagName)&&!node.getAttributeNames().length){return unwrapContents(node);}} 8960if(formatSpec.isTag&&formatSpec.isTag(node)){const attributesNames=node.getAttributeNames().filter((name)=>{return name!=='data-oe-zws-empty-inline';});if(attributesNames.length){const newNode=document.createElement('span');while(node.firstChild){newNode.appendChild(node.firstChild);} 8961for(let index=node.attributes.length-1;index>=0;--index){newNode.attributes.setNamedItem(node.attributes[index].cloneNode());} 8962node.parentNode.replaceChild(newNode,node);}else{unwrapContents(node);}}} 8963const formatSelection=__exports.formatSelection=(editor,formatName,{applyStyle,formatProps}={})=>{const selection=editor.document.getSelection();let direction 8964let wasCollapsed;if(editor.editable.querySelector('.o_selected_td')){direction=DIRECTIONS.RIGHT;}else{if(!selection.rangeCount)return;wasCollapsed=selection.getRangeAt(0).collapsed;direction=getCursorDirection(selection.anchorNode,selection.anchorOffset,selection.focusNode,selection.focusOffset);} 8965getDeepRange(editor.editable,{splitText:true,select:true,correctTripleClick:true});if(typeof applyStyle==='undefined'){applyStyle=!isSelectionFormat(editor.editable,formatName);} 8966let zws;if(wasCollapsed){if(selection.anchorNode.nodeType===Node.TEXT_NODE&&selection.anchorNode.textContent==='\u200b'){zws=selection.anchorNode;selection.getRangeAt(0).selectNode(zws);}else{zws=insertAndSelectZws(selection);} 8967getDeepRange(editor.editable,{splitText:true,select:true,correctTripleClick:true});} 8968const selectedNodes=getSelectedNodes(editor.editable).filter(n=>((n.nodeType===Node.TEXT_NODE&&isVisibleTextNode(n))||n.nodeName==='BR')&&closestElement(n).isContentEditable);const formatSpec=formatsSpecs[formatName];for(const node of selectedNodes){const inlineAncestors=[];let currentNode=node;let parentNode=node.parentElement;while(parentNode&&!isBlock(parentNode)&&!(parentNode.classList&&parentNode.classList.length)&&!isUnbreakable(parentNode)&&!isUnbreakable(currentNode)){const isUselessZws=parentNode.tagName==='SPAN'&&parentNode.hasAttribute('data-oe-zws-empty-inline')&&parentNode.getAttributeNames().length===1;if(isUselessZws){unwrapContents(parentNode);}else{const newLastAncestorInlineFormat=splitAroundUntil(currentNode,parentNode);removeFormat(newLastAncestorInlineFormat,formatSpec);if(newLastAncestorInlineFormat.isConnected){inlineAncestors.push(newLastAncestorInlineFormat);currentNode=newLastAncestorInlineFormat;}} 8969parentNode=currentNode.parentElement;} 8970const firstBlockOrClassHasFormat=formatSpec.isFormatted(parentNode,formatProps);
8970if(firstBlockOrClassHasFormat&&!applyStyle){formatSpec.addNeutralStyle&&formatSpec.addNeutralStyle(getOrCreateSpan(node,inlineAncestors));}else if(!firstBlockOrClassHasFormat&&applyStyle){const tag=formatSpec.tagName&&document.createElement(formatSpec.tagName);if(tag){node.after(tag);tag.append(node);if(!formatSpec.isFormatted(tag,formatProps)){tag.after(node);tag.remove();formatSpec.addStyle(getOrCreateSpan(node,inlineAncestors),formatProps);}}else if(formatName!=='fontSize'||formatProps.size!==undefined){formatSpec.addStyle(getOrCreateSpan(node,inlineAncestors),formatProps);}}} 8971if(zws){const siblings=[...zws.parentElement.childNodes];if(!isBlock(zws.parentElement)&&selectedNodes.includes(siblings[0])&&selectedNodes.includes(siblings[siblings.length-1])){zws.parentElement.setAttribute('data-oe-zws-empty-inline','');}else{const span=document.createElement('span');span.setAttribute('data-oe-zws-empty-inline','');zws.before(span);span.append(zws);}} 8972if(selectedNodes.length===1&&selectedNodes[0].textContent==='\u200B'){setSelection(selectedNodes[0],0);}else if(selectedNodes.length){const firstNode=selectedNodes[0];const lastNode=selectedNodes[selectedNodes.length-1];if(direction===DIRECTIONS.RIGHT){setSelection(firstNode,0,lastNode,lastNode.length,false);}else{setSelection(lastNode,lastNode.length,firstNode,0,false);}}} 8973const isLinkEligibleForZwnbsp=__exports.isLinkEligibleForZwnbsp=(editable,link)=>{return link.parentElement.isContentEditable&&link.isContentEditable&&editable.contains(link)&&!([link,...link.querySelectorAll('*')].some(el=>el.nodeName==='IMG'||isBlock(el))||link.matches('nav a, a.nav-link'));} 8974const padLinkWithZws=__exports.padLinkWithZws=(editable,link)=>{if(!isLinkEligibleForZwnbsp(editable,link)){return;} 8975const selection=editable.ownerDocument.getSelection()||{};const{anchorOffset,focusOffset}=selection;let extraAnchorOffset=0;let extraFocusOffset=0;if(!link.textContent.startsWith('\uFEFF')){if(selection.anchorNode===link&&anchorOffset){extraAnchorOffset+=1;} 8976if(selection.focusNode===link&&focusOffset){extraFocusOffset+=1;} 8977link.prepend(document.createTextNode('\uFEFF'));} 8978if(!link.textContent.endsWith('\uFEFF')){if(selection.anchorNode===link&&anchorOffset+extraAnchorOffset===nodeSize(link)){extraAnchorOffset+=1;} 8979if(selection.focusNode===link&&focusOffset+extraFocusOffset===nodeSize(link)){extraFocusOffset+=1;} 8980link.append(document.createTextNode('\uFEFF'));} 8981const linkIndex=childNodeIndex(link);if(!(link.previousSibling&&link.previousSibling.textContent.endsWith('\uFEFF'))){if(selection.anchorNode===link.parentElement&&anchorOffset+extraAnchorOffset>linkIndex){extraAnchorOffset+=1;} 8982if(selection.focusNode===link.parentElement&&focusOffset+extraFocusOffset>linkIndex){extraFocusOffset+=1;} 8983link.before(document.createTextNode('\uFEFF'));} 8984if(!(link.nextSibling&&link.nextSibling.textContent.startsWith('\uFEFF'))){if(selection.anchorNode===link.parentElement&&anchorOffset+extraAnchorOffset>linkIndex+1){extraAnchorOffset+=1;} 8985if(selection.focusNode===link.parentElement&&focusOffset+extraFocusOffset>linkIndex+1){extraFocusOffset+=1;} 8986link.after(document.createTextNode('\uFEFF'));} 8987if(extraAnchorOffset||extraFocusOffset){setSelection(selection.anchorNode,anchorOffset+extraAnchorOffset,selection.focusNode,focusOffset+extraFocusOffset,);}} 8988const blockTagNames=['ADDRESS','ARTICLE','ASIDE','BLOCKQUOTE','DETAILS','DIALOG','DD','DIV','DL','DT','FIELDSET','FIGCAPTION','FIGURE','FOOTER','FORM','H1','H2','H3','H4','H5','H6','HEADER','HGROUP','HR','LI','MAIN','NAV','OL','P','PRE','SECTION','TABLE','UL','SELECT','OPTION','TR','TD','TBODY','THEAD','TH',];const computedStyles=new WeakMap();__exports.isBlock=isBlock;function isBlock(node){if(node.nodeType!==Node.ELEMENT_NODE){return false;} 8989const tagName=node.nodeName.toUpperCase();if(tagName.startsWith('JW-')||(tagName==='T'&&node.getAttribute('t-esc')===null&&node.getAttribute('t-out')===null&&node.getAttribute('t-raw')===null)){return true;} 8990if(tagName==='BR'){return false;} 8991if(!node.isConnected){return blockTagNames.includes(tagName);} 8992let style=computedStyles.get(node);if(!style){style=node.ownerDocument.defaultView.getComputedStyle(node);computedStyles.set(node,style);} 8993if(style.display){return!style.display.includes('inline')&&style.display!=='contents';} 8994return blockTagNames.includes(tagName);} 8995__exports.isBold=isBold;function isBold(node){const fontWeight=+getComputedStyle(closestElement(node)).fontWeight;return fontWeight>500||fontWeight>+getComputedStyle(closestBlock(node)).fontWeight;} 8996__exports.isItalic=isItalic;function isItalic(node){return getComputedStyle(closestElement(node)).fontStyle==='italic';} 8997__exports.isUnderline=isUnderline;function isUnderline(node){let parent=closestElement(node);while(parent){if(getComputedStyle(parent).textDecorationLine.includes('underline')){return true;} 8998parent=parent.parentElement;} 8999return false;} 9000__exports.isStrikeThrough=isStrikeThrough;function isStrikeThrough(node){let parent=closestElement(node);while(parent){if(getComputedStyle(parent).textDecorationLine.includes('line-through')){return true;} 9001parent=parent.parentElement;} 9002return false;} 9003__exports.isFontSize=isFontSize;function isFontSize(node,props){const element=closestElement(node);return getComputedStyle(element)['font-size']===props.size;} 9004__exports.isDirectionSwitched=isDirectionSwitched;function isDirectionSwitched(node,editable){const defaultDirection=editable.getAttribute('dir');return getComputedStyle(closestElement(node)).direction!==defaultDirection;} 9005__exports.isSelectionFormat=isSelectionFormat;function isSelectionFormat(editable,format){const selectedNodes=getTraversedNodes(editable).filter(n=>n.nodeType===Node.TEXT_NODE&&n.nodeValue.trim().length);const isFormatted=formatsSpecs[format].isFormatted;return selectedNodes.length&&selectedNodes.every(n=>isFormatted(n,editable));} 9006__exports.isUnbreakable=isUnbreakable;function isUnbreakable(node){if(!node||node.nodeType===Node.TEXT_NODE){return false;} 9007if(node.nodeType!==Node.ELEMENT_NODE){return true;} 9008return(isUnremovable(node)||['TABLE','THEAD','TBODY','TFOOT','TR','TH','TD','SECTION','DIV'].includes(node.tagName)||node.hasAttribute('t')||(node.nodeType===Node.ELEMENT_NODE&&(node.nodeName==='T'||node.getAttribute('t-if')||node.getAttribute('t-esc')||node.getAttribute('t-elif')||node.getAttribute('t-else')||node.getAttribute('t-foreach')||node.getAttribute('t-value')||node.getAttribute('t-out')||node.getAttribute('t-raw')))||node.matches(".oe_unbreakable, a.btn, a[role='tab'], a[role='button'], li.nav-item"));} 9009__exports.isUnremovable=isUnremovable;function isUnremovable(node){return((node.nodeType!==Node.COMMENT_NODE&&node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE)||node.oid==='root'||(node.nodeType===Node.ELEMENT_NODE&&(node.classList.contains('o_editable')||node.getAttribute('t-set')||node.getAttribute('t-call')))||(node.classList&&node.classList.contains('oe_unremovable'))||(node.nodeName==='SPAN'&&node.parentElement&&node.parentElement.getAttribute('data-oe-type')==='monetary')||(node.ownerDocument&&node.ownerDocument.defaultWindow&&!ancestors(node).find(ancestor=>ancestor.oid==='root')));} 9010__exports.containsUnbreakable=containsUnbreakable;function containsUnbreakable(node){if(!node){return false;} 9011return isUnbreakable(node)||containsUnbreakable(node.firstChild);} 9012const iconTags=['I','SPAN'];const iconClasses=['fa','fab','fad','far','oi'];__exports.isFontAwesome=isFontAwesome;function isFontAwesome(node){return(node&&iconTags.includes(node.nodeName)&&iconClasses.some(cls=>node.classList.contains(cls)));} 9013const ICON_SELECTOR=__exports.ICON_SELECTOR=iconTags.map(tag=>{return iconClasses.map(cls=>{return`${tag}.${cls}`;}).join(', ');}).join(', ');__exports.isZWS=isZWS;function isZWS(node){return(node&&node.textContent==='\u200B');} 9014__exports.isEditorTab=isEditorTab;function isEditorTab(node){return(node&&(node.nodeName==='SPAN')&&node.classList.contains('oe-tabs'));} 9015__exports.isMediaElement=isMediaElement;function isMediaElement(node){return(isFontAwesome(node)||(node.classList&&(node.classList.contains('o_image')||node.classList.contains('media_iframe_video'))));} 9016const VOID_ELEMENT_NAMES=['AREA','BASE','BR','COL','EMBED','HR','IMG','INPUT','KEYGEN','LINK','META','PARAM','SOURCE','TRACK','WBR'];__exports.isVoidElement=isVoidElement;function isVoidElement(node){return isArtificialVoidElement(node);} 9017__exports.isArtificialVoidElement=isArtificialVoidElement;function isArtificialVoidElement(node){return isMediaElement(node)||node.nodeName==='HR';} 9018__exports.isNotAllowedContent=isNotAllowedContent;function isNotAllowedContent(node){return isArtificialVoidElement(node)||VOID_ELEMENT_NAMES.includes(node.nodeName);} 9019__exports.containsUnremovable=containsUnremovable;function containsUnremovable(node){if(!node){return false;} 9020return isUnremovable(node)||containsUnremovable(node.firstChild);} 9021__exports.getInSelection=getInSelection;function getInSelection(document,selector){const selection=document.getSelection();const range=selection&&!!selection.rangeCount&&selection.getRangeAt(0);if(range){const selectorInStartAncestors=closestElement(range.startContainer,selector);if(selectorInStartAncestors){return selectorInStartAncestors;}else{const commonElementAncestor=closestElement(range.commonAncestorContainer);return commonElementAncestor&&[...commonElementAncestor.querySelectorAll(selector)].find(node=>range.intersectsNode(node),);}}} 9022__exports.getRowIndex=getRowIndex;function getRowIndex(trOrTd){const tr=closestElement(trOrTd,'tr');const trParent=tr&&tr.parentElement;if(!trParent){return-1;} 9023const trSiblings=[...trParent.children].filter(child=>child.nodeName==='TR');return trSiblings.findIndex(child=>child===tr);} 9024__exports.getColumnIndex=getColumnIndex;function getColumnIndex(td){const tdParent=td.parentElement;if(!tdParent){return-1;} 9025const tdSiblings=[...tdParent.children].filter(child=>child.nodeName==='TD'||child.nodeName==='TH');return tdSiblings.findIndex(child=>child===td);} 9026const paragraphRelatedElements=__exports.paragraphRelatedElements=['P','H1','H2','H3','H4','H5','H6','PRE','BLOCKQUOTE',];__exports.allowsParagraphRelatedElements=allowsParagraphRelatedElements;function allowsParagraphRelatedElements(node){return isBlock(node)&&!['P','H1','H2','H3','H4','H5','H6'].includes(node.nodeName);} 9027__exports.makeContentsInline=makeContentsInline;function makeContentsInline(node){let childIndex=0;for(const child of node.childNodes){if(isBlock(child)){if(childIndex&¶graphRelatedElements.includes(child.nodeName)){child.before(document.createElement('br'));} 9028for(const grandChild of child.childNodes){child.before(grandChild);makeContentsInline(grandChild);} 9029child.remove();} 9030childIndex+=1;}} 9031__exports.getUrlsInfosInString=getUrlsInfosInString;function getUrlsInfosInString(string){let infos=[],match;while((match=URL_REGEX_WITH_INFOS.exec(string))){infos.push({url:match[2]?match[0]:'https://'+match[0],label:match[0],index:match.index,length:match[0].length,});} 9032return infos;} 9033__exports.getOuid=getOuid;function getOuid(node,optimize=false){while(node&&!isUnbreakable(node)){if(node.ouid&&optimize)return node.ouid;node=node.parentNode;} 9034return node&&node.oid;} 9035__exports.isHtmlContentSupported=isHtmlContentSupported;
9035function isHtmlContentSupported(node){return!closestElement(node,'[data-oe-model]:not([data-oe-field="arch"]):not([data-oe-type="html"]),[data-oe-translation-id]',true);} 9036const selfClosingElementTags=['BR','IMG','INPUT'];__exports.isVisibleEmpty=isVisibleEmpty;function isVisibleEmpty(node){return selfClosingElementTags.includes(node.nodeName);} 9037__exports.isInPre=isInPre;function isInPre(node){const element=node.nodeType===Node.TEXT_NODE?node.parentElement:node;return(!!element&&(!!element.closest('pre')||getComputedStyle(element).getPropertyValue('white-space')==='pre'));} 9038const nonWhitespaces='\\S\\u00A0\\u0009\\uFEFF';const nonWhitespacesRegex=new RegExp(`[${nonWhitespaces}]`);__exports.isVisibleStr=isVisibleStr;function isVisibleStr(value){const str=typeof value==='string'?value:value.nodeValue;return nonWhitespacesRegex.test(str)&&str!=='\ufeff';} 9039__exports.isContentTextNode=isContentTextNode;function isContentTextNode(node){return node.nodeType===Node.TEXT_NODE&&(isVisible(node)||isInPre(node));} 9040__exports.isVisible=isVisible;function isVisible(node,areBlocksAlwaysVisible=true){if(!node)return false;if(node.nodeType===Node.TEXT_NODE){return isVisibleTextNode(node);} 9041if((areBlocksAlwaysVisible&&isBlock(node))||isVisibleEmpty(node)){return true;} 9042return[...node.childNodes].some(n=>isVisible(n));} 9043__exports.isButton=isButton;function isButton(node){if(!node||node.nodeType!==Node.ELEMENT_NODE){return false;} 9044return node.nodeName==="BUTTON"||node.classList.contains("btn");} 9045__exports.isVisibleTextNode=isVisibleTextNode;function isVisibleTextNode(testedNode){if(!testedNode.length){return false;} 9046if(isVisibleStr(testedNode)){return true;} 9047if(testedNode.textContent==='\ufeff'){return false;} 9048let preceding;let following;let foundTestedNode;const currentNodeParentBlock=closestBlock(testedNode);if(!currentNodeParentBlock){return false;} 9049const nodeIterator=document.createNodeIterator(currentNodeParentBlock);for(let node=nodeIterator.nextNode();node;node=nodeIterator.nextNode()){if(node.nodeType===Node.TEXT_NODE){if(foundTestedNode){following=node;break;}else if(testedNode===node){foundTestedNode=true;}else{preceding=node;}}else if(isBlock(node)){if(foundTestedNode){break;}else{preceding=null;}}} 9050while(following&&/^[\n\t ]*$/.test(following.textContent)){following=following.nextSibling;} 9051if(!(preceding&&following)||currentNodeParentBlock!==closestBlock(preceding)||currentNodeParentBlock!==closestBlock(following)){return false;} 9052return!/^[\n\t ]*$/.test(preceding.textContent);} 9053__exports.parentsGet=parentsGet;function parentsGet(node,root=undefined){const parents=[];while(node){parents.unshift(node);if(node===root){break;} 9054node=node.parentNode;} 9055return parents;} 9056__exports.commonParentGet=commonParentGet;function commonParentGet(node1,node2,root=undefined){if(!node1||!node2){return null;} 9057const n1p=parentsGet(node1,root);const n2p=parentsGet(node2,root);while(n1p.length>1&&n1p[1]===n2p[1]){n1p.shift();n2p.shift();} 9058return n1p[0]===n2p[0]?n1p[0]:null;} 9059__exports.getListMode=getListMode;function getListMode(pnode){if(!["UL","OL"].includes(pnode.tagName))return;if(pnode.tagName=='OL')return'OL';return pnode.classList.contains('o_checklist')?'CL':'UL';} 9060__exports.createList=createList;function createList(mode){const node=document.createElement(mode=='OL'?'OL':'UL');if(mode=='CL'){node.classList.add('o_checklist');} 9061return node;} 9062__exports.insertListAfter=insertListAfter;function insertListAfter(afterNode,mode,content=[]){const list=createList(mode);afterNode.after(list);list.append(...content.map(c=>{const li=document.createElement('LI');li.append(...[].concat(c));return li;}),);return list;} 9063__exports.toggleList=toggleList;function toggleList(node,mode,offset=0){let pnode=node.closest('ul, ol');if(!pnode)return;const listMode=getListMode(pnode)+mode;if(['OLCL','ULCL'].includes(listMode)){pnode.classList.add('o_checklist');for(let li=pnode.firstElementChild;li!==null;li=li.nextElementSibling){if(li.style.listStyle!=='none'){li.style.listStyle=null;if(!li.style.all)li.removeAttribute('style');}} 9064pnode=setTagName(pnode,'UL');}else if(['CLOL','CLUL'].includes(listMode)){toggleClass(pnode,'o_checklist');pnode=setTagName(pnode,mode);}else if(['OLUL','ULOL'].includes(listMode)){pnode=setTagName(pnode,mode);}else{let currNode=node;while(currNode){currNode=currNode.oShiftTab(offset);} 9065return;} 9066return pnode;} 9067__exports.convertList=convertList;function convertList(node,toMode){if(!["UL","OL","LI"].includes(node.nodeName))return;const listMode=getListMode(node);if(listMode&&toMode!==listMode){node=toggleList(node,toMode);} 9068for(const child of node.childNodes){convertList(child,toMode);} 9069return node;} 9070__exports.toggleClass=toggleClass;function toggleClass(node,className){node.classList.toggle(className);if(!node.className){node.removeAttribute('class');}} 9071__exports.makeZeroWidthCharactersVisible=makeZeroWidthCharactersVisible;function makeZeroWidthCharactersVisible(text){return text.replaceAll('\u200B','//ZWSP//').replaceAll('\uFEFF','//ZWNBSP//');} 9072__exports.isFakeLineBreak=isFakeLineBreak;function isFakeLineBreak(brEl){return!(getState(...rightPos(brEl),DIRECTIONS.RIGHT).cType&
9072(CTYPES.CONTENT|CTGROUPS.BR));} 9073__exports.isEmptyBlock=isEmptyBlock;function isEmptyBlock(blockEl){if(!blockEl||blockEl.nodeType!==Node.ELEMENT_NODE){return false;} 9074if(isVisibleStr(blockEl.textContent)){return false;} 9075if(blockEl.querySelectorAll('br').length>=2){return false;} 9076const nodes=blockEl.querySelectorAll('*');for(const node of nodes){if(node.nodeName!='BR'&&(isVisibleEmpty(node)||isFontAwesome(node))){return false;}} 9077return true;} 9078__exports.isShrunkBlock=isShrunkBlock;function isShrunkBlock(blockEl){return(isEmptyBlock(blockEl)&&!blockEl.querySelector('br')&&blockEl.nodeName!=="IMG");} 9079__exports.isColorGradient=isColorGradient;function isColorGradient(value){return value&&value.includes('-gradient(');} 9080__exports.splitTextNode=splitTextNode;function splitTextNode(textNode,offset,originalNodeSide=DIRECTIONS.RIGHT){let parentOffset=childNodeIndex(textNode);if(offset>0){parentOffset++;if(offset<textNode.length){const left=textNode.nodeValue.substring(0,offset);const right=textNode.nodeValue.substring(offset);if(originalNodeSide===DIRECTIONS.LEFT){const newTextNode=document.createTextNode(right);textNode.after(newTextNode);textNode.nodeValue=left;}else{const newTextNode=document.createTextNode(left);textNode.before(newTextNode);textNode.nodeValue=right;}}} 9081return parentOffset;} 9082__exports.splitElement=splitElement;function splitElement(element,offset){const before=element.cloneNode();const after=element.cloneNode();let index=0;for(const child of[...element.childNodes]){index<offset?before.appendChild(child):after.appendChild(child);index++;} 9083element.before(before);element.after(after);element.remove();return[before,after];} 9084__exports.splitAroundUntil=splitAroundUntil;function splitAroundUntil(elements,limitAncestor){elements=Array.isArray(elements)?elements:[elements];const firstNode=elements[0];const lastNode=elements[elements.length-1];if([firstNode,lastNode].includes(limitAncestor)){return limitAncestor;} 9085let before=firstNode.previousSibling;let after=lastNode.nextSibling;let beforeSplit,afterSplit;if(!before&&!after&&elements[0]!==limitAncestor){return splitAroundUntil(elements[0].parentElement,limitAncestor);} 9086while(after&&after.parentElement!==limitAncestor){afterSplit=splitElement(after.parentElement,childNodeIndex(after))[0];after=afterSplit.nextSibling;} 9087if(after){afterSplit=splitElement(limitAncestor,childNodeIndex(after))[0];limitAncestor=afterSplit;} 9088while(before&&before.parentElement!==limitAncestor){beforeSplit=splitElement(before.parentElement,childNodeIndex(before)+1)[1];before=beforeSplit.previousSibling;} 9089if(before){beforeSplit=splitElement(limitAncestor,childNodeIndex(before)+1)[1];} 9090return beforeSplit||afterSplit||limitAncestor;} 9091__exports.insertText=insertText;function insertText(sel,content){if(!content){return;} 9092if(sel.anchorNode.nodeType===Node.TEXT_NODE){const pos=[sel.anchorNode.parentElement,splitTextNode(sel.anchorNode,sel.anchorOffset)];setSelection(...pos,...pos,false);} 9093const txt=document.createTextNode(content||'#');const restore=prepareUpdate(sel.anchorNode,sel.anchorOffset);sel.getRangeAt(0).insertNode(txt);restore();setSelection(...boundariesOut(txt),false);return txt;} 9094__exports.insertCharsAt=insertCharsAt;function insertCharsAt(chars,node,offset){if(node.nodeType===Node.TEXT_NODE){const startValue=node.nodeValue;if(offset<0||offset>startValue.length){throw new Error(`Invalid ${chars} insertion in text node`);} 9095node.nodeValue=startValue.slice(0,offset)+chars+startValue.slice(offset);}else{if(offset<0||offset>node.childNodes.length){throw new Error(`Invalid ${chars} insertion in non-text node`);} 9096const textNode=document.createTextNode(chars);if(offset<node.childNodes.length){node.insertBefore(textNode,node.childNodes[offset]);}else{node.appendChild(textNode);}}} 9097__exports.unwrapContents=unwrapContents;function unwrapContents(node){const contents=[...node.childNodes];for(const child of contents){node.parentNode.insertBefore(child,node);} 9098node.parentNode.removeChild(node);return contents;} 9099__exports.fillEmpty=fillEmpty;function fillEmpty(el){const fillers={};const blockEl=closestBlock(el);if(isShrunkBlock(blockEl)){const br=document.createElement('br');blockEl.appendChild(br);fillers.br=br;} 9100if(!isVisible(el)&&!el.hasAttribute("data-oe-zws-empty-inline")){const zws=document.createTextNode('\u200B');el.appendChild(zws);el.setAttribute("data-oe-zws-empty-inline","");fillers.zws=zws;const previousSibling=el.previousSibling;if(previousSibling&&previousSibling.nodeName==="BR"){previousSibling.remove();} 9101setSelection(zws,0,zws,0);} 9102return fillers;} 9103__exports.insertAndSelectZws=insertAndSelectZws;function insertAndSelectZws(selection){const offset=selection.anchorOffset;const zws=insertText(selection,'\u200B');splitTextNode(zws,offset);selection.getRangeAt(0).selectNode(zws);return zws;} 9104__exports.clearEmpty=clearEmpty;function clearEmpty(node){while(!isVisible(node)){const toRemove=node;node=node.parentNode;toRemove.remove();} 9105return node;} 9106__exports.setTagName=setTagName;function setTagName(el,newTagName){if(el.tagName===newTagName){return el;} 9107const n=document.createElement(newTagName);if(el.nodeName!=='LI'){const attributes=el.attributes;for(const attr of attributes){n.setAttribute(attr.name,attr.value);}} 9108while(el.firstChild){n.append(el.firstChild);} 9109if(el.tagName==='LI'){el.append(n);}else{el.parentNode.replaceChild(n,el);} 9110return n;} 9111__exports.moveNodes=moveNodes;function moveNodes(destinationEl,destinationOffset,sourceEl,startIndex=0,endIndex=sourceEl.childNodes.length,){if(selfClosingElementTags.includes(destinationEl.nodeName)){throw new Error(`moveNodes: Invalid destination element ${destinationEl.nodeName}`);} 9112const nodes=[];for(let i=startIndex;i<endIndex;i++){nodes.push(sourceEl.childNodes[i]);} 9113if(nodes.length){const restoreDestination=prepareUpdate(destinationEl,destinationOffset);const restoreMoved=prepareUpdate(...leftPos(sourceEl.childNodes[startIndex]),...rightPos(sourceEl.childNodes[endIndex-1]),);const fragment=document.createDocumentFragment();
9113nodes.forEach(node=>fragment.appendChild(node));const posRightNode=destinationEl.childNodes[destinationOffset];if(posRightNode){destinationEl.insertBefore(fragment,posRightNode);}else{destinationEl.appendChild(fragment);} 9114restoreDestination();restoreMoved();} 9115if(!nodeSize(sourceEl)){const restoreOrigin=prepareUpdate(...boundariesOut(sourceEl));sourceEl.remove();restoreOrigin();} 9116const firstNode=nodes.find(node=>!!node.parentNode);return firstNode?leftPos(firstNode):[destinationEl,destinationOffset];} 9117const prepareUpdateLockedEditables=new Set();__exports.prepareUpdate=prepareUpdate;function prepareUpdate(...args){const closestRoot=args.length&&ancestors(args[0]).find(ancestor=>ancestor.oid==='root');const isPrepareUpdateLocked=closestRoot&&prepareUpdateLockedEditables.has(closestRoot);const hash=(Math.random()+1).toString(36).substring(7);const options={allowReenter:true,label:hash,debug:false,...(args.length&&args[args.length-1]instanceof Object?args.pop():{}),};if(options.debug){console.log('%cPreparing%c update: '+options.label+ 9118(options.label===hash?'':` (${hash})`)+'%c'+(isPrepareUpdateLocked?' LOCKED':''),'color: cyan;','color: white;','color: red; font-weight: bold;',);} 9119if(isPrepareUpdateLocked){return()=>{if(options.debug){console.log('%cRestoring%c update: '+options.label+ 9120(options.label===hash?'':` (${hash})`)+'%c LOCKED','color: lightgreen;','color: white;','color: red; font-weight: bold;',);}};} 9121if(!options.allowReenter&&closestRoot){prepareUpdateLockedEditables.add(close
9121stRoot);} 9122const positions=[...args];const restoreData=[];let el,offset;while(positions.length){offset=positions.pop();el=positions.pop();const left=getState(el,offset,DIRECTIONS.LEFT);const right=getState(el,offset,DIRECTIONS.RIGHT,left.cType);if(options.debug){const editable=el&&closestElement(el,'.odoo-editor-editable');const oldEditableHTML=editable&&makeZeroWidthCharactersVisible(editable.innerHTML).replaceAll(' ','_')||'';left.oldEditableHTML=oldEditableHTML;right.oldEditableHTML=oldEditableHTML;} 9123restoreData.push(left,right);} 9124return function restoreStates(){if(options.debug){console.log('%cRestoring%c update: '+options.label+ 9125(options.label===hash?'':` (${hash})`),'color: lightgreen;','color: white;',);} 9126for(const data of restoreData){restoreState(data,options.debug);} 9127if(!options.allowReenter&&closestRoot){prepareUpdateLockedEditables.delete(closestRoot);}};} 9128__exports.getState=getState;function getState(el,offset,direction,leftCType){const leftDOMPath=leftLeafOnlyNotBlockPath;const rightDOMPath=rightLeafOnlyNotBlockPath;let domPath;let inverseDOMPath;let expr;const reasons=[];if(direction===DIRECTIONS.LEFT){domPath=leftDOMPath(el,offset,reasons);inverseDOMPath=rightDOMPath(el,offset);expr=new RegExp(`[^${nonWhitespaces}]$`);}else{domPath=rightDOMPath(el,offset,reasons);inverseDOMPath=leftDOMPath(el,offset);expr=new RegExp(`^[^${nonWhitespaces}]`);} 9129const boundaryNode=inverseDOMPath.next().value;let cType=undefined;let lastSpace=null;for(const node of domPath){if(node.nodeType===Node.TEXT_NODE){const value=node.nodeValue;if(direction===DIRECTIONS.LEFT){if(isVisibleStr(value)){if(lastSpace){cType=CTYPES.SPACE;}else{const rightLeaf=rightLeafOnlyNotBlockPath(node).next().value;const hasContentRight=rightLeaf&&!rightLeaf.textContent.startsWith(' ');cType=!hasContentRight&&node.textContent.endsWith(' ')?CTYPES.SPACE:CTYPES.CONTENT;} 9130break;} 9131if(value.length){lastSpace=node;}}else{leftCType=leftCType||getState(el,offset,DIRECTIONS.LEFT).cType;if(expr.test(value)){const leftLeaf=leftLeafOnlyNotBlockPath(node).next().value;const hasContentLeft=leftLeaf&&!leftLeaf.textContent.endsWith(' ');const rct=isVisibleStr(value)?CTYPES.CONTENT:getState(...rightPos(node),DIRECTIONS.RIGHT).cType;cType=leftCType&CTYPES.CONTENT&&rct&(CTYPES.CONTENT|CTYPES.BR)&&!hasContentLeft?CTYPES.SPACE:rct;break;} 9132if(isVisibleStr(value)){cType=CTYPES.CONTENT;break;}}}else if(node.nodeName==='BR'){cType=CTYPES.BR;break;}else if(isVisible(node)){cType=CTYPES.CONTENT;break;}} 9133if(cType===undefined){cType=reasons.includes(PATH_END_REASONS.BLOCK_HIT)?CTYPES.BLOCK_OUTSIDE:CTYPES.BLOCK_INSIDE;} 9134return{node:boundaryNode,direction:direction,cType:cType,};} 9135const priorityRestoreStateRules=[[{cType1:CTYPES.CONTENT,cType2:CTYPES.SPACE|CTGROUPS.BLOCK},{spaceVisibility:true},],[{direction:DIRECTIONS.LEFT,cType1:CTGROUPS.INLINE,cType2:CTGROUPS.BR},{spaceVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.CONTENT,cType2:CTGROUPS.BR},{spaceVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.BR,cType2:CTYPES.SPACE|CTGROUPS.BLOCK},{spaceVisibility:true},],[{cType1:CTYPES.SPACE},{spaceVisibility:false},],[{direction:DIRECTIONS.LEFT,cType1:CTGROUPS.BR},{spaceVisibility:false},],[{cType1:CTGROUPS.BLOCK,cType2:CTGROUPS.INLINE|CTGROUPS.BR},{spaceVisibility:false},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.INLINE,cType2:CTGROUPS.BLOCK},{brVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.BLOCK,cType2:CTGROUPS.INLINE|CTGROUPS.BR,},{brVisibility:false},],[{direction:DIRECTIONS.LEFT,cType1:CTGROUPS.BR|CTGROUPS.BLOCK,cType2:CTGROUPS.INLINE,},{brVisibility:false,extraBRRemovalCondition:brNode=>isFakeLineBreak(brNode)},],];function restoreStateRuleHashCode(direction,cType1,cType2){return`${direction}-${cType1}-${cType2}`;} 9136const allRestoreStateRules=(function(){const map=new Map();const keys=['direction','cType1','cType2'];for(const direction of Object.values(DIRECTIONS)){for(const cType1 of Object.values(CTYPES)){for(const cType2 of Object.values(CTYPES)){const rule={direction:direction,cType1:cType1,cType2:cType2};const matchedRules=[];for(const entry of priorityRestoreStateRules){let priority=0;for(const key of keys){const entryKeyValue=entry[0][key];if(entryKeyValue!==undefined){if(typeof entryKeyValue==='boolean'?rule[key]===entryKeyValue:rule[key]&entryKeyValue){priority++;}else{priority=-1;break;}}} 9137if(priority>=0){matchedRules.push([priority,entry[1]]);}} 9138const finalRule={};for(let p=0;p<=keys.length;p++){for(const entry of matchedRules){if(entry[0]===p){Object.assign(finalRule,entry[1]);}}} 9139const hashCode=restoreStateRuleHashCode(direction,cType1,cType2);map.set(hashCode,finalRule);}}} 9140return map;})();__exports.restoreState=restoreState;function restoreState(prevStateData,debug=false){const{node,direction,cType:cType1,oldEditableHTML}=prevStateData;if(!node||!node.parentNode){return;} 9141const[el,offset]=direction===DIRECTIONS.LEFT?leftPos(node):rightPos(node);const{cType:cType2}=getState(el,offset,direction);const ruleHashCode=restoreStateRuleHashCode(direction,cType1,cType2);const rule=allRestoreStateRules.get(ruleHashCode);if(debug){const editable=closestElement(node,'.odoo-editor-editable');console.log('%c'+makeZeroWidthCharactersVisible(node.textContent).replaceAll(' ','_')+'\n'+'%c'+(direction===DIRECTIONS.LEFT?'left':'right')+'\n'+'%c'+ctypeToString(cType1)+'\n'+'%c'+ctypeToString(cType2)+'\n'+'%c'+'BEFORE: '+(oldEditableHTML||'(unavailable)')+'\n'+'%c'+'AFTER: '+(editable?makeZeroWidthCharactersVisible(editable.innerHTML).replaceAll(' ','_'):'(unavailable)')+'\n','color: white; display: block; width: 100%;','color: '+(direction===DIRECTIONS.LEFT?'magenta':'lightgreen')+'; display: block; width: 100%;','color: pink; display: block; width: 100%;','color: lightblue; display: block; width: 100%;','color: white; display: block; width: 100%;','color: white; display: block; width: 100%;',rule,);} 9142if(Object.values(rule).filter(x=>x!==undefined).length){const inverseDirection=direction===DIRECTIONS.LEFT?DIRECTIONS.RIGHT:DIRECTIONS.LEFT;enforceWhitespace(el,offset,inverseDirection,rule);} 9143return rule;} 9144__exports.enforceWhitespace=enforceWhitespace;function enforceWhitespace(el,offset,direction,rule){let domPath;let expr;if(direction===DIRECTIONS.LEFT){domPath=leftLeafOnlyNotBlockPath(el,offset);
9144expr=new RegExp(`[^${nonWhitespaces}]+$`);}else{domPath=rightLeafOnlyNotBlockPath(el,offset);expr=new RegExp(`^[^${nonWhitespaces}]+`);} 9145const invisibleSpaceTextNodes=[];let foundVisibleSpaceTextNode=null;for(const node of domPath){if(node.nodeName==='BR'){if(rule.brVisibility===undefined){break;} 9146if(rule.brVisibility){node.before(document.createElement('br'));}else{if(!rule.extraBRRemovalCondition||rule.extraBRRemovalCondition(node)){node.remove();}} 9147break;}else if(node.nodeType===Node.TEXT_NODE&&!isInPre(node)){if(expr.test(node.nodeValue)){if(isVisibleStr(node)){foundVisibleSpaceTextNode=node;break;}else{invisibleSpaceTextNodes.push(node);}}else if(isVisibleStr(node)){break;}}else{break;}} 9148if(rule.spaceVisibility===undefined){return;} 9149if(!rule.spaceVisibility){for(const node of invisibleSpaceTextNodes){node.nodeValue='';const ancestorPath=closestPath(node.parentNode);let toRemove=null;for(const pNode of ancestorPath){if(toRemove){toRemove.remove();} 9150if(pNode.childNodes.length===1&&!isBlock(pNode)){pNode.after(node);toRemove=pNode;}else{break;}}}} 9151const spaceNode=foundVisibleSpaceTextNode||invisibleSpaceTextNodes[0];if(spaceNode){let spaceVisibility=rule.spaceVisibility;if(spaceVisibility&&!foundVisibleSpaceTextNode&&getState(...rightPos(spaceNode),DIRECTIONS.RIGHT).cType&CTGROUPS.BLOCK&&getState(...leftPos(spaceNode),DIRECTIONS.LEFT).cType!==CTYPES.CONTENT){spaceVisibility=false;} 9152spaceNode.nodeValue=spaceNode.nodeValue.replace(expr,spaceVisibility?'\u00A0':'');}} 9153__exports.rgbToHex=rgbToHex;function rgbToHex(rgb='',node=null){if(rgb.startsWith('#')){return rgb;}else if(rgb.startsWith('rgba')){const values=rgb.match(/[\d\.]{1,5}/g)||[];const alpha=parseFloat(values.pop());let bgRgbValues=[];if(node){let bgColor=getComputedStyle(node).backgroundColor;if(bgColor.startsWith('rgba')){bgColor=rgbToHex(bgColor,node.parentElement);} 9154if(bgColor&&bgColor.startsWith('#')){bgRgbValues=(bgColor.match(/[\da-f]{2}/gi)||[]).map(val=>parseInt(val,16));}else if(bgColor&&bgColor.startsWith('rgb')){bgRgbValues=(bgColor.match(/[\d\.]{1,5}/g)||[]).map(val=>parseInt(val));}} 9155bgRgbValues=bgRgbValues.length?bgRgbValues:[255,255,255];return('#'+ 9156values.map((value,index)=>{const converted=Math.floor(alpha*parseInt(value)+(1-alpha)*bgRgbValues[index]);const hex=parseInt(converted).toString(16);return hex.length===1?'0'+hex:hex;}).join(''));}else{return('#'+ 9157(rgb.match(/\d{1,3}/g)||[]).map(x=>{x=parseInt(x).toString(16);return x.length===1?'0'+x:x;}).join(''));}} 9158__exports.parseHTML=parseHTML;function parseHTML(html){const fragment=document.createDocumentFragment();const parser=new DOMParser();const parsedDocument=parser.parseFromString(html,'text/html');fragment.replaceChildren(...parsedDocument.body.childNodes);return fragment;} 9159__exports.pxToFloat=pxToFloat;function pxToFloat(sizeString){return parseFloat(sizeString.replace('px',''));} 9160__exports.getRangePosition=getRangePosition;function getRangePosition(el,document,options={}){const selection=document.getSelection();if(!selection.rangeCount)return;const range=selection.getRangeAt(0);const isRtl=options.direction==='rtl';const marginRight=options.marginRight||20;const marginBottom=options.marginBottom||20;const marginTop=options.marginTop||10;const marginLeft=options.marginLeft||10;let offset;if(range.endOffset-1>0){const clonedRange=range.cloneRange();clonedRange.setStart(range.endContainer,range.endOffset-1);clonedRange.setEnd(range.endContainer,range.endOffset);const rect=clonedRange.getBoundingClientRect();offset={height:rect.height,left:rect.left+rect.width,top:rect.top};clonedRange.detach();} 9161if(!offset||offset.height===0){const clonedRange=range.cloneRange();const shadowCaret=document.createTextNode('|');clonedRange.insertNode(shadowCaret);clonedRange.selectNode(shadowCaret);const rect=clonedRange.getBoundingClientRect();offset={height:rect.height,left:rect.left,top:rect.top};shadowCaret.remove();clonedRange.detach();} 9162if(isRtl){offset.right=offset.left-el.offsetWidth;const leftMove=Math.max(0,offset.right+el.offsetWidth+marginLeft-window.innerWidth);if(leftMove&&offset.right-leftMove>marginRight){offset.right-=leftMove;}else if(offset.right-leftMove<marginRight){offset.right=marginRight;}} 9163const leftMove=Math.max(0,offset.left+el.offsetWidth+marginRight-window.innerWidth);if(leftMove&&offset.left-leftMove>marginLeft){offset.left-=leftMove;}else if(offset.left-leftMove<marginLeft){offset.left=marginLeft;} 9164if(options.getContextFromParentRect){const parentContextRect=options.getContextFromParentRect();offset.left+=parentContextRect.left;offset.top+=parentContextRect.top;if(isRtl){offset.right+=parentContextRect.left;}} 9165if(offset.top-marginTop+offset.height+el.offsetHeight>window.innerHeight&&offset.top-el.offsetHeight-marginBottom>0){offset.top-=el.offsetHeight;}else{offset.top+=offset.height;} 9166if(offset){offset.top+=window.scrollY;offset.left+=window.scrollX;if(isRtl){offset.right+=window.scrollX;}} 9167if(isRtl){offset.right=window.innerWidth-offset.right-el.offsetWidth;} 9168return offset;} 9169const isNotEditableNode=__exports.isNotEditableNode=node=>node.getAttribute&&node.getAttribute('contenteditable')&&node.getAttribute('contenteditable').toLowerCase()==='false';const isRoot=__exports.isRoot=node=>node.oid==="root";const leftLeafFirstPath=__exports.leftLeafFirstPath=createDOMPathGenerator(DIRECTIONS.LEFT);const leftLeafOnlyNotBlockPath=__exports.leftLeafOnlyNotBlockPath=createDOMPathGenerator(DIRECTIONS.LEFT,{leafOnly:true,stopTraverseFunction:isBlock,stopFunction:node=>isBlock(node)||isRoot(node),});const leftLeafOnlyInScopeNotBlockEditablePath=__exports.leftLeafOnlyInScopeNotBlockEditablePath=createDOMPathGenerator(DIRECTIONS.LEFT,{leafOnly:true,inScope:true,stopTraverseFunction:node=>isNotEditableNode(node)||isBlock(node),stopFunction:node=>isNotEditableNode(node)||isBlock(node)||isRoot(node),});const rightLeafOnlyNotBlockPath=__exports.rightLeafOnlyNotBlockPath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,stopTraverseFunction:isBlock,stopFunction:node=>isBlock(node)||isRoot(node),});const rightLeafOnlyPathNotBlockNotEditablePath=__exports.rightLeafOnlyPathNotBlockNotEditablePath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,stopFunction:node=>isRoot(node),});const rightLeafOnlyInScopeNotBlockEditablePath=__exports.rightLeafOnlyInScopeNotBlockEditablePath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,inScope:true,stopTraverseFunction:node=>isNotEditableNode(node)||isBlock(node),stopFunction:node=>isNotEditableNode(node)||isBlock(node)||isRoot(node),});const rightLeafOnlyNotBlockNotEditablePath=__exports.rightLeafOnlyNotBlockNotEditablePath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,stopTraverseFunction:node=>isNotEditableNode(node)||isBlock(node),stopFunction:node=>isBlock(node)&&!isNotEditableNode(node)||isRoot(node),});__exports.peek=peek;function peek(arr){return arr[arr.length-1];} 9170__exports.isMacOS=isMacOS;function isMacOS(){return window.navigator.userAgent.includes('Mac');} 9171__exports.cleanZWS=cleanZWS;function cleanZWS(node){[node,...descendants(node)].filter(node=>
9171node.nodeType===Node.TEXT_NODE).forEach(node=>node.nodeValue=node.nodeValue.replace(/\u200B/g,''));} 9172return __exports;});; 9173 9174/* /web_editor/static/src/js/wysiwyg/fonts.js */ 9175odoo.define('wysiwyg.fonts',function(require){'use strict';return{cacheCssSelectors:{},getCssSelectors:function(filter){if(this.cacheCssSelectors[filter]){return this.cacheCssSelectors[filter];} 9176this.cacheCssSelectors[filter]=[];var sheets=document.styleSheets;for(var i=0;i<sheets.length;i++){var rules;try{rules=sheets[i].rules||sheets[i].cssRules;}catch(_e){continue;} 9177if(!rules){continue;} 9178for(var r=0;r<rules.length;r++){var selectorText=rules[r].selectorText;if(!selectorText){continue;} 9179var selectors=selectorText.split(/\s*,\s*/);var data=null;for(var s=0;s<selectors.length;s++){var match=selectors[s].trim().match(filter);if(!match){continue;} 9180if(!data){data={selector:match[0],css:rules[r].cssText.replace(/(^.*\{\s*)|(\s*\}\s*$)/g,''),names:[match[1]]};}else{data.selector+=(', '+match[0]);data.names.push(match[1]);}} 9181if(data){this.cacheCssSelectors[filter].push(data);}}} 9182return this.cacheCssSelectors[filter];},fontIcons:[{base:'fa',parser:/\.(fa-(?:\w|-)+)::?before/i}],computeFonts:_.once(function(){var self=this;_.each(this.fontIcons,function(data){data.cssData=self.getCssSelectors(data.parser);data.alias=_.flatten(_.map(data.cssData,_.property('names')));});}),};});; 9183 9184/* /web_editor/static/src/js/wysiwyg/dialog.js */ 9185odoo.define('wysiwyg.widgets.Dialog',function(require){'use strict';var config=require('web.config');var core=require('web.core');var Dialog=require('web.Dialog');var _t=core._t;var WysiwygDialog=Dialog.extend({init:function(parent,options){this.options=options||{};if(config.device.isMobile){options.fullscreen=true;} 9186this._super(parent,_.extend({},{buttons:[{text:this.options.save_text||_t("Save"),classes:'btn-primary',click:this.save,},{text:_t("Discard"),close:true,}]},this.options));this.destroyAction='cancel';this.closeOnSave=true;var self=this;this.opened(function(){const selector=options.focusField?`input[name=${options.focusField}]`:'input:visible:first';self.$(selector).focus();self.$el.closest('.modal').addClass('o_web_editor_dialog');self.$el.closest('.modal').on('hidden.bs.modal',self.options.onClose);});this.on('closed',this,function(){self._toggleFullScreen();if(this.destroyAction){this.trigger(this.destroyAction,this.final_data||null);}});},_toggleFullScreen:function(){if(config.device.isMobile&&!this.hasFullScreen){$('#iframe_target[isMobile="true"] #web_editor-top-edit .o_fullscreen').click();}},save:function(){if(this.closeOnSave){this.destroyAction="save";this.close();}else{this.destroyAction=null;this.trigger('save',this.final_data||null);}},open:function(){this.hasFullScreen=$(window.top.document.body).hasClass('o_field_widgetTextHtml_fullscreen');this._toggleFullScreen();return this._super.apply(this,arguments);},});return WysiwygDialog;});; 9187 9188/* /web_editor/static/src/js/frontend/loader.js */ 9189odoo.define('web_editor.loader',function(require){'use strict';const{getBundle,loadBundle}=require('@web/core/assets');const exports={};async function loadWysiwyg(additionnalAssets=[]){const xmlids=['web_editor.assets_wysiwyg',...additionnalAssets];for(const xmlid of xmlids){const assets=await getBundle(xmlid);await loadBundle(assets);}} 9190exports.loadWysiwyg=loadWysiwyg;exports.createWysiwyg=async(parent,options={})=>{const Wysiwyg=await getWysiwygClass(options);return new Wysiwyg(parent,options.wysiwygOptions);};async function getWysiwygClass({moduleName='web_editor.wysiwyg',additionnalAssets=[]}={}){if(!(await odoo.ready(moduleName))){await loadWysiwyg(additionnalAssets);await odoo.ready(moduleName);} 9191return odoo.__DEBUG__.services[moduleName];} 9192exports.getWysiwygClass=getWysiwygClass;exports.loadFromTextarea=async(parent,textarea,options)=>{var loading=textarea.nextElementSibling;if(loading&&!loading.classList.contains('o_wysiwyg_loading')){loading=null;} 9193const $textarea=$(textarea);const currentOptions=Object.assign({},options);currentOptions.value=currentOptions.value||$textarea.val()||'';if(!currentOptions.value.trim()){currentOptions.value='<p><br></p>';} 9194const Wysiwyg=await getWysiwygClass();const wysiwyg=new Wysiwyg(parent,currentOptions);const $wysiwygWrapper=$textarea.closest('.o_wysiwyg_textarea_wrapper');const $form=$textarea.closest('form');$textarea.hide();$form.append($textarea);$wysiwygWrapper.html('');await wysiwyg.appendTo($wysiwygWrapper);$form.find('.note-editable').data('wysiwyg',wysiwyg);$form.find('.note-editable').find('img.o_we_selected_image').removeClass('o_we_selected_image');$form.on('click','button[type=submit]',(e)=>{$form.find('.note-editable').find('img.o_we_selected_image').removeClass('o_we_selected_image');$form.find('.note-editable').find('img.float-start').removeClass('float-start');$textarea.val(wysiwyg.getValue());});return wysiwyg;};return exports;});; 9195 9196/* /auth_signup/static/src/js/reset_password.js */ 9197odoo.define("auth_signup.reset_password",function(require){"use strict";var publicWidget=require("web.public.widget");publicWidget.registry.ResetPasswordForm=publicWidget.Widget.extend({selector:".oe_reset_password_form",events:{submit:"_onSubmit",},_onSubmit:function(){var $btn=this.$('.oe_login_buttons > button[type="submit"]');if($btn.prop("disabled")){return;} 9198$btn.attr("disabled","disabled");$btn.prepend('<i class="fa fa-refresh fa-spin"/> ');},});});; 9199 9200/* /auth_signup/static/src/js/signup.js */ 9201odoo.define('auth_signup.signup',function(require){'use strict';var publicWidget=require('web.public.widget');publicWidget.registry.SignUpForm=publicWidget.Widget.extend({selector:'.oe_signup_form',events:{'submit':'_onSubmit',},_onSubmit:function(){var $btn=this.$('.oe_login_buttons > button[type="submit"]');if($btn.prop("disabled")){return;} 9202$btn.attr('disabled','disabled');$btn.prepend('<i class="fa fa-refresh fa-spin"/> ');},});});; 9203 9204/* /portal/static/src/js/portal.js */ 9205odoo.define('portal.portal',function(require){'use strict';var publicWidget=require('web.public.widget');const Dialog=require('web.Dialog');const{_t,qweb}=require('web.core');const session=require('web.session');publicWidget.registry.portalDetails=publicWidget.Widget.extend({selector:'.o_portal_details',events:{'change select[name="country_id"]':'_onCountryChange',},start:function(){var def=this._super.apply(this,arguments);this.$state=this.$('select[name="state_id"]');this.$stateOptions=this.$state.filter(':enabled').find('option:not(:first)');this._adaptAddressForm();return def;},_adaptAddressForm:function(){var $country=this.$('select[name="country_id"]');var countryID=($country.val()||0);this.$stateOptions.detach();var $displayedState=this.$stateOptions.filter('[data-country_id='+countryID+']');var nb=$displayedState.appendTo(this.$state).show().length;this.$state.parent().toggle(nb>=1);},_onCountryChange:function(){this._adaptAddressForm();},});publicWidget.registry.PortalHomeCounters=publicWidget.Widget.extend({selector:'.o_portal_my_home',start:function(){var def=this._super.apply(this,arguments);this._updateCounters();return def;},_getCountersAlwaysDisplayed(){return[];},async _updateCounters(elem){const numberRpc=3;const needed=Object.values(this.el.querySelectorAll('[data-placeholder_count]')).map(documentsCounterEl=>documentsCounterEl.dataset['placeholder_count']);const counterByRpc=Math.ceil(needed.length/numberRpc);const countersAlwaysDisplayed=this._getCountersAlwaysDisplayed();const proms=[...Array(Math.min(numberRpc,needed.length)).keys()].map(async i=>{const documentsCountersData=await this._rpc({route:"/my/counters",params:{counters:needed.slice(i*counterByRpc,
9205(i+1)*counterByRpc)},});Object.keys(documentsCountersData).forEach(counterName=>{const documentsCounterEl=this.el.querySelector(`[data-placeholder_count='${counterName}']`);documentsCounterEl.textContent=documentsCountersData[counterName];if(documentsCountersData[counterName]!==0||countersAlwaysDisplayed.includes(counterName)){documentsCounterEl.parentElement.classList.remove('d-none');}});return documentsCountersData;});return Promise.all(proms).then((results)=>{const counters=results.reduce((prev,current)=>Object.assign({...prev,...current}),{});this.el.querySelector('.o_portal_doc_spinner').remove();if(!countersAlwaysDisplayed.length&&!Object.values(counters).filter((val)=>val>0).length){this.el.querySelector('.o_portal_no_doc_message').classList.remove('d-none');}});},});publicWidget.registry.portalSearchPanel=publicWidget.Widget.extend({selector:'.o_portal_search_panel',events:{'click .dropdown-item':'_onDropdownItemClick','submit':'_onSubmit',},start:function(){var def=this._super.apply(this,arguments);this._adaptSearchLabel(this.$('.dropdown-item.active'));return def;},_adaptSearchLabel:function(elem){var $label=$(elem).clone();$label.find('span.nolabel').remove();this.$('input[name="search"]').attr('placeholder',$label.text().trim());},_search:function(){var search=$.deparam(window.location.search.substring(1));const item=this.$('.dropdown-item.active').attr('href');search['search_in']=item&&item.replace('#','')||'';search['search']=this.$('input[name="search"]').val();window.location.search=$.param(search);},_onDropdownItemClick:function(ev){ev.preventDefault();var $item=$(ev.currentTarget);$item.closest('.dropdown-menu').find('.dropdown-item').removeClass('active');$item.addClass('active');this._adaptSearchLabel(ev.currentTarget);},_onSubmit:function(ev){ev.preventDefault();this._search();},});publicWidget.registry.NewAPIKeyButton=publicWidget.Widget.extend({selector:'.o_portal_new_api_key',events:{click:'_onClick'},async _onClick(e){e.preventDefault();await handleCheckIdentity(this.proxy('_rpc'),this._rpc({model:'res.users',method:'api_key_wizard',args:[session.user_id],}));const self=this;const d_description=new Dialog(self,{title:_t('New API Key'),$content:qweb.render('portal.keydescription'),buttons:[{text:_t('Confirm'),classes:'btn-primary',close:true,click:async()=>{var description=d_description.el.querySelector('[name="description"]').value;var wizard_id=await this._rpc({model:'res.users.apikeys.description',method:'create',args:[{name:description}],});var res=await handleCheckIdentity(this.proxy('_rpc'),this._rpc({model:'res.users.apikeys.description',method:'make_key',args:[wizard_id],}));const d_show=new Dialog(self,{title:_t('API Key Ready'),$content:qweb.render('portal.keyshow',{key:res.context.default_key}),buttons:[{text:_t('Close'),clases:'btn-primary',close:true}],});d_show.on('closed',this,()=>{window.location=window.location;});d_show.open();}},{text:_t('Discard'),close:true}],});d_description.opened(()=>{const input=d_description.el.querySelector('[name="description"]');input.focus();d_description.el.addEventListener('submit',(e)=>{e.preventDefault();d_description.$footer.find('.btn-primary').click();});});d_description.open();}});publicWidget.registry.RemoveAPIKeyButton=publicWidget.Widget.extend({selector:'.o_portal_remove_api_key',events:{click:'_onClick'},async _onClick(e){e.preventDefault();await handleCheckIdentity(this.proxy('_rpc'),this._rpc({model:'res.users.apikeys',method:'remove',args:[parseInt(this.target.id)]}));window.location=window.location;}});publicWidget.registry.portalSecurity=publicWidget.Widget.extend({selector:'.o_portal_security_body',init:function(){$('.modal.show#portal_deactivate_account_modal').removeClass('d-block').modal('show');$('.modal#portal_deactivate_account_modal').on('hide.bs.modal',(event)=>{const $target=$(event.currentTarget);$target.find('.alert').remove();$target.find('.invalid-feedback').remove();$target.find('.is-invalid').removeClass('is-invalid');});return this._super(...arguments);},});function handleCheckIdentity(rpc,wrapped){return wrapped.then((r)=>{if(!_.isMatch(r,{type:'ir.actions.act_window',res_model:'res.users.identitycheck'})){return r;} 9206const check_id=r.res_id;return new Promise((resolve,reject)=>{const d=new Dialog(null,{title:_t("Security Control"),$content:qweb.render('portal.identitycheck'),buttons:[{text:_t("Confirm Password"),classes:'btn btn-primary',click(){const password_input=this.el.querySelector('[name=password]');if(!password_input.reportValidity()){password_input.classList.add('is-invalid');return;} 9207return rpc({model:'res.users.identitycheck',method:'write',args:[check_id,{password:password_input.value}]}).then(()=>rpc({model:'res.users.identitycheck',method:'run_check',args:[check_id]})).then((r)=>{this.close();resolve(r);},(err)=>{err.event.preventDefault();password_input.classList.add('is-invalid');password_input.setCustomValidity(_t("Check failed"));password_input.reportValidity();});}},{text:_t('Cancel'),close:true}]}).on('close',null,()=>{reject();});d.opened(()=>{const pw=d.el.querySelector('[name="password"]');pw.focus();pw.addEventListener('input',()=>{pw.classList.remove('is-invalid');pw.setCustomValidity('');});d.el.addEventListener('submit',(e)=>{e.preventDefault();d.$footer.find('.btn-primary').click();});});d.open();});});} 9208return{handleCheckIdentity,}});; 9209 9210/* /portal/static/src/js/portal_chatter.js */ 9211odoo.define('portal.chatter',function(require){'use strict';var core=require('web.core');const dom=require('web.dom');var publicWidget=require('web.public.widget');var time=require('web.time');var portalComposer=require('portal.composer');const{Markup}=require('web.utils');var qweb=core.qweb;var _t=core._t;var PortalChatter=publicWidget.Widget.extend({template:'portal.Chatter',events:{'click .o_portal_chatter_pager_btn':'_onClickPager','click .o_portal_chatter_js_is_internal':'async _onClickUpdateIsInternal',},init:function(parent,options){this.options={};this._super.apply(this,arguments);this._setOptions(options);this.set('messages',[]);this.set('message_count',this.options['message_count']);this.set('pager',{});this.set('domain',this.options['domain']);this._currentPage=this.options['pager_start'];},willStart:function(){return Promise.all([this._super.apply(this,arguments),this._chatterInit()]);},start:function(){this.on("change:messages",this,this._renderMessages);this.on("change:message_count",this,function(){this._renderMessageCount();this.set('pager',this._pager(this._currentPage));});this.on("change:pager",this,this._renderPager);this.on("change:domain",this,this._onChangeDomain);this.set('message_count',this.options['message_count']);this.set('messages',this.preprocessMessages(this.result['messages']));core.bus.on('reload_chatter_content',this,this._reloadChatterContent);return Promise.all([this._super.apply(this,arguments),this._reloadComposer()]);},messageFetch:function(domain){var self=this;return this._rpc({route:'/mail/chatter_fetch',params:self._messageFetchPrepareParams(),}).then(function(result){self.set('messages',self.preprocessMessages(result['messages']));self.set('message_count',result['message_count']);return result;});},preprocessMessages(messages){const token=this.options['token'];const hash=this.options['hash'];const pid=this.options['pid'];_.each(messages,function(m){if(token){m['author_avatar_url']=_.str.sprintf('/mail/avatar/mail.message/%s/author_avatar/50x50?access_token=%s',m.id,token);}else if(hash&&pid){m['author_avatar_url']=_.str.sprintf('/mail/avatar/mail.message/%s/author_avatar/50x50?_hash=%s&pid=%s',m.id,hash,pid);}else{m['author_avatar_url']=_.str.sprintf('/web/image/mail.message/%s/author_avatar/50x50',m.id);} 9212m['published_date_str']=_.str.sprintf(_t('Published on %s'),moment(time.str_to_datetime(m.date)).format('MMMM Do YYYY, h:mm:ss a'));m['body']=Markup(m.body);});return messages;},_setOptions:function(options){const defaultOptions=Object.assign({'allow_composer':true,'display_composer':false,'csrf_token':odoo.csrf_token,'message_count':0,'pager_step':10,'pager_scope':5,'pager_start':1,'is_user_public':true,'is_user_employee':false,'is_user_publisher':false,'hash':false,'pid':false,'domain':[],'two_columns':false,},this.options||{});this.options=Object.entries(options).reduce((acc,[key,value])=>{acc[_.str.underscored(key)]=value;return acc;},defaultOptions);},_reloadChatterContent:function(data){this.messageFetch();this._reloadComposer();},_createComposerWidget:function(){return new portalComposer.PortalComposer(this,this.options);},_reloadComposer:async function(){if(this._composer){this._composer.destroy();} 9213if(this.options.display_composer){this._composer=this._createComposerWidget();await this._composer.appendTo(this.$('.o_portal_chatter_composer'));}},_chatterInit:function(){var self=this;return this._rpc({route:'/mail/chatter_init',params:this._messageFetchPrepareParams()}).then(function(result){self.result=result;self.options=_.extend(self.options,self.result['options']||{});return result;});},_changeCurrentPage:function(page,domain){this._currentPage=page;var d=domain?domain:_.clone(this.get('domain'));this.set('domain',d);},_messageFetchPrepareParams:function(){var self=this;var data={'res_model':this.options['res_model'],'res_id':this.options['res_id'],'limit':this.options['pager_step'],'offset':(this._currentPage-1)*this.options['pager_step'],'allow_composer':this.options['allow_composer'],};if(self.options['token']){data['token']=self.options['token'];} 9214if(this.get('domain')){data['domain']=this.get('domain');} 9215return data;},_pager:function(page){page=page||1;var total=this.get('message_count');var scope=this.options['pager_scope'];var step=this.options['pager_step'];var pageCount=Math.ceil(parseFloat(total)/step);page=Math.max(1,Math.min(parseInt(page),pageCount));scope-=1;var pmin=Math.max(page-parseInt(Math.floor(scope/2)),1);var pmax=Math.min(pmin+scope,pageCount);if(pmax-scope>0){pmin=pmax-scope;}else{pmin=1;} 9216var pages=[];_.each(_.range(pmin,pmax+1),function(index){pages.push(index);});return{"page_count":pageCount,"offset":(page-1)*step,"page":page,"page_start":pmin,"page_previous":Math.max(pmin,page-1),"page_next":Math.min(pmax,page+1),"page_end":pmax,"pages":pages};},_renderMessages:function(){this.$('.o_portal_chatter_messages').html(qweb.render("portal.chatter_messages",{widget:this}));},_renderMessageCount:function(){this.$('.o_message_counter').replaceWith(qweb.render("portal.chatter_message_count",{widget:this}));},_renderPager:function(){this.$('.o_portal_chatter_pager').replaceWith(qweb.render("portal.pager",{widget:this}));},_onChangeDomain:function(){var self=this;return this.messageFetch().then(function(){var p=self._currentPage;self.set('pager',self._pager(p));});},_onClickPager:function(ev){ev.preventDefault();var page=$(ev.currentTarget).data('page');this._changeCurrentPage(page);},_onClickUpdateIsInternal:function(ev){ev.preventDefault();var $elem=$(ev.currentTarget);return this._rpc({route:'/mail/update_is_internal',params:{message_id:$elem.data('message-id'),is_internal:!$elem.data('is-internal'),},}).then(function(result){$elem.data('is-internal',result);if(result===true){$elem.addClass('o_portal_message_internal_on');$elem.removeClass('o_portal_message_internal_off');}else{$elem.addClass('o_portal_message_internal_off');$elem.removeClass('o_portal_message_internal_on');}});},});publicWidget.registry.portalChatter=publicWidget.Widget.extend({selector:'.o_portal_chatter',async start(){const proms=[this._super.apply(this,arguments)];const chatter=new PortalChatter(this,this.$el.data());proms.push(chatter.appendTo(this.$el));await Promise.all(proms);if(window.location.hash===`#${this.el.id}`){dom.scrollTo(this.el,{duration:0});}},});return{PortalChatter:PortalChatter,};});; 9217 9218/* /portal/static/src/js/portal_composer.js */ 9219odoo.define('portal.composer',function(require){'use strict';var ajax=require('web.ajax');var core=require('web.core');var publicWidget=require('web.public.widget');var qweb=core.qweb;var _t=core._t;var PortalComposer=publicWidget.Widget.extend({template:'portal.Composer',events:{'change .o_portal_chatter_file_input':'_onFileInputChange','click .o_portal_chatter_attachment_bt
9219n':'_onAttachmentButtonClick','click .o_portal_chatter_attachment_delete':'async _onAttachmentDeleteClick','click .o_portal_chatter_composer_btn':'async _onSubmitButtonClick',},init:function(parent,options){this._super.apply(this,arguments);this.options=_.defaults(options||{},{'allow_composer':true,'display_composer':false,'csrf_token':odoo.csrf_token,'token':false,'res_model':false,'res_id':false,});this.attachments=[];},start:function(){var self=this;this.$attachmentButton=this.$('.o_portal_chatter_attachment_btn');this.$fileInput=this.$('.o_portal_chatter_file_input');this.$sendButton=this.$('.o_portal_chatter_composer_btn');this.$attachments=this.$('.o_portal_chatter_composer_input .o_portal_chatter_attachments');this.$inputTextarea=this.$('.o_portal_chatter_composer_input textarea[name="message"]');return this._super.apply(this,arguments).then(function(){if(self.options.default_attachment_ids){self.attachments=self.options.default_attachment_ids||[];_.each(self.attachments,function(attachment){attachment.state='done';});self._updateAttachments();} 9220return Promise.resolve();});},_onAttachmentButtonClick:function(){this.$fileInput.click();},_onAttachmentDeleteClick:function(ev){var self=this;var attachmentId=$(ev.currentTarget).closest('.o_portal_chatter_attachment').data('id');var accessToken=_.find(this.attachments,{'id':attachmentId}).access_token;ev.preventDefault();ev.stopPropagation();this.$sendButton.prop('disabled',true);return this._rpc({route:'/portal/attachment/remove',params:{'attachment_id':attachmentId,'access_token':accessToken,},}).then(function(){self.attachments=_.reject(self.attachments,{'id':attachmentId});self._updateAttachments();self.$sendButton.prop('disabled',false);});},_prepareAttachmentData:function(file){return{'name':file.name,'file':file,'res_id':this.options.res_id,'res_model':this.options.res_model,'access_token':this.options.token,};},_onFileInputChange:function(){var self=this;this.$sendButton.prop('disabled',true);return Promise.all(_.map(this.$fileInput[0].files,function(file){return new Promise(function(resolve,reject){var data=self._prepareAttachmentData(file);ajax.post('/portal/attachment/add',data).then(function(attachment){attachment.state='pending';self.attachments.push(attachment);self._updateAttachments();resolve();}).guardedCatch(function(error){self.displayNotification({message:_.str.sprintf(_t("Could not save file <strong>%s</strong>"),_.escape(file.name)),type:'warning',sticky:true,});resolve();});});})).then(function(){self.$fileInput[0].value=null;self.$sendButton.prop('disabled',false);});},_prepareMessageData:function(){return Object.assign(this.options||{},{'message':this.$('textarea[name="message"]').val(),'attachment_ids':_.pluck(this.attachments,'id'),'attachment_tokens':_.pluck(this.attachments,'access_token'),});},_onSubmitButtonClick:function(ev){ev.preventDefault();const error=this._onSubmitCheckContent();if(error){this.$inputTextarea.addClass('border-danger');this.$(".o_portal_chatter_composer_error").text(error).removeClass('d-none');return Promise.reject();}else{return this._chatterPostMessage(ev.currentTarget.getAttribute('data-action'));}},_onSubmitCheckContent:function(){if(!this.$inputTextarea.val().trim()&&!this.attachments.length){return _t('Some fields are required. Please make sure to write a message or attach a document');};},_updateAttachments:function(){this.$attachments.html(qweb.render('portal.Chatter.Attachments',{attachments:this.attachments,showDelete:true,}));},_chatterPostMessage:async function(route){const result=await this._rpc({route:route,params:this._prepareMessageData(),});core.bus.trigger('reload_chatter_content',result);return result;},});return{PortalComposer:PortalComposer,};});; 9221 9222/* /portal/static/src/js/portal_signature.js */ 9223odoo.define('portal.signature_form',function(require){'use strict';var core=require('web.core');var publicWidget=require('web.public.widget');var NameAndSignature=require('web.name_and_signature').NameAndSignature;var qweb=core.qweb;var _t=core._t;var SignatureForm=publicWidget.Widget.extend({template:'portal.portal_signature',events:{'click .o_portal_sign_submit':'async _onClickSignSubmit',},custom_events:{'signature_changed':'_onChangeSignature',},init:function(parent,options){this._super.apply(this,arguments);this.csrf_token=odoo.csrf_token;this.callUrl=options.callUrl||'';this.rpcParams=options.rpcParams||{};this.sendLabel=options.sendLabel||_t("Accept & Sign");this.nameAndSignature=new NameAndSignature(this,options.nameAndSignatureOptions||{});},start:function(){var self=this;this.$confirm_btn=this.$('.o_portal_sign_submit');this.$controls=this.$('.o_portal_sign_controls');var subWidgetStart=this.nameAndSignature.replace(this.$('.o_web_sign_name_and_signature'));return Promise.all([subWidgetStart,this._super.apply(this,arguments)]).then(function(){self.nameAndSignature.resetSignature();});},focusName:function(){this.nameAndSignature.focusName();},resetSignature:function(){if(this.isDestroyed()){return;} 9224return this.nameAndSignature.resetSignature();},_onClickSignSubmit:function(ev){var self=this;ev.preventDefault();if(!this.nameAndSignature.validateSignature()){return;} 9225var name=this.nameAndSignature.getName();var signature=this.nameAndSignature.getSignatureImage()[1];return this._rpc({route:this.callUrl,params:_.extend(this.rpcParams,{'name':name,'signature':signature,}),}).then(function(data){if(data.error){self.$('.o_portal_sign_error_msg').remove();self.$controls.prepend(qweb.render('portal.portal_signature_error',{widget:data}));}else if(data.success){var $success=qweb.render('portal.portal_signature_success',{widget:data});self.$el.empty().append($success);} 9226if(data.force_refresh){if(data.redirect_url){window.location=data.redirect_url;}else{window.location.reload();} 9227return new Promise(function(){});}});},_onChangeSignature:function(){var isEmpty=this.nameAndSignature.isSignatureEmpty();this.$confirm_btn.prop('disabled',isEmpty);},});publicWidget.registry.SignatureForm=publicWidget.Widget.extend({selector:'.o_portal_signature_form',start:function(){var hasBeenReset=false;var callUrl=this.$el.data('call-url');var nameAndSignatureOptions={defaultName:this.$el.data('default-name'),mode:this.$el.data('mode'),displaySignatureRatio:this.$el.data('signature-ratio'),signatureType:this.$el.data('signature-type'),fontColor:this.$el.data('font-color')||'black',};var sendLabel=this.$el.data('send-label');var form=new SignatureForm(this,{callUrl:callUrl,nameAndSignatureOptions:nameAndSignatureOptions,sendLabel:sendLabel,});this.$el.closest('.modal').on('shown.bs.modal',function(ev){if(!hasBeenReset){hasBeenReset=true;form.resetSignature();}else{form.focusName();}});return Promise.all([this._super.apply(this,arguments),form.appendTo(this.$el)]);},});return{SignatureForm:SignatureForm,};});; 9228 9229/* /portal/static/src/js/portal_sidebar.js */ 9230odoo.define('portal.PortalSidebar',function(require){'use strict';var core=require('web.core');var publicWidget=require('web.public.widget');var time=require('web.time');var session=require('web.session');var _t=core._t;var PortalSidebar=publicWidget.Widget.extend({start:function(){this._setDelayLabel();return this._super.apply(this,arguments);},_setDelayLabel:function(){var $sidebarTimeago=this.$el.find('.o_portal_sidebar_timeago');_.each($sidebarTimeago,function(el){var dateTime=moment(time.auto_str_to_date($(el).attr('datetime'))),today=moment().startOf('day'),diff=dateTime.diff(today,'days',true),displayStr;session.is_bound.then(function(){if(diff===0){displayStr=_t('Due today');}else if(diff>0){displayStr=_.str.sprintf(_t('Due in %1d days'),Math.abs(diff));}else{displayStr=_.str.sprintf(_t('%1d days overdue'),Math.abs(diff));} 9231$(el).text(displayStr);});});},_printIframeContent:function(href){if($.browser.mozilla){window.open(href,'_blank');return;} 9232if(!this.printContent){this.printContent=$('<iframe id="print_iframe_content" src="'+href+'" style="display:none"></iframe>');this.$el.append(this.printContent);this.printContent.on('load',function(){$(this).get(0).contentWindow.print();});}else{this.printContent.get(0).contentWindow.print();}},});return PortalSidebar;});; 9233 9234/* /account/static/src/js/account_portal_sidebar.js */ 9235odoo.define('account.AccountPortalSidebar',function(require){'use strict';const dom=require('web.dom');var publicWidget=require('web.public.widget');var PortalSidebar=require('portal.PortalSidebar');var utils=require('web.utils');publicWidget.registry.AccountPortalSidebar=PortalSidebar.extend({selector:'.o_portal_invoice_sidebar',events:{'click .o_portal_invoice_print':'_onPrintInvoice',},start:function(){var def=this._super.apply(this,arguments);var $invoiceHtml=this.$el.find('iframe#invoice_html');var updateIframeSize=this._updateIframeSize.bind(this,$invoiceHtml);$(window).on('resize',updateIframeSize);var iframeDoc=$invoiceHtml[0].contentDocument||$invoiceHtml[0].contentWindow.document;
9235if(iframeDoc.readyState==='complete'){updateIframeSize();}else{$invoiceHtml.on('load',updateIframeSize);} 9236return def;},_updateIframeSize:function($el){var $wrapwrap=$el.contents().find('div#wrapwrap');$el.height(0);$el.height($wrapwrap[0].scrollHeight);if(!utils.isValidAnchor(window.location.hash)){return;} 9237var $target=$(window.location.hash);if(!$target.length){return;} 9238dom.scrollTo($target[0],{duration:0});},_onPrintInvoice:function(ev){ev.preventDefault();var href=$(ev.currentTarget).attr('href');this._printIframeContent(href);},});});; 9239 9240/* /account/static/src/js/account_portal.js */ 9241odoo.define('@account/js/account_portal',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');require("portal.portal");publicWidget.registry.PortalHomeCounters.include({_getCountersAlwaysDisplayed(){return this._super(...arguments).concat(['invoice_count']);},});return __exports;});; 9242 9243/* /payment/static/lib/jquery.payment/jquery.payment.js */ 9244(function(){var $,cardFromNumber,cardFromType,cards,defaultFormat,formatBackCardNumber,formatBackExpiry,formatCardNumber,formatExpiry,formatForwardExpiry,formatForwardSlashAndSpace,hasTextSelected,luhnCheck,reFormatCVC,reFormatCardNumber,reFormatExpiry,reFormatNumeric,replaceFullWidthChars,restrictCVC,restrictCardNumber,restrictExpiry,restrictNumeric,safeVal,setCardType,__slice=[].slice,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++){if(i in this&&this[i]===item)return i;}return-1;};$=window.jQuery||window.Zepto||window.$;$.payment={};$.payment.fn={};$.fn.payment=function(){var args,method;method=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[];return $.payment.fn[method].apply(this,args);};defaultFormat=/(\d{1,4})/g;$.payment.cards=cards=[{type:'maestro',patterns:[5018,502,503,506,56,58,639,6220,67],format:defaultFormat,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:true},{type:'forbrugsforeningen',patterns:[600],format:defaultFormat,length:[16],cvcLength:[3],luhn:true},{type:'dankort',patterns:[5019],format:defaultFormat,length:[16],cvcLength:[3],luhn:true},{type:'visa',patterns:[4],format:defaultFormat,length:[13,16],cvcLength:[3],luhn:true},{type:'mastercard',patterns:[51,52,53,54,55,22,23,24,25,26,27],format:defaultFormat,length:[16],cvcLength:[3],luhn:true},{type:'amex',patterns:[34,37],format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:true},{type:'dinersclub',patterns:[30,36,38,39],format:/(\d{1,4})(\d{1,6})?(\d{1,4})?/,length:[14],cvcLength:[3],luhn:true},{type:'discover',patterns:[60,64,65,622],format:defaultFormat,length:[16],cvcLength:[3],luhn:true},{type:'unionpay',patterns:[62,88],format:defaultFormat,length:[16,17,18,19],cvcLength:[3],luhn:false},{type:'jcb',patterns:[35],format:defaultFormat,length:[16],cvcLength:[3],luhn:true}];cardFromNumber=function(num){var card,p,pattern,_i,_j,_len,_len1,_ref;num=(num+'').replace(/\D/g,'');for(_i=0,_len=cards.length;_i<_len;_i++){card=cards[_i];_ref=card.patterns;for(_j=0,_len1=_ref.length;_j<_len1;_j++){pattern=_ref[_j];p=pattern+'';if(num.substr(0,p.length)===p){return card;}}}};cardFromType=function(type){var card,_i,_len;for(_i=0,_len=cards.length;_i<_len;_i++){card=cards[_i];if(card.type===type){return card;}}};luhnCheck=function(num){var digit,digits,odd,sum,_i,_len;odd=true;sum=0;digits=(num+'').split('').reverse();for(_i=0,_len=digits.length;_i<_len;_i++){digit=digits[_i];digit=parseInt(digit,10);if((odd=!odd)){digit*=2;} 9245if(digit>9){digit-=9;} 9246sum+=digit;} 9247return sum%10===0;};hasTextSelected=function($target){var _ref;if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==$target.prop('selectionEnd')){return true;} 9248if((typeof document!=="undefined"&&document!==null?(_ref=document.selection)!=null?_ref.createRange:void 0:void 0)!=null){if(document.selection.createRange().text){return true;}} 9249return false;};safeVal=function(value,$target){var currPair,cursor,digit,error,last,prevPair;try{cursor=$target.prop('selectionStart');}catch(_error){error=_error;cursor=null;} 9250last=$target.val();$target.val(value);if(cursor!==null&&$target.is(":focus")){if(cursor===last.length){cursor=value.length;} 9251if(last!==value){prevPair=last.slice(cursor-1,+cursor+1||9e9);currPair=value.slice(cursor-1,+cursor+1||9e9);digit=value[cursor];if(/\d/.test(digit)&&prevPair===(""+digit+" ")&&currPair===(" "+digit)){cursor=cursor+1;}} 9252$target.prop('selectionStart',cursor);return $target.prop('selectionEnd',cursor);}};replaceFullWidthChars=function(str){var chars,chr,fullWidth,halfWidth,idx,value,_i,_len;if(str==null){str='';} 9253fullWidth='\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19';halfWidth='0123456789';value='';chars=str.split('');for(_i=0,_len=chars.length;_i<_len;_i++){chr=chars[_i];idx=fullWidth.indexOf(chr);if(idx>-1){chr=halfWidth[idx];} 9254value+=chr;} 9255return value;};reFormatNumeric=function(e){var $target;$target=$(e.currentTarget);return setTimeout(function(){var value;value=$target.val();value=replaceFullWidthChars(value);value=value.replace(/\D/g,'');return safeVal(value,$target);});};reFormatCardNumber=function(e){var $target;$target=$(e.currentTarget);return setTimeout(function(){var value;value=$target.val();value=replaceFullWidthChars(value);value=$.payment.formatCardNumber(value);return safeVal(value,$target);});};formatCardNumber=function(e){var $target,card,digit,length,re,upperLength,value;digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;} 9256$target=$(e.currentTarget);value=$target.val();card=cardFromNumber(value+digit);length=(value.replace(/\D/g,'')+digit).length;upperLength=16;if(card){upperLength=card.length[card.length.length-1];} 9257if(length>=upperLength){return;} 9258if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==value.length){return;} 9259if(card&&card.type==='amex'){re=/^(\d{4}|\d{4}\s\d{6})$/;}else{re=/(?:^|\s)(\d{4})$/;} 9260if(re.test(value)){e.preventDefault();return setTimeout(function(){return $target.val(value+' '+digit);});}else if(re.test(value+digit)){e.preventDefault();return setTimeout(function(){return $target.val(value+digit+' ');});}};formatBackCardNumber=function(e){var $target,value;$target=$(e.currentTarget);value=$target.val();if(e.which!==8){return;} 9261if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==value.length){return;} 9262if(/\d\s$/.test(value)){e.preventDefault();return setTimeout(function(){return $target.val(value.replace(/\d\s$/,''));});}else if(/\s\d?$/.test(value)){e.preventDefault();return setTimeout(function(){return $target.val(value.replace(/\d$/,''));});}};reFormatExpiry=function(e){var $target;$target=$(e.currentTarget);return setTimeout(function(){var value;value=$target.val();value=replaceFullWidthChars(value);value=$.payment.formatExpiry(value);return safeVal(value,$target);});};formatExpiry=function(e){var $target,digit,val;digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;} 9263$target=$(e.currentTarget);val=$target.val()+digit;if(/^\d$/.test(val)&&(val!=='0'&&val!=='1')){e.preventDefault();return setTimeout(function(){return $target.val("0"+val+" / ");});}else if(/^\d\d$/.test(val)){e.preventDefault();return setTimeout(function(){var m1,m2;m1=parseInt(val[0],10);m2=parseInt(val[1],10);if(m2>2&&m1!==0){return $target.val("0"+m1+" / "+m2);}else{return $target.val(""+val+" / ");}});}};formatForwardExpiry=function(e){var $target,digit,val;digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;} 9264$target=$(e.currentTarget);val=$target.val();if(/^\d\d$/.test(val)){return $target.val(""+val+" / ");}};formatForwardSlashAndSpace=function(e){var $target,val,which;which=String.fromCharCode(e.which);if(!(which==='/'||which===' ')){return;} 9265$target=$(e.currentTarget);val=$target.val();if(/^\d$/.test(val)&&val!=='0'){return $target.val("0"+val+" / ");}};formatBackExpiry=function(e){var $target,value;$target=$(e.currentTarget);value=$target.val();if(e.which!==8){return;} 9266if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==value.length){return;} 9267if(/\d\s\/\s$/.test(value)){e.preventDefault();return setTimeout(function(){return $target.val(value.replace(/\d\s\/\s$/,''));});}};reFormatCVC=function(e){var $target;$target=$(e.currentTarget);return setTimeout(function(){var value;value=$target.val();value=replaceFullWidthChars(value);value=value.replace(/\D/g,'').slice(0,4);return safeVal(value,$target);});};restrictNumeric=function(e){var input;if(e.metaKey||e.ctrlKey){return true;} 9268if(e.which===32){return false;} 9269if(e.which===0){return true;} 9270if(e.which<33){return true;} 9271input=String.fromCharCode(e.which);return!!/[\d\s]/.test(input);};restrictCardNumber=function(e){var $target,card,digit,value;$target=$(e.currentTarget);digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;} 9272if(hasTextSelected($target)){return;} 9273value=($target.val()+digit).replace(/\D/g,'');card=cardFromNumber(value);if(card){return value.length<=card.length[card.length.length-1];}else{return value.length<=16;}};restrictExpiry=function(e){var $target,digit,value;$target=$(e.currentTarget);digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;} 9274if(hasTextSelected($target)){return;} 9275value=$target.val()+digit;value=value.replace(/\D/g,'');if(value.length>6){return false;}};restrictCVC=function(e){var $target,digit,val;$target=$(e.currentTarget);digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;} 9276if(hasTextSelected($target)){return;} 9277val=$target.val()+digit;return val.length<=4;};setCardType=function(e){var $target,allTypes,card,cardType,val;$target=$(e.currentTarget);val=$target.val();cardType=$.payment.cardType(val)||'unknown';if(!$target.hasClass(cardType)){allTypes=(function(){var _i,_len,_results;_results=[];for(_i=0,_len=cards.length;_i<_len;_i++){card=cards[_i];_results.push(card.type);} 9278return _results;})();$target.removeClass('unknown');$target.removeClass(allTypes.join(' '));$target.addClass(cardType);$target.toggleClass('identified',cardType!=='unknown');return $target.trigger('payment.cardType',cardType);}};$.payment.fn.formatCardCVC=function(){this.on('keypress',restrictNumeric);this.on('keypress',restrictCVC);this.on('paste',reFormatCVC);this.on('change',reFormatCVC);this.on('input',reFormatCVC);return this;};$.payment.fn.formatCardExpiry=function(){this.on('keypress',restrictNumeric);this.on('keypress',restrictExpiry);this.on('keypress',formatExpiry);this.on('keypress',formatForwardSlashAndSpace);this.on('keypress',formatForwardExpiry);this.on('keydown',formatBackExpiry);this.on('change',reFormatExpiry);this.on('input',reFormatExpiry);return this;};$.payment.fn.formatCardNumber=function(){this.on('keypress',restrictNumeric);this.on('keypress',restrictCardNumber);this.on('keypress',formatCardNumber);this.on('keydown',formatBackCardNumber);this.on('keyup',setCardType);this.on('paste',reFormatCardNumber);this.on('change',reFormatCardNumber);this.on('input',reFormatCardNumber);this.on('input',setCardType);return this;};$.payment.fn.restrictNumeric=function(){this.on('keypress',restrictNumeric);this.on('paste',reFormatNumeric);this.on('change',reFormatNumeric);this.on('input',reFormatNumeric);return this;};$.payment.fn.cardExpiryVal=function(){return $.payment.cardExpiryVal($(this).val());};$.payment.cardExpiryVal=function(value){var month,prefix,year,_ref;_ref=value.split(/[\s\/]+/,2),month=_ref[0],year=_ref[1];
9278if((year!=null?year.length:void 0)===2&&/^\d+$/.test(year)){prefix=(new Date).getFullYear();prefix=prefix.toString().slice(0,2);year=prefix+year;} 9279month=parseInt(month,10);year=parseInt(year,10);return{month:month,year:year};};$.payment.validateCardNumber=function(num){var card,_ref;num=(num+'').replace(/\s+|-/g,'');if(!/^\d+$/.test(num)){return false;} 9280card=cardFromNumber(num);if(!card){return false;} 9281return(_ref=num.length,__indexOf.call(card.length,_ref)>=0)&&(card.luhn===false||luhnCheck(num));};$.payment.validateCardExpiry=function(month,year){var currentTime,expiry,_ref;if(typeof month==='object'&&'month'in month){_ref=month,month=_ref.month,year=_ref.year;} 9282if(!(month&&year)){return false;} 9283month=$.trim(month);year=$.trim(year);if(!/^\d+$/.test(month)){return false;} 9284if(!/^\d+$/.test(year)){return false;} 9285if(!((1<=month&&month<=12))){return false;} 9286if(year.length===2){if(year<70){year="20"+year;}else{year="19"+year;}} 9287if(year.length!==4){return false;} 9288expiry=new Date(year,month);currentTime=new Date;expiry.setMonth(expiry.getMonth()-1);expiry.setMonth(expiry.getMonth()+1,1);return expiry>currentTime;};$.payment.validateCardCVC=function(cvc,type){var card,_ref;cvc=$.trim(cvc);if(!/^\d+$/.test(cvc)){return false;} 9289card=cardFromType(type);if(card!=null){return _ref=cvc.length,__indexOf.call(card.cvcLength,_ref)>=0;}else{return cvc.length>=3&&cvc.length<=4;}};$.payment.cardType=function(num){var _ref;if(!num){return null;} 9290return((_ref=cardFromNumber(num))!=null?_ref.type:void 0)||null;};$.payment.formatCardNumber=function(num){var card,groups,upperLength,_ref;num=num.replace(/\D/g,'');card=cardFromNumber(num);if(!card){return num;} 9291upperLength=card.length[card.length.length-1];num=num.slice(0,upperLength);if(card.format.global){return(_ref=num.match(card.format))!=null?_ref.join(' '):void 0;}else{groups=card.format.exec(num);if(groups==null){return;} 9292groups.shift();groups=$.grep(groups,function(n){return n;});return groups.join(' ');}};$.payment.formatExpiry=function(expiry){var mon,parts,sep,year;parts=expiry.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/);if(!parts){return'';} 9293mon=parts[1]||'';sep=parts[2]||'';year=parts[3]||'';if(year.length>0){sep=' / ';}else if(sep===' /'){mon=mon.substring(0,1);sep='';}else if(mon.length===2||sep.length>0){sep=' / ';}else if(mon.length===1&&(mon!=='0'&&mon!=='1')){mon="0"+mon;sep=' / ';} 9294return mon+sep+year;};}).call(this);; 9295 9296/* /payment/static/src/js/checkout_form.js */ 9297odoo.define('payment.checkout_form',require=>{'use strict';const publicWidget=require('web.public.widget');const paymentFormMixin=require('payment.payment_form_mixin');publicWidget.registry.PaymentCheckoutForm=publicWidget.Widget.extend(paymentFormMixin,{selector:'form[name="o_payment_checkout"]',events:Object.assign({},publicWidget.Widget.prototype.events,{'click div[name="o_payment_option_card"]':'_onClickPaymentOption','click a[name="o_payment_icon_more"]':'_onClickMorePaymentIcons','click a[name="o_payment_icon_less"]':'_onClickLessPaymentIcons','click button[name="o_payment_submit_button"]':'_onClickPay','submit':'_onSubmit',}),init:function(){const preventDoubleClick=handlerMethod=>{return _.debounce(handlerMethod,500,true);};this._super(...arguments);this._onClickLessPaymentIcons=preventDoubleClick(this._onClickLessPaymentIcons);this._onClickMorePaymentIcons=preventDoubleClick(this._onClickMorePaymentIcons);this._onClickPay=preventDoubleClick(this._onClickPay);this._onClickPaymentOption=preventDoubleClick(this._onClickPaymentOption);this._onSubmit=preventDoubleClick(this._onSubmit);},_onClickPay:async function(ev){ev.stopPropagation();ev.preventDefault();const $checkedRadios=this.$('input[name="o_payment_radio"]:checked');if(!this._ensureRadioIsChecked($checkedRadios)){return;} 9298const checkedRadio=$checkedRadios[0];const provider=this._getProviderFromRadio(checkedRadio);const paymentOptionId=this._getPaymentOptionIdFromRadio(checkedRadio);const flow=this._getPaymentFlowFromRadio(checkedRadio);if(flow!=='token'){const $tokenizeCheckbox=this.$(`#o_payment_provider_inline_form_${paymentOptionId}`).find('input[name="o_payment_save_as_token"]');this.txContext.tokenizationRequested=$tokenizeCheckbox.length===1&&$tokenizeCheckbox[0].checked;}else{this.txContext.tokenizationRequested=false;} 9299this._hideError();this._disableButton(true);$('body').block({message:false,overlayCSS:{backgroundColor:"#000",opacity:0,zIndex:1050},});this._processPayment(provider,paymentOptionId,flow);},_onSubmit:function(ev){ev.stopPropagation();ev.preventDefault();this._onClickPay(ev);},});return publicWidget.registry.PaymentCheckoutForm;});; 9300 9301/* /payment/static/src/js/express_checkout_form.js */ 9302odoo.define('@payment/js/express_checkout_form',async function(require){'use strict';let __exports={};const core=require('web.core');const publicWidget=require('web.public.widget');publicWidget.registry.PaymentExpressCheckoutForm=publicWidget.Widget.extend({selector:'form[name="o_payment_express_checkout_form"]',start:async function(){await this._super(...arguments);this.txContext={};Object.assign(this.txContext,this.$el.data());this.txContext.shippingInfoRequired=!!this.txContext.shippingInfoRequired;const expressCheckoutForms=this._getExpressCheckoutForms();for(const expressCheckoutForm of expressCheckoutForms){await this._prepareExpressCheckoutForm(expressCheckoutForm.dataset);} 9303core.bus.on('cart_amount_changed',this,this._updateAmount.bind(this));},_getExpressCheckoutForms(){return document.querySelectorAll('form[name="o_payment_express_checkout_form"] div[name="o_express_checkout_container"]');},async _prepareExpressCheckoutForm(providerData){return Promise.resolve();}
9303,_prepareTransactionRouteParams(providerId){return{'payment_option_id':parseInt(providerId),'reference_prefix':this.txContext.referencePrefix&&this.txContent.referencePrefix.toString(),'currency_id':this.txContext.currencyId&&parseInt(this.txContext.currencyId),'partner_id':parseInt(this.txContext.partnerId),'flow':'direct','tokenization_requested':false,'landing_route':this.txContext.landingRoute,'access_token':this.txContext.accessToken,'csrf_token':core.csrf_token,};},_updateAmount(newAmount,newMinorAmount){this.txContext.amount=parseFloat(newAmount);this.txContext.minorAmount=parseInt(newMinorAmount);this._getExpressCheckoutForms().forEach(form=>{if(newAmount==0){form.classList.add('d-none')} 9304else{form.classList.remove('d-none')}})},});const paymentExpressCheckoutForm=__exports.paymentExpressCheckoutForm=publicWidget.registry.PaymentExpressCheckoutForm;return __exports;});; 9305 9306/* /payment/static/src/js/manage_form.js */ 9307odoo.define('payment.manage_form',require=>{'use strict';const core=require('web.core');const publicWidget=require('web.public.widget');const Dialog=require('web.Dialog');const paymentFormMixin=require('payment.payment_form_mixin');const _t=core._t;publicWidget.registry.PaymentManageForm=publicWidget.Widget.extend(paymentFormMixin,{selector:'form[name="o_payment_manage"]',events:Object.assign({},publicWidget.Widget.prototype.events,{'click div[name="o_payment_option_card"]':'_onClickPaymentOption','click a[name="o_payment_icon_more"]':'_onClickMorePaymentIcons','click a[name="o_payment_icon_less"]':'_onClickLessPaymentIcons','click button[name="o_payment_submit_button"]':'_onClickSaveToken','click button[name="o_payment_delete_token"]':'_onClickDeleteToken','submit':'_onSubmit',}),init:function(){const preventDoubleClick=handlerMethod=>{return _.debounce(handlerMethod,500,true);};this._super(...arguments);this._onClickDeleteToken=preventDoubleClick(this._onClickDeleteToken);this._onClickLessPaymentIcons=preventDoubleClick(this._onClickLessPaymentIcons);this._onClickMorePaymentIcons=preventDoubleClick(this._onClickMorePaymentIcons);this._onClickPaymentOption=preventDoubleClick(this._onClickPaymentOption);this._onClickSaveToken=preventDoubleClick(this._onClickSaveToken);this._onSubmit=preventDoubleClick(this._onSubmit);},_assignToken:function(tokenId){this._rpc({route:this.txContext.assignTokenRoute,params:{'access_token':this.txContext.accessToken,'token_id':tokenId,}}).then(()=>{window.location=this.txContext.landingRoute;}).guardedCatch(error=>{error.event.preventDefault();this._displayError(_t("Server Error"),_t("We are not able to save your payment method."),error.message.data.message);});},_buildConfirmationDialog:function(linkedRecordsInfo,confirmCallback){const $dialogContentMessage=$('<span>',{text:_t("Are you sure you want to delete this payment method?")});if(linkedRecordsInfo.length>0){$dialogContentMessage.append($('<br>'));$dialogContentMessage.append($('<span>',{text:_t("It is currently linked to the following documents:")}));const $documentInfoList=$('<ul>');linkedRecordsInfo.forEach(documentInfo=>{$documentInfoList.append($('<li>').append($('<a>',{href:documentInfo.url,target:'_blank',title:documentInfo.description,text:documentInfo.name})));});$dialogContentMessage.append($documentInfoList);} 9308return new Dialog(this,{title:_t("Warning!"),size:'medium',$content:$('<div>').append($dialogContentMessage),buttons:[{text:_t("Confirm Deletion"),classes:'btn-primary',close:true,click:confirmCallback,},{text:_t("Cancel"),close:true},],});},_deleteToken:function(tokenId){const execute=()=>{this._rpc({route:'/payment/archive_token',params:{'token_id':tokenId,},}).then(()=>{const $tokenCard=this.$(`input[name="o_payment_radio"][data-payment-option-id="${tokenId}"]`+`[data-payment-option-type="token"]`).closest('div[name="o_payment_option_card"]');$tokenCard.siblings(`#o_payment_token_inline_form_${tokenId}`).remove();$tokenCard.remove();this._disableButton(false);}).guardedCatch(error=>{error.event.preventDefault();this._displayError(_t("Server Error"),_t("We are not able to delete your payment method."),error.message.data.message);});};this._rpc({model:'payment.token',method:'get_linked_records_info',args:[tokenId],}).then(linkedRecordsInfo=>{this._buildConfirmationDialog(linkedRecordsInfo,execute).open();}).guardedCatch(error=>{this._displayError(_t("Server Error"),_t("We are not able to delete your payment method."),error.message.data.message);});},_onClickDeleteToken:function(ev){ev.preventDefault();const linkedRadio=$(ev.currentTarget).siblings().find('input[name="o_payment_radio"]')[0];const tokenId=this._getPaymentOptionIdFromRadio(linkedRadio);this._deleteToken(tokenId);},_onClickSaveToken:async function(ev){ev.stopPropagation();ev.preventDefault();const $checkedRadios=this.$('input[name="o_payment_radio"]:checked');if(!this._ensureRadioIsChecked($checkedRadios)){return;} 9309const checkedRadio=$checkedRadios[0];const provider=this._getProviderFromRadio(checkedRadio);const paymentOptionId=this._getPaymentOptionIdFromRadio(checkedRadio);const flow=this._getPaymentFlowFromRadio(checkedRadio);this._hideError();this._disableButton(true);$('body').block({message:false,overlayCSS:{backgroundColor:"#000",opacity:0,zIndex:1050},});if(flow!=='token'){this.txContext.tokenizationRequested=true;this.txContext.isValidation=true;this._processPayment(provider,paymentOptionId,flow);}else if(this.txContext.allowTokenSelection){this._assignToken(paymentOptionId);}},_onSubmit:function(ev){ev.stopPropagation();ev.preventDefault();this._onClickSaveToken(ev);},});return publicWidget.registry.PaymentManageForm;});; 9310 9311/* /payment/static/src/js/payment_form_mixin.js */ 9312odoo.define('payment.payment_form_mixin',require=>{'use strict';const core=require('web.core');const Dialog=require('web.Dialog');const _t=core._t;return{start:async function(){this.txContext={};Object.assign(this.txContext,this.$el.data());await this._super(...arguments);window.addEventListener('pageshow',function(event){if(event.persisted){window.location.reload();}});this.$('[data-bs-toggle="tooltip"]').tooltip();const $checkedRadios=this.$('input[name="o_payment_radio"]:checked');if($checkedRadios.length===1){const checkedRadio=$checkedRadios[0];this._displayInlineForm(checkedRadio);this._enableButton();}else{this._setPaymentFlow();}},_disableButton:function(showLoadingAnimation=true){const $submitButton=this.$('button[name="o_payment_submit_button"]');const iconClass=$submitButton.data('icon-class');$submitButton.attr('disabled',true);if(showLoadingAnimation){$submitButton.find('i').removeClass(iconClass);$submitButton.prepend('<span class="o_loader"><i class="fa fa-refresh fa-spin"></i> </span>');}},_displayError:function(title,description='',error=''){const $checkedRadios=this.$('input[name="o_payment_radio"]:checked');if($checkedRadios.length!==1){return new Dialog(null,{title:_.str.sprintf(_t("Error: %s"),title),size:'medium',$content:`<p>${_.str.escapeHTML(description) || ''}</p>`,buttons:[{text:_t("Ok"),close:true}]}).open();}else{this._hideError();let errorHtml=`<div class="alert alert-danger mb4" name="o_payment_error"> 9313 <b>${_.str.escapeHTML(title)}</b>`;if(description!==''){errorHtml+=`</br>${_.str.escapeHTML(description)}`;} 9314if(error!==''){errorHtml+=`</br>${_.str.escapeHTML(error)}`;} 9315errorHtml+='</div>';const checkedRadio=$checkedRadios[0];const paymentOptionId=this._getPaymentOptionIdFromRadio(checkedRadio);const formType=$(checkedRadio).data('payment-option-type');const $inlineForm=this.$(`#o_payment_${formType}_inline_form_${paymentOptionId}`);$inlineForm.removeClass('d-none');$inlineForm.append(errorHtml).find('div[name="o_payment_error"]')[0].scrollIntoView({behavior:'smooth',block:'center'});} 9316this._enableButton();$('body').unblock();},_displayInlineForm:function(radio){this._hideInlineForms();this._hideError();this._setPaymentFlow();const provider=this._getProviderFromRadio(radio);const paymentOptionId=this._getPaymentOptionIdFromRadio(radio);const flow=this._getPaymentFlowFromRadio(radio);this._prepareInlineForm(provider,paymentOptionId,flow);const formType=$(radio).data('payment-option-type');const $inlineForm=this.$(`#o_payment_${formType}_inline_form_${paymentOptionId}`);if($inlineForm.children().length>0){$inlineForm.removeClass('d-none');}},_enableButton:function(){if(this._isButtonReady()){const $submitButton=this.$('button[name="o_payment_submit_button"]');const iconClass=$submitButton.data('icon-class');$submitButton.attr('disabled',false);$submitButton.find('i').addClass(iconClass);$submitButton.find('span.o_loader').remove();return true;} 9317return false;},_ensureRadioIsChecked:function($checkedRadios){if($checkedRadios.length===0){this._displayError(_t("No payment option selected"),_t("Please select a payment option."));return false;}else if($checkedRadios.length>1){this._displayError(_t("Multiple payment options selected"),_t("Please select only one payment option."));return false;} 9318return true;},_getPaymentFlowFromRadio:function(radio){if($(radio).data('payment-option-type')==='token'||this.txContext.flow==='token'){return'token';}else if(this.txContext.flow==='redirect'){return'redirect';}else{return'direct';}},_getPaymentOptionIdFromRadio:radio=>$(radio).data('payment-option-id'),_getProviderFromRadio:radio=>$(radio).data('provider'),_hideError:()=>this.$('div[name="o_payment_error"]').remove(),_hideInlineForms:()=>this.$('[name="o_payment_inline_form"]').addClass('d-none'),_hideInputs:function(){const $submitButton=this.$('button[name="o_payment_submit_button"]');const $tokenizeCheckboxes=this.$('input[name="o_payment_save_as_token"]');$submitButton.addClass('d-none');$tokenizeCheckboxes.closest('label').addClass('d-none');},_isButtonReady:function(){const $checkedRadios=this.$('input[name="o_payment_radio"]:checked');if($checkedRadios.length===1){const checkedRadio=$checkedRadios[0];const flow=this._getPaymentFlowFromRadio(checkedRadio);return flow!=='token'||this.txContext.allowTokenSelection;}else{return false;}}
9318,_prepareTransactionRouteParams:function(code,paymentOptionId,flow){return{'payment_option_id':paymentOptionId,'reference_prefix':this.txContext.referencePrefix!==undefined?this.txContext.referencePrefix.toString():null,'amount':this.txContext.amount!==undefined?parseFloat(this.txContext.amount):null,'currency_id':this.txContext.currencyId?parseInt(this.txContext.currencyId):null,'partner_id':parseInt(this.txContext.partnerId),'flow':flow,'tokenization_requested':this.txContext.tokenizationRequested,'landing_route':this.txContext.landingRoute,'is_validation':this.txContext.isValidation,'access_token':this.txContext.accessToken?this.txContext.accessToken:undefined,'csrf_token':core.csrf_token,};},_prepareInlineForm:(code,paymentOptionId,flow)=>Promise.resolve(),_processPayment:function(code,paymentOptionId,flow){return this._rpc({route:this.txContext.transactionRoute,params:this._prepareTransactionRouteParams(code,paymentOptionId,flow),}).then(processingValues=>{if(flow==='redirect'){return this._processRedirectPayment(code,paymentOptionId,processingValues);}else if(flow==='direct'){return this._processDirectPayment(code,paymentOptionId,processingValues);}else if(flow==='token'){return this._processTokenPayment(code,paymentOptionId,processingValues);}}).guardedCatch(error=>{error.event.preventDefault();this._displayError(_t("Server Error"),_t("We are not able to process your payment."),error.message.data.message);});},_processDirectPayment:(code,providerId,processingValues)=>Promise.resolve(),_processRedirectPayment:(code,providerId,processingValues)=>{const $redirectForm=$(processingValues.redirect_form_html).attr('id','o_payment_redirect_form');$redirectForm[0].setAttribute('target','_top');$(document.getElementsByTagName('body')[0]).append($redirectForm);$redirectForm.submit();},_processTokenPayment:(provider_code,tokenId,processingValues)=>{window.location='/payment/status';},_setPaymentFlow:function(flow='redirect'){if(flow!=='redirect'&&flow!=='direct'&&flow!=='token'){console.warn(`payment_form_mixin: method '_setPaymentFlow' was called with invalid flow: 9319 ${flow}. Falling back to 'redirect'.`);this.txContext.flow='redirect';}else{this.txContext.flow=flow;}},_showInputs:function(){const $submitButton=this.$('button[name="o_payment_submit_button"]');const $tokenizeCheckboxes=this.$('input[name="o_payment_save_as_token"]');$submitButton.removeClass('d-none');$tokenizeCheckboxes.closest('label').removeClass('d-none');},_onClickLessPaymentIcons:ev=>{ev.preventDefault();ev.stopPropagation();const $itemList=$(ev.currentTarget).parents('ul');const maxIconNumber=$itemList.data('max-icons');$itemList.children('li').slice(maxIconNumber).addClass('d-none');$itemList.find('a[name="o_payment_icon_more"]').parents('li').removeClass('d-none');},_onClickMorePaymentIcons:ev=>{ev.preventDefault();ev.stopPropagation();$(ev.currentTarget).parents('ul').children('li').removeClass('d-none');$(ev.currentTarget).parents('li').addClass('d-none');},_onClickPaymentOption:function(ev){this.$('input[name="o_payment_radio"]').prop('checked',false);const checkedRadio=$(ev.currentTarget).find('input[name="o_payment_radio"]')[0];$(checkedRadio).prop('checked',true);this._showInputs();this._disableButton(false);this._displayInlineForm(checkedRadio);this._enableButton();},};});; 9320 9321/* /payment/static/src/js/post_processing.js */ 9322odoo.define('payment.post_processing',function(require){'use strict';var publicWidget=require('web.public.widget');var core=require('web.core');const{Markup}=require('web.utils');var _t=core._t;$.blockUI.defaults.css.border='0';$.blockUI.defaults.css["background-color"]='';$.blockUI.defaults.overlayCSS["opacity"]='0.9';publicWidget.registry.PaymentPostProcessing=publicWidget.Widget.extend({selector:'div[name="o_payment_status"]',_pollCount:0,start:function(){this.displayLoading();this.poll();return this._super.apply(this,arguments);},startPolling:function(){var timeout=3000;if(this._pollCount>=10&&this._pollCount<20){timeout=10000;} 9323else if(this._pollCount>=20){timeout=30000;} 9324setTimeout(this.poll.bind(this),timeout);this._pollCount++;},poll:function(){var self=this;this._rpc({route:'/payment/status/poll',params:{'csrf_token':core.csrf_token,}}).then(function(data){if(data.success===true){self.processPolledData(data.display_values_list);} 9325else{switch(data.error){case"tx_process_retry":break;
9325case"no_tx_found":self.displayContent("payment.no_tx_found",{});break;default:self.displayContent("payment.exception",{exception_msg:data.error});break;}} 9326self.startPolling();}).guardedCatch(function(){self.displayContent("payment.rpc_error",{});self.startPolling();});},processPolledData:function(display_values_list){var render_values={'tx_draft':[],'tx_pending':[],'tx_authorized':[],'tx_done':[],'tx_cancel':[],'tx_error':[],};display_values_list.forEach(function(display_values){var key='tx_'+display_values.state;if(key in render_values){if(display_values["display_message"]){display_values.display_message=Markup(display_values.display_message)} 9327render_values[key].push(display_values);}});function countTxInState(states){var nbTx=0;for(var prop in render_values){if(states.indexOf(prop)>-1&&render_values.hasOwnProperty(prop)){nbTx+=render_values[prop].length;}} 9328return nbTx;} 9329if(render_values['tx_done'].length===1&&render_values['tx_done'][0].is_post_processed){window.location=render_values['tx_done'][0].landing_route;return;} 9330if(countTxInState(['tx_done','tx_error','tx_pending','tx_authorized'])===1){var tx=render_values['tx_authorized'][0]||render_values['tx_error'][0];if(tx){window.location=tx.landing_route;return;}} 9331this.displayContent("payment.display_tx_list",render_values);},displayContent:function(xmlid,render_values){var html=core.qweb.render(xmlid,render_values);$.unblockUI();this.$el.find('div[name="o_payment_status_content"]').html(html);},displayLoading:function(){var msg=_t("We are processing your payment, please wait ...");$.blockUI({'message':'<h2 class="text-white"><img src="/web/static/img/spin.png" class="fa-pulse"/>'+' <br />'+msg+'</h2>'});},});return publicWidget.registry.PaymentPostProcessing;});; 9332 9333/* /account_payment/static/src/js/payment_form.js */ 9334odoo.define('account_payment.payment_form',require=>{'use strict';const checkoutForm=require('payment.checkout_form');const manageForm=require('payment.manage_form');const PaymentMixin={_prepareTransactionRouteParams:function(code,paymentOptionId,flow){const transactionRouteParams=this._super(...arguments);return{...transactionRouteParams,'invoice_id':this.txContext.invoiceId?parseInt(this.txContext.invoiceId):null,};},};checkoutForm.include(PaymentMixin);manageForm.include(PaymentMixin);});; 9335 9336/* /sale/static/src/js/sale_portal_sidebar.js */ 9337odoo.define('sale.SalePortalSidebar',function(require){'use strict';var publicWidget=require('web.public.widget');var PortalSidebar=require('portal.PortalSidebar');publicWidget.registry.SalePortalSidebar=PortalSidebar.extend({selector:'.o_portal_sale_sidebar',init:function(parent,options){this._super.apply(this,arguments);this.authorizedTextTag=['em','b','i','u'];this.spyWatched=$('body[data-target=".navspy"]');},start:function(){var def=this._super.apply(this,arguments);var $spyWatcheElement=this.$el.find('[data-id="portal_sidebar"]');this._setElementId($spyWatcheElement);this._generateMenu();if($.bbq.getState('allow_payment')==='yes'&&this.$('#o_sale_portal_paynow').length){this.el.querySelector('#o_sale_portal_paynow').click();$.bbq.removeState('allow_payment');} 9338return def;},_setElementId:function(prefix,$el){var id=_.uniqueId(prefix);this.spyWatched.find($el).attr('id',id);return id;}
9338,_generateMenu:function(){var self=this,lastLI=false,lastUL=null,$bsSidenav=this.$el.find('.bs-sidenav');$("#quote_content [id^=quote_header_], #quote_content [id^=quote_]",this.spyWatched).attr("id","");_.each(this.spyWatched.find("#quote_content h2, #quote_content h3"),function(el){var id,text;switch(el.tagName.toLowerCase()){case"h2":id=self._setElementId('quote_header_',el);text=self._extractText($(el));if(!text){break;} 9339lastLI=$("<li class='nav-item'>").append($('<a class="nav-link" style="max-width: 200px;" href="#'+id+'"/>').text(text)).appendTo($bsSidenav);lastUL=false;break;case"h3":id=self._setElementId('quote_',el);text=self._extractText($(el));if(!text){break;} 9340if(lastLI){if(!lastUL){lastUL=$("<ul class='nav flex-column'>").appendTo(lastLI);} 9341$("<li class='nav-item'>").append($('<a class="nav-link" style="max-width: 200px;" href="#'+id+'"/>').text(text)).appendTo(lastUL);} 9342break;} 9343el.setAttribute('data-anchor',true);});this.trigger_up('widgets_start_request',{$target:$bsSidenav});},_extractText:function($node){var self=this;var rawText=[];_.each($node.contents(),function(el){var current=$(el);if($.trim(current.text())){var tagName=current.prop("tagName");if(_.isUndefined(tagName)||(!_.isUndefined(tagName)&&_.contains(self.authorizedTextTag,tagName.toLowerCase()))){rawText.push($.trim(current.text()));}}});return rawText.join(' ');},});});; 9344 9345/* /sale/static/src/js/sale_portal.js */ 9346odoo.define('@sale/js/sale_portal',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');require("portal.portal");publicWidget.registry.PortalHomeCounters.include({_getCountersAlwaysDisplayed(){return this._super(...arguments).concat(['quotation_count','order_count']);},});return __exports;});; 9347 9348/* /sale/static/src/js/payment_form.js */ 9349odoo.define('sale.payment_form',require=>{'use strict';const checkoutForm=require('payment.checkout_form');const manageForm=require('payment.manage_form');const salePaymentMixin={_prepareTransactionRouteParams:function(code,paymentOptionId,flow){const transactionRouteParams=this._super(...arguments);return{...transactionRouteParams,'sale_order_id':this.txContext.saleOrderId?parseInt(this.txContext.saleOrderId):undefined,};},};checkoutForm.include(salePaymentMixin);manageForm.include(salePaymentMixin);});; 9350 9351/* /sale_management/static/src/js/sale_management.js */ 9352odoo.define('sale_management.sale_management',function(require){'use strict';var publicWidget=require('web.public.widget');publicWidget.registry.SaleUpdateLineButton=publicWidget.Widget.extend({selector:'.o_portal_sale_sidebar',events:{'click a.js_update_line_json':'_onClickOptionQuantityButton','click a.js_add_optional_products':'_onClickAddOptionalProduct','change .js_quantity':'_onChangeOptionQuantity',},async start(){await this._super(...arguments);this.orderDetail=this.$el.find('table#sales_order_table').data();},_callUpdateLineRoute(order_id,params){return this._rpc({route:"/my/orders/"+order_id+"/update_line_dict",params:params,});},_refreshOrderUI(data){window.location.reload();},async _onChangeOptionQuantity(ev){ev.preventDefault();let self=this,$target=$(ev.currentTarget),quantity=parseInt($target.val());const result=await this._callUpdateLineRoute(self.orderDetail.orderId,{'line_id':$target.data('lineId'),'input_quantity':quantity>=0?quantity:false,'access_token':self.orderDetail.token});this._refreshOrderUI(result);},async _onClickOptionQuantityButton(ev){ev.preventDefault();let self=this,$target=$(ev.currentTarget);const result=await this._callUpdateLineRoute(self.orderDetail.orderId,{'line_id':$target.data('lineId'),'remove':$target.data('remove'),'unlink':$target.data('unlink'),'access_token':self.orderDetail.token});this._refreshOrderUI(result);},_onClickAddOptionalProduct(ev){ev.preventDefault();let self=this,$target=$(ev.currentTarget);$target.css('pointer-events','none');this._rpc({route:"/my/orders/"+self.orderDetail.orderId+"/add_option/"+$target.data('optionId'),params:{access_token:self.orderDetail.token}}).then((data)=>{this._refreshOrderUI(data);});},});});; 9353 9354/* /google_recaptcha/static/src/js/recaptcha.js */ 9355odoo.define('google_recaptcha.ReCaptchaV3',function(require){"use strict";const Class=require('web.Class');const core=require('web.core');const{session}=require('@web/session');const{loadJS}=require('@web/core/assets');const _t=core._t;const ReCaptcha=Class.extend({init:function(){this._publicKey=session.recaptcha_public_key;},loadLibs:function(){if(this._publicKey){this._recaptchaReady=loadJS(`https://www.recaptcha.net/recaptcha/api.js?render=${encodeURIComponent(this._publicKey)}`).then(()=>new Promise(resolve=>window.grecaptcha.ready(()=>resolve())));return this._recaptchaReady.then(()=>!!document.querySelector('.grecaptcha-badge'));} 9356return false;},getToken:async function(action){if(!this._publicKey){return{message:_t("No recaptcha site key set."),};} 9357await this._recaptchaReady;try{return{token:await window.grecaptcha.execute(this._publicKey,{action:action})};}
9357catch(_e){return{error:_t("The recaptcha site key is invalid."),};}},});return{ReCaptcha:ReCaptcha,};});; 9358 9359/* /google_recaptcha/static/src/js/signup.js */ 9360odoo.define('google_recaptcha.signup',function(require){'use strict';const publicWidget=require('web.public.widget');const{ReCaptcha}=require('google_recaptcha.ReCaptchaV3');const CaptchaFunctionality={events:{submit:"_onSubmit",},init(){this._super(...arguments);this._recaptcha=new ReCaptcha();},async willStart(){return this._recaptcha.loadLibs();},_onSubmit(ev){if(this._recaptcha._publicKey&&!this.$el.find("input[name='recaptcha_token_response']").length){ev.preventDefault();this._recaptcha.getToken(this.tokenName).then((tokenCaptcha)=>{this.$el.append(`<input name="recaptcha_token_response" type="hidden" value="${tokenCaptcha.token}"/>`,);this.$el.submit();});}},};publicWidget.registry.SignupCaptcha=publicWidget.Widget.extend({...CaptchaFunctionality,selector:".oe_signup_form",tokenName:"signup",});publicWidget.registry.ResetPasswordCaptcha=publicWidget.Widget.extend({...CaptchaFunctionality,selector:".oe_reset_password_form",tokenName:"password_reset",});});; 9361 9362/* /website/static/src/core/errors/beforeunload_error_handler.js */ 9363odoo.define('@website/core/errors/beforeunload_error_handler',async function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const{registry}=require("@web/core/registry");const errorHandlerRegistry=registry.category("error_handlers");let isUnloadingPage=false;window.addEventListener("beforeunload",()=>{isUnloadingPage=true;browser.setTimeout(()=>(isUnloadingPage=false),10000);});function beforeUnloadHandler(env,error){if(isUnloadingPage){error.event.preventDefault();return true;} 9364return false;} 9365errorHandlerRegistry.add("beforeUnloadHandler",beforeUnloadHandler,{sequence:1});return __exports;});; 9366 9367/* /website/static/src/js/utils.js */ 9368odoo.define('website.utils',function(require){'use strict';var core=require('web.core');const{qweb,_t}=core;function loadAnchors(url,body){return new Promise(function(resolve,reject){if(url===window.location.pathname||url[0]==='#'){resolve(body?body:document.body.outerHTML);}else if(url.length&&!url.startsWith("http")){$.get(window.location.origin+url).then(resolve,reject);}else{resolve();}}).then(function(response){const anchors=_.map($(response).find('[id][data-anchor=true]'),function(el){return'#'+el.id;});if(!anchors.includes('#top')){anchors.unshift('#top');} 9369if(!anchors.includes('#bottom')){anchors.push('#bottom');} 9370return anchors;}).catch(error=>{console.debug(error);return[];});} 9371function autocompleteWithPages(self,$input,options){$.widget("website.urlcomplete",$.ui.autocomplete,{options:options||{},_create:function(){this._super();this.widget().menu("option","items","> :not(.ui-autocomplete-category)");},_renderMenu:function(ul,items){const self=this;items.forEach(item=>{if(item.separator){self._renderSeparator(ul,item);} 9372else{self._renderItem(ul,item);}});},_renderSeparator:function(ul,item){return $("<li class='ui-autocomplete-category fw-bold text-capitalize p-2'>").append(`<div>${item.separator}</div>`).appendTo(ul);},_renderItem:function(ul,item){return $("<li>").data('ui-autocomplete-item',item).append(`<div>${item.label}</div>`).appendTo(ul);},});$input.urlcomplete({source:function(request,response){if(request.term[0]==='#'){loadAnchors(request.term,options&&options.body).then(function(anchors){response(anchors);});}else if(request.term.startsWith('http')||request.term.length===0){response();}else{return self._rpc({route:'/website/get_suggested_links',params:{needle:request.term,limit:15,}}).then(function(res){let choices=res.matching_pages;res.others.forEach(other=>{if(other.values.length){choices=choices.concat([{separator:other.title}],other.values,);}});response(choices);});}},select:function(ev,ui){ev.target.value=ui.item.value;self.trigger_up('website_url_chosen');ev.preventDefault();},});} 9373function onceAllImagesLoaded($element,$excluded){var defs=_.map($element.find('img').addBack('img'),function(img){if(img.complete||$excluded&&($excluded.is(img)||$excluded.has(img).length)){return;} 9374var def=new Promise(function(resolve,reject){$(img).one('load',function(){resolve();});});return def;});return Promise.all(defs);} 9375function prompt(options,_qweb){if(typeof options==='string'){options={text:options};} 9376if(_.isUndefined(_qweb)){_qweb='website.prompt';} 9377options=_.extend({window_title:'',field_name:'','default':'',init:function(){},btn_primary_title:_t('Create'),btn_secondary_title:_t('Cancel'),},options||{});var type=_.intersection(Object.keys(options),['input','textarea','select']);type=type.length?type[0]:'input';options.field_type=type;options.field_name=options.field_name||options[type];var def=new Promise(function(resolve,reject){var dialog=$(qweb.render(_qweb,options)).appendTo('body');options.$dialog=dialog;var field=dialog.find(options.field_type).first();field.val(options['default']);field.fillWith=function(data){if(field.is('select')){var select=field[0];data.forEach(function(item){select.options[select.options.length]=new window.Option(item[1],item[0]);});}else{field.val(data);}};var init=options.init(field,dialog);Promise.resolve(init).then(function(fill){if(fill){field.fillWith(fill);} 9378dialog.modal('show');field.focus();dialog.on('click','.btn-primary',function(){var backdrop=$('.modal-backdrop');resolve({val:field.val(),field:field,dialog:dialog});dialog.modal('hide').remove();backdrop.remove();});});dialog.on('hidden.bs.modal',function(){var backdrop=$('.modal-backdrop');reject();dialog.remove();backdrop.remove();});if(field.is('input[type="text"], select')){field.keypress(function(e){if(e.which===13){e.preventDefault();dialog.find('.btn-primary').trigger('click');}});}});return def;} 9379function websiteDomain(self){var websiteID;self.trigger_up('context_get',{callback:function(ctx){websiteID=ctx['website_id'];},});return['|',['website_id','=',false],['website_id','=',websiteID]];} 9380function isHTTPSorNakedDomainRedirection(url1,url2){try{url1=new URL(url1).host;url2=new URL(url2).host;}catch{return false;} 9381return url1===url2||url1.replace(/^www\./,'')===url2.replace(/^www\./,'');} 9382function sendRequest(route,params){function _addInput(form,name,value){let param=document.createElement('input');param.setAttribute('type','hidden');param.setAttribute('name',name);param.setAttribute('value',value);form.appendChild(param);} 9383let form=document.createElement('form');form.setAttribute('action',route);form.setAttribute('method',params.method||'POST');const isInIframe=window.frameElement&&window.frameElement.classList.contains('o_iframe');if(isInIframe){form.setAttribute('target','_top');} 9384if(core.csrf_token){_addInput(form,'csrf_token',core.csrf_token);} 9385for(const key in params){const value=params[key];if(Array.isArray(value)&&value.length){for(const val of value){_addInput(form,key,val);}}else{_addInput(form,key,value);}} 9386document.body.appendChild(form);form.submit();} 9387async function svgToPNG(src){function checkImg(imgEl){return(imgEl.naturalHeight!==0);} 9388function toPNGViaCanvas(imgEl){const canvas=document.createElement('canvas');canvas.width=imgEl.width;canvas.height=imgEl.height;canvas.getContext('2d').drawImage(imgEl,0,0);return canvas.toDataURL('image/png');} 9389if(src instanceof HTMLImageElement){const loadedImgEl=src;if(checkImg(loadedImgEl)){return toPNGViaCanvas(loadedImgEl);} 9390src=loadedImgEl.src;} 9391return new Promise(resolve=>{const imgEl=new Image();imgEl.onload=()=>
9391{if(checkImg(imgEl)){resolve(imgEl);return;} 9392imgEl.height=1000;imgEl.style.opacity=0;document.body.appendChild(imgEl);const request=new XMLHttpRequest();request.open('GET',imgEl.src,true);request.onload=()=>{const parser=new DOMParser();const result=parser.parseFromString(request.responseText,'text/xml');const svgEl=result.getElementsByTagName("svg")[0];svgEl.setAttribute('width',imgEl.width);svgEl.setAttribute('height',imgEl.height);imgEl.remove();const svg64=btoa(new XMLSerializer().serializeToString(svgEl));const finalImg=new Image();finalImg.onload=()=>{resolve(finalImg);};finalImg.src=`data:image/svg+xml;base64,${svg64}`;};request.send();};imgEl.src=src;}).then(loadedImgEl=>toPNGViaCanvas(loadedImgEl));} 9393function generateGMapIframe(){const iframeEl=document.createElement('iframe');iframeEl.classList.add('s_map_embedded','o_not_editable');iframeEl.setAttribute('width','100%');iframeEl.setAttribute('height','100%');iframeEl.setAttribute('frameborder','0');iframeEl.setAttribute('scrolling','no');iframeEl.setAttribute('marginheight','0');iframeEl.setAttribute('marginwidth','0');iframeEl.setAttribute('src','about:blank');return iframeEl;} 9394function generateGMapLink(dataset){return'https://maps.google.com/maps?q='+encodeURIComponent(dataset.mapAddress) 9395+'&t='+encodeURIComponent(dataset.mapType) 9396+'&z='+encodeURIComponent(dataset.mapZoom) 9397+'&ie=UTF8&iwloc=&output=embed';} 9398function getParsedDataFor(formId,parentEl){const dataForEl=parentEl.querySelector(`[data-for='${formId}']`);if(!dataForEl){return;} 9399return JSON.parse(dataForEl.dataset.values.replace(/([,:\[]\s*)True/g,'$1true').replace(/([,:\[]\s*)(False|None)/g,'$1""').replace(/'(\s*[,:\]}])/g,'"$1').replace(/([{\[:,]\s*)'/g,'$1"'));} 9400function cloneContentEls(content,keepScripts=false){let copyFragment;if(typeof content==="string"){copyFragment=new Range().createContextualFragment(content);}else{copyFragment=new DocumentFragment();const els=[...content.children].map(el=>el.cloneNode(true));copyFragment.append(...els);} 9401if(!keepScripts){copyFragment.querySelectorAll("script").forEach(scriptEl=>scriptEl.remove());} 9402return copyFragment;} 9403return{loadAnchors:loadAnchors,autocompleteWithPages:autocompleteWithPages,onceAllImagesLoaded:onceAllImagesLoaded,prompt:prompt,sendRequest:sendRequest,websiteDomain:websiteDomain,isHTTPSorNakedDomainRedirection:isHTTPSorNakedDomainRedirection,svgToPNG:svgToPNG,generateGMapIframe:generateGMapIframe,generateGMapLink:generateGMapLink,getParsedDataFor:getParsedDataFor,cloneContentEls:cloneContentEls,};});; 9404 9405/* /website/static/src/js/tours/tour_utils.js */ 9406odoo.define("website.tour_utils",function(require){"use strict";const{_t}=require("web.core");const{Markup}=require('web.utils');var tour=require("web_tour.tour");const{getCookie}=require('web.utils.cookies');function addMedia(position="right"){return{trigger:`.modal-content footer .btn-primary`,content:Markup(_t("<b>Add</b> the selected image.")),position:position,run:"click",};} 9407function assertCssVariable(variableName,variableValue,trigger='iframe body'){return{content:`Check CSS variable ${variableName}=${variableValue}`,trigger:trigger,auto:true,run:function(){const styleValue=getComputedStyle(this.$anchor[0]).getPropertyValue(variableName);if((styleValue&&styleValue.trim().replace(/["']/g,''))!==variableValue.trim().replace(/["']/g,'')){throw new Error(`Failed precondition: ${variableName}=${styleValue} (should be ${variableValue})`);}},};} 9408function assertPathName(pathName,trigger){return{content:`Check if we have been redirected to ${pathName}`,trigger:trigger,run:()=>{if(!window.location.pathname.startsWith(pathName)){console.error(`We should be on ${pathName}.`);}}};} 9409function changeBackground(snippet,position="bottom"){return{trigger:".o_we_customize_panel .o_we_bg_success",content:Markup(_t("<b>Customize</b> any block through this menu. Try to change the background image of this block.")),position:position,run:"click",};} 9410function changeBackgroundColor(position="bottom"){return{trigger:".o_we_customize_panel .o_we_color_preview",content:Markup(_t("<b>Customize</b> any block through this menu. Try to change the background color of this block.")),position:position,run:"click",};}
9411function selectColorPalette(position="left"){return{trigger:".o_we_customize_panel .o_we_so_color_palette we-selection-items",alt_trigger:".o_we_customize_panel .o_we_color_preview",content:Markup(_t(`<b>Select</b> a Color Palette.`)),position:position,run:'click',location:position==='left'?'#oe_snippets':undefined,};} 9412function changeColumnSize(position="right"){return{trigger:`iframe .oe_overlay.ui-draggable.o_we_overlay_sticky.oe_active .o_handle.e`,content:Markup(_t("<b>Slide</b> this button to change the column size.")),position:position,};} 9413function changeIcon(snippet,index=0,position="bottom"){return{trigger:`#wrapwrap .${snippet.id} i:eq(${index})`,extra_trigger:"body.editor_enable",content:Markup(_t("<b>Double click on an icon</b> to change it with one of your choice.")),position:position,run:"dblclick",};} 9414function changeImage(snippet,position="bottom"){return{trigger:snippet.id?`#wrapwrap .${snippet.id} img`:snippet,extra_trigger:"body.editor_enable",content:Markup(_t("<b>Double click on an image</b> to change it with one of your choice.")),position:position,run:"dblclick",};} 9415function changeOption(optionName,weName='',optionTooltipLabel='',position="bottom",allowPalette=false){const noPalette=allowPalette?'':'.o_we_customize_panel:not(:has(.o_we_so_color_palette.o_we_widget_opened))';const option_block=`${noPalette} we-customizeblock-option[class='snippet-option-${optionName}']`;return{trigger:`${option_block} ${weName}, ${option_block} [title='${weName}']`,content:Markup(_.str.sprintf(_t("<b>Click</b> on this option to change the %s of the block."),optionTooltipLabel)),position:position,run:"click",};} 9416function selectNested(trigger,optionName,alt_trigger=null,optionTooltipLabel='',position="top",allowPalette=false){const noPalette=allowPalette?'':'.o_we_customize_panel:not(:has(.o_we_so_color_palette.o_we_widget_opened))';const option_block=`${noPalette} we-customizeblock-option[class='snippet-option-${optionName}']`;return{trigger:trigger,content:Markup(_.str.sprintf(_t("<b>Select</b> a %s."),optionTooltipLabel)),alt_trigger:alt_trigger==null?undefined:`${option_block} ${alt_trigger}`,position:position,run:'click',location:position==='left'?'#oe_snippets':undefined,};} 9417function changePaddingSize(direction){let paddingDirection="n";let position="top";if(direction==="bottom"){paddingDirection="s";position="bottom";} 9418return{trigger:`iframe .oe_overlay.ui-draggable.o_we_overlay_sticky.oe_active .o_handle.${paddingDirection}`,content:Markup(_.str.sprintf(_t("<b>Slide</b> this button to change the %s padding"),direction)),consumeEvent:'mousedown',position:position,};} 9419function clickOnEdit(position="bottom"){return{trigger:".o_menu_systray .o_edit_website_container a",content:Markup(_t("<b>Click Edit</b> to start designing your homepage.")),extra_trigger:"body:not(.editor_has_snippets)",position:position,timeout:30000,};} 9420function clickOnElement(elementName,selector){return{content:`Clicking on the ${elementName}`,trigger:selector,run:'click'};} 9421function clickOnEditAndWaitEditMode(position="bottom"){return[{content:_t("<b>Click Edit</b> to start designing your homepage."),trigger:".o_menu_systray .o_edit_website_container a",position:position,},{content:"Check that we are in edit mode",trigger:".o_website_preview.editor_enable.editor_has_snippets",run:()=>null,}];} 9422function clickOnSnippet(snippet,position="bottom"){const trigger=snippet.id?`#wrapwrap .${snippet.id}`:snippet;return{trigger:`iframe ${trigger}`,extra_trigger:"body.editor_has_snippets",content:Markup(_t("<b>Click on a snippet</b> to access its options menu.")),position:position,run:"click",};} 9423function clickOnSave(position="bottom"){return[{trigger:"div:not(.o_loading_dummy) > #oe_snippets button[data-action=\"save\"]:not([disabled])",extra_trigger:"body:not(:has(.o_dialog)) #oe_snippets:not(:has(.o_we_already_dragging))",in_modal:false,content:Markup(_t("Good job! It's time to <b>Save</b> your work.")),position:position,},{trigger:'iframe body:not(.editor_enable)',noPrepend:true,auto:true,run:()=>null,}];} 9424function clickOnText(snippet,element,position="bottom"){return{trigger:snippet.id?`iframe #wrapwrap .${snippet.id} ${element}`:snippet,extra_trigger:"iframe body.editor_enable",content:Markup(_t("<b>Click on a text</b> to start editing it.")),position:position,run:"text",consumeEvent:"click",};} 9425function dragNDrop(snippet,position="bottom"){return{trigger:`#oe_snippets .oe_snippet[name="${snippet.name}"] .oe_snippet_thumbnail:not(.o_we_already_dragging)`,extra_trigger:".o_website_preview.editor_enable.editor_has_snippets",content:Markup(_.str.sprintf(_t("Drag the <b>%s</b> building block and drop it at the bottom of the page."),snippet.name)),position:position,run:"drag_and_drop iframe #wrapwrap > footer",};} 9426function goBackToBlocks(position="bottom"){return{trigger:'.o_we_add_snippet_btn',content:_t("Click here to go back to block tab."),position:position,run:"click",};} 9427function goToTheme(position="bottom"){return{trigger:'.o_we_customize_theme_btn',extra_trigger:'#oe_snippets.o_loaded',content:_t("Go to the Theme tab"),position:position,run:"click",};} 9428function selectHeader(position="bottom"){return{trigger:`iframe header#top`,content:Markup(_t(`<b>Click</b> on this header to configure it.`)),position:position,run:"click",};} 9429function selectSnippetColumn(snippet,index=0,position="bottom"){return{trigger:`iframe #wrapwrap .${snippet.id} .row div[class*="col-lg-"]:eq(${index})`,content:Markup(_t("<b>Click</b> on this column to access its options.")),position:position,run:"click",};} 9430function prepend_trigger(steps,prepend_text=''){for(const step of steps){if(!step.noPrepend&&prepend_text){step.trigger=prepend_text+step.trigger;}} 9431return steps;} 9432function getClientActionUrl(path,edition){let url=`/web#action=website.website_preview`;if(path){url+=`&path=${encodeURIComponent(path)}`;} 9433if(edition){url+='&enable_editor=1';} 9434return url;} 9435function clickOnExtraMenuItem(stepOptions,backend=false){return Object.assign({},{content:"Click on the extra menu dropdown toggle if it is there",trigger:`${backend ? "iframe" : ""} #top_menu`,run:function(){const extraMenuButton=this.$anchor[0].querySelector('.o_extra_menu_items a.nav-link');if(extraMenuButton&&!extraMenuButton.classList.contains("show")){extraMenuButton.click();}},},stepOptions);} 9436function registerWebsitePreviewTour(name,options,steps){const tourSteps=[...steps];const url=getClientActionUrl(options.url,!!options.edition);if(options.edition){tourSteps.unshift({content:"Wait for the edit mode to be started",trigger:'.o_website_preview.editor_enable.editor_has_snippets',timeout:30000,auto:true,run:()=>{},});}else{tourSteps[0].timeout=20000;} 9437return tour.register(name,Object.assign({},options,{url}),tourSteps);} 9438function registerThemeHomepageTour(name,steps){return registerWebsitePreviewTour(name,{url:'/',edition:true,sequence:1010,saveAs:"homepage",},prepend_trigger(steps.concat(clickOnSave()),".o_website_preview[data-view-xmlid='website.homepage'] "));} 9439function registerBackendAndFrontendTour(name,options,steps){if(window.location.pathname==='/web'){const newSteps=[];for(const step of steps){const newStep=Object.assign({},step);newStep.trigger=`iframe ${step.trigger}`;if(step.extra_trigger){newStep.extra_trigger=`iframe ${step.extra_trigger}`;} 9440newSteps.push(newStep);} 9441return registerWebsitePreviewTour(name,options,newSteps);} 9442return tour.register(name,{url:options.url,},steps);} 9443function selectElementInWeSelectWidget(widgetName,elementName,searchNeeded=false){const we_select=`we-select[data-name=${widgetName}]`;const steps=[{content:`Clicking on the ${widgetName} toggler in vue to select ${elementName}`,trigger:`${we_select} we-toggler`,run:"click",},];if(searchNeeded){steps.push({content:`Inputing ${elementName} in m2o widget search`,trigger:`${we_select} div.o_we_m2o_search input`,run:`text ${elementName}`,});} 9444steps.push(clickOnElement(`${elementName} in the ${widgetName} widget`,`we-select[data-name=${widgetName}] we-button:contains(${elementName})`));steps.push({content:"Check we-select is set",trigger:`we-select[data-name=${widgetName}]:contains(${elementName})`,async run(){await new Promise((resolve)=>setTimeout(resolve,300));}});return steps;} 9445function switchWebsite(websiteId,websiteName){return[{content:`Click on the website switch to switch to website '${websiteName}'`,trigger:'.o_website_switcher_container button',},{content:`Switch to website '${websiteName}'`,extra_trigger:`iframe html:not([data-website-id="${websiteId}"])`,trigger:`.o_website_switcher_container .dropdown-item[data-website-id=${websiteId}]:contains("${websiteName}")`,},{content:"Wait for the iframe to be loaded",timeout:20000,trigger:`iframe html[data-website-id="${websiteId}"]`,isCheck:true,}];} 9446function testSwitchWebsite(websiteName){const websiteIdMapping=JSON.parse(getCookie('websiteIdMapping')||'{}');const websiteId=websiteIdMapping[websiteName];return switchWebsite(websiteId,websiteName)} 9447return{addMedia,assertCssVariable,assertPathName,changeBackgroun
9447d,changeBackgroundColor,changeColumnSize,changeIcon,changeImage,changeOption,changePaddingSize,clickOnEdit,clickOnEditAndWaitEditMode,clickOnElement,clickOnExtraMenuItem,clickOnSave,clickOnSnippet,clickOnText,dragNDrop,getClientActionUrl,goBackToBlocks,goToTheme,registerBackendAndFrontendTour,registerThemeHomepageTour,registerWebsitePreviewTour,selectColorPalette,selectElementInWeSelectWidget,selectHeader,selectNested,selectSnippetColumn,switchWebsite,testSwitchWebsite};});; 9448 9449/* /website/static/src/js/content/website_root.js */ 9450odoo.define('@website/js/content/website_root',async function(require){'use strict';let __exports={};const{loadJS}=require("@web/core/assets");const{_t}=require('web.core');const KeyboardNavigationMixin=require('web.KeyboardNavigationMixin');const{Markup}=require('web.utils');const session=require('web.session');const publicRootData=require('web.public.root');require("web.zoomodoo");const WebsiteRoot=__exports.WebsiteRoot=publicRootData.PublicRoot.extend(KeyboardNavigationMixin,{events:_.extend({},KeyboardNavigationMixin.events,publicRootData.PublicRoot.prototype.events||{},{'click .js_change_lang':'_onLangChangeClick','click .js_publish_management .js_publish_btn':'_onPublishBtnClick','shown.bs.modal':'_onModalShown',}),custom_events:_.extend({},publicRootData.PublicRoot.prototype.custom_events||{},{'gmap_api_request':'_onGMapAPIRequest','gmap_api_key_request':'_onGMapAPIKeyRequest','ready_to_clean_for_save':'_onWidgetsStopRequest','seo_object_request':'_onSeoObjectRequest','will_remove_snippet':'_onWidgetsStopRequest',}),init(){this.isFullscreen=false;KeyboardNavigationMixin.init.call(this,{autoAccessKeys:false,skipRenderOverlay:true,});if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&document.querySelector('#wrapwrap')){document.querySelector('#wrapwrap').classList.add('o_safari_browser');} 9451return this._super(...arguments);},start:function(){KeyboardNavigationMixin.start.call(this);this.$('.zoomable img[data-zoom]').zoomOdoo();return this._super.apply(this,arguments);},destroy(){KeyboardNavigationMixin.destroy.call(this);return this._super(...arguments);},_getContext:function(context){var html=document.documentElement;return _.extend({'website_id':html.getAttribute('data-website-id')|0,},this._super.apply(this,arguments));},_getExtraContext:function(context){var html=document.documentElement;return _.extend({'editable':!!(html.dataset.editable||$('[data-oe-model]').length),'translatable':!!html.dataset.translatable,'edit_translations':!!html.dataset.edit_translations,},this._super.apply(this,arguments));},async _getGMapAPIKey(refetch){if(refetch||!this._gmapAPIKeyProm){this._gmapAPIKeyProm=new Promise(async resolve=>{const data=await this._rpc({route:'/website/google_maps_api_key',});resolve(JSON.parse(data).google_maps_api_key||'');});} 9452return this._gmapAPIKeyProm;},_getPublicWidgetsRegistry:function(options){var registry=this._super.apply(this,arguments);if(options.editableMode){return _.pick(registry,function(PublicWidget){return!PublicWidget.prototype.disabledInEditableMode;});} 9453return registry;},async _loadGMapAPI(editableMode,refetch){if(refetch||!this._gmapAPILoading){this._gmapAPILoading=new Promise(async resolve=>{const key=await this._getGMapAPIKey(refetch);window.odoo_gmap_api_post_load=(async function odoo_gmap_api_post_load(){await this._startWidgets(undefined,{editableMode:editableMode});resolve(key);}).bind(this);if(!key){if(!editableMode&&session.is_admin){const message=_t("Cannot load google map.");const urlTitle=_t("Check your configuration.");this.displayNotification({type:'warning',sticky:true,message:Markup`<div> 9454 <span>${message}</span><br/> 9455 <a href="/web#action=website.action_website_configuration">${urlTitle}</a> 9456 </div>`,});} 9457resolve(false);this._gmapAPILoading=false;return;} 9458await loadJS(`https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=odoo_gmap_api_post_load&key=${encodeURIComponent(key)}`);});} 9459return this._gmapAPILoading;},_onWidgetsStartRequest:function(ev){ev.data.options=_.clone(ev.data.options||{});ev.data.options.editableMode=ev.data.editableMode;this._super.apply(this,arguments);},_onLangChangeClick:function(ev){ev.preventDefault();if(document.body.classList.contains('editor_enable')){return;} 9460var $target=$(ev.currentTarget);var redirect={lang:encodeURIComponent($target.data('url_code')),url:encodeURIComponent($target.attr('href').replace(/[&?]edit_translations[^&?]+/,'')),hash:encodeURIComponent(window.location.hash)};
9460window.location.href=_.str.sprintf("/website/lang/%(lang)s?r=%(url)s%(hash)s",redirect);},async _onGMapAPIRequest(ev){ev.stopPropagation();const apiKey=await this._loadGMapAPI(ev.data.editableMode,ev.data.refetch);ev.data.onSuccess(apiKey);},async _onGMapAPIKeyRequest(ev){ev.stopPropagation();const apiKey=await this._getGMapAPIKey(ev.data.refetch);ev.data.onSuccess(apiKey);},_onSeoObjectRequest:function(ev){var res=this._unslugHtmlDataObject('seo-object');ev.data.callback(res);},_unslugHtmlDataObject:function(dataAttr){var repr=$('html').data(dataAttr);var match=repr&&repr.match(/(.+)\((-?\d+),(.*)\)/);if(!match){return null;} 9461return{model:match[1],id:match[2]|0,};},_onPublishBtnClick:function(ev){ev.preventDefault();if(document.body.classList.contains('editor_enable')){return;} 9462var $data=$(ev.currentTarget).parents(".js_publish_management:first");this._rpc({route:$data.data('controller')||'/website/publish',params:{id:+$data.data('id'),object:$data.data('object'),},}).then(function(result){$data.toggleClass("css_published",result).toggleClass("css_unpublished",!result);$data.find('input').prop("checked",result);$data.parents("[data-publish]").attr("data-publish",+result?'on':'off');});},_onModalShown:function(ev){$(ev.target).addClass('modal_shown');},_onKeyDown(ev){if(!session.user_id){return;} 9463if(ev.keyCode!==$.ui.keyCode.ESCAPE||!document.body.contains(ev.target)||ev.target.closest('.modal')){return KeyboardNavigationMixin._onKeyDown.apply(this,arguments);}},});__exports[Symbol.for("default")]={WebsiteRoot:WebsiteRoot,};return __exports;});odoo.define(`website.root`,async function(require){return require('@website/js/content/website_root')[Symbol.for("default")];});; 9464 9465/* /website/static/src/js/widgets/dialog.js */ 9466odoo.define('@website/js/widgets/dialog',async function(require){'use strict';let __exports={};const Dialog=require('web.Dialog');Dialog.include({_isBlocking(index,el){if(el.parentElement&&el.parentElement.id==='website_cookies_bar'&&!el.classList.contains('o_cookies_popup')){return false;} 9467return this._super(...arguments);},});return __exports;});; 9468 9469/* /website/static/src/js/content/compatibility.js */ 9470odoo.define('website.content.compatibility',function(require){'use strict';require('web.dom_ready');var browser=_.findKey($.browser,function(v){return v===true;});if($.browser.mozilla&&+$.browser.version.replace(/^([0-9]+\.[0-9]+).*/,'\$1')<20){browser='msie';} 9471browser+=(','+$.browser.version);var mobileRegex=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i;if(mobileRegex.test(window.navigator.userAgent.toLowerCase())){browser+=',mobile';} 9472document.documentElement.setAttribute('data-browser',browser);var htmlStyle=document.documentElement.style;var isFlexSupported=(('flexWrap'in htmlStyle)||('WebkitFlexWrap'in htmlStyle)||('msFlexWrap'in htmlStyle));if(!isFlexSupported){document.documentElement.setAttribute('data-no-flex','');} 9473return{browser:browser,isFlexSupported:isFlexSupported,};});; 9474 9475/* /website/static/src/js/content/menu.js */ 9476odoo.define('website.content.menu',function(require){'use strict';const config=require('web.config');var publicWidget=require('web.public.widget');var animations=require('website.content.snippets.animation');const extraMenuUpdateCallbacks=[];const weUtils=require('web_editor.utils');const dom=require('web.dom');const BaseAnimatedHeader=animations.Animation.extend({disabledInEditableMode:false,effects:[{startEvents:'scroll',update:'_updateHeaderOnScroll',},{startEvents:'resize',update:'_updateHeaderOnResize',}],init:function(){this._super(...arguments);this.fixedHeader=false;this.scrolledPoint=0;this.hasScrolled=false;this.closeOpenedMenus=false;this.scrollHeightTooShort=false;},start:function(){this.el.addEventListener("autoMoreMenu.willAdapt",()=>this.options.wysiwyg&&this.options.wysiwyg.odooEditor.unbreakableStepUnactive());this.$main=this.$el.next('main');this.isOverlayHeader=!!this.$el.closest('.o_header_overlay, .o_header_overlay_theme').length;this.$dropdowns=this.$el.find('.dropdown, .dropdown-menu');this.$navbarCollapses=this.$el.find('.navbar-collapse');this.$navbarCollapses.on('show.bs.collapse.BaseAnimatedHeader',function(){if(config.device.size_class<config.device.SIZES.LG){$(document.body).addClass('overflow-hidden');}}).on('hide.bs.collapse.BaseAnimatedHeader',function(){$(document.body).removeClass('overflow-hidden');});this._transitionCount=0;this.$el.on('odoo-transitionstart.BaseAnimatedHeader',()=>{this.el.classList.add('o_transitioning');this._adaptToHeaderChangeLoop(1);});this.$el.on('transitionend.BaseAnimatedHeader',()=>this._adaptToHeaderChangeLoop(-1));return this._super(...arguments);},destroy:function(){this._toggleFixedHeader(false);this.$el.removeClass('o_header_affixed o_header_is_scrolled o_header_no_transition o_transitioning');this.$navbarCollapses.off('.BaseAnimatedHeader');this.$el.off('.BaseAnimatedHeader');this._super(...arguments);},_adaptFixedHeaderPosition(){dom.compensateScrollbar(this.el,this.fixedHeader,false,'right');},_adaptToHeaderChange:function(){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();this._updateMainPaddingTop();this.el.classList.toggle('o_top_fixed_element',this._isShown());for(const callback of extraMenuUpdateCallbacks){callback();} 9477this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();},_adaptToHeaderChangeLoop:function(addCount=0){this._adaptToHeaderChange();this._transitionCount+=addCount;this._transitionCount=Math.max(0,this._transitionCount);if(this._transitionCount>0){window.requestAnimationFrame(()=>this._adaptToHeaderChangeLoop());if(addCount!==0){clearTimeout(this._changeLoopTimer);this._changeLoopTimer=setTimeout(()=>{this._adaptToHeaderChangeLoop(-this._transitionCount);},500);}}else{clearTimeout(this._changeLoopTimer);this.el.classList.remove('o_transitioning');}},_computeTopGap(){return 0;},_isShown(){return true;},_toggleFixedHeader:function(useFixed=true){this.fixedHeader=useFixed;this._adaptToHeaderChange();this.el.classList.toggle('o_header_affixed',useFixed);this._adaptFixedHeaderPosition();},_updateMainPaddingTop:function(){this.headerHeight=this.$el.outerHeight();this.topGap=this._computeTopGap();if(this.isOverlayHeader){return;} 9478this.$main.css('padding-top',this.fixedHeader?this.headerHeight:'');},_scrollHeightTooShort(){const scrollEl=$().getScrollingElement()[0];const remainingScroll=(scrollEl.scrollHeight-scrollEl.clientHeight)-this.scrolledPoint;const clonedHeader=this.el.cloneNode(true);scrollEl.append(clonedHeader);clonedHeader.classList.add('o_header_is_scrolled','o_header_affixed','o_header_no_transition');const endHeaderHeight=clonedHeader.offsetHeight;clonedHeader.remove();const heightDiff=this.headerHeight-endHeaderHeight;return heightDiff>0?remainingScroll<=heightDiff:false;},_updateHeaderOnScroll:function(scroll){if(!this.hasScrolled){this.hasScrolled=true;if(scroll>0){this.$el.addClass('o_header_no_transition');}}else{this.$el.removeClass('o_header_no_transition');this.closeOpenedMenus=true;} 9479const headerIsScrolled=(scroll>this.scrolledPoint);if(this.headerIsScrolled!==headerIsScrolled){this.scrollHeightTooShort=headerIsScrolled&&this._scrollHeightTooShort();if(!this.scrollHeightTooShort){this.el.classList.toggle('o_header_is_scrolled',headerIsScrolled);this.$el.trigger('odoo-transitionstart');this.headerIsScrolled=headerIsScrolled;}} 9480if(this.closeOpenedMenus){for(const dropdownMenuEl of this.$dropdowns){Dropdown.getOrCreateInstance(dropdownMenuEl.closest('.dropdown').querySelector('.dropdown-toggle')).hide();}}},_updateHeaderOnResize:function(){this._adaptFixedHeaderPosition();if(document.body.classList.contains('overflow-hidden')&&config.device.size_class>=config.device.SIZES.LG){document.body.classList.remove('overflow-hidden');this.$el.find('.navbar-collapse').removeClass('show');}},});publicWidget.registry.StandardAffixedHeader=BaseAnimatedHeader.extend({selector:'header.o_header_standard:not(.o_header_sidebar)',init:function(){this._super(...arguments);this.fixedHeaderShow=false;this.scrolledPoint=300;},start:function(){this.headerHeight=this.$el.outerHeight();return this._super.apply(this,arguments);},destroy(){this.$el.css('transform','');this._super(...arguments);},_isShown(){return!this.fixedHeader||this.fixedHeaderShow;},_updateHeaderOnScroll:function(scroll){this._super(...arguments);const mainPosScrolled=(scroll>this.headerHeight+this.topGap);const reachPosScrolled=(scroll>this.scrolledPoint+this.topGap)&&!this.scrollHeightTooShort;const fixedUpdate=(this.fixedHeader!==mainPosScrolled);const showUpdate=(this.fixedHeaderShow!==reachPosScrolled);if(fixedUpdate||showUpdate){this.$el.css('transform',reachPosScrolled?`translate(0, -${this.topGap}px)`:mainPosScrolled?'translate(0, -100%)':'');void this.$el[0].offsetWidth;} 9481this.fixedHeaderShow=reachPosScrolled;if(fixedUpdate){this._toggleFixedHeader(mainPosScrolled);}else if(showUpdate){this._adaptToHeaderChange();}},});publicWidget.registry.FixedHeader=BaseAnimatedHeader.extend({selector:'header.o_header_fixed:not(.o_header_sidebar)',_updateHeaderOnScroll:function(scroll){this._super(...arguments);if(scroll>(this.scrolledPoint+this.topGap)){if(!this.$el.hasClass('o_header_affixed')){this.$el.css('transform',`translate(0, -${this.topGap}px)`);void this.$el[0].offsetWidth;this._toggleFixedHeader(true);}}else{this._toggleFixedHeader(false);void this.$el[0].offsetWidth;this.$el.css('transform','');}},});const BaseDisappearingHeader=publicWidget.registry.FixedHeader.extend({init:function(){this._super(...arguments);this.scrollingDownwards=true;this.hiddenHeader=false;this.position=0;this.atTop=true;this.checkPoint=0;this.scrollOffsetLimit=200;},destroy:function(){this._showHeader();this._super.apply(this,arguments);},_hideHeader:function(){this.$el.trigger('odoo-transitionstart');},_isShown(){return!this.fixedHeader||!this.hiddenHeader;},_showHeader:function(){this.$el.trigger('odoo-transitionstart');},_updateHeaderOnScroll:function(scroll){this._super(...arguments);const scrollingDownwards=(scroll>this.position);const atTop=(scroll<=0);if(scrollingDownwards!==this.scrollingDownwards){this.checkPoint=scroll;} 9482this.scrollingDownwards=scrollingDownwards;this.position=scroll;this.atTop=atTop;if(scrollingDownwards){if(!this.hiddenHeader&&scroll-this.checkPoint>(this.scrollOffsetLimit+this.topGap)){this.hiddenHeader=true;this._hideHeader();}}else{if(this.hiddenHeader&&scroll-this.checkPoint<-(this.scrollOffsetLimit+this.topGap)/2){this.hiddenHeader=false;this._showHeader();}} 9483if(atTop&&!this.atTop){this._showHeader();}},});publicWidget.registry.DisappearingHeader=BaseDisappearingHeader.extend({selector:'header.o_header_disappears:not(.o_header_sidebar)',_hideHeader:function(){this._super(...arguments);this.$el.css('transform','translate(0, -100%)');},_showHeader:function(){this._super(...arguments);this.$el.css('transform',this.atTop?'':`translate(0, -${this.topGap}px)`);},});publicWidget.registry.FadeOutHeader=BaseDisappearingHeader.extend({selector:'header.o_header_fade_out:not(.o_header_sidebar)',_hideHeader:function(){this._super(...arguments);this.$el.stop(false,true).fadeOut();},_showHeader:function(){this._super(...arguments);this.$el.css('transform',this.atTop?'':`translate(0, -${this.topGap}px)`);this.$el.stop(false,true).fadeIn();},});publicWidget.registry.menuDirection=publicWidget.Widget.extend({selector:'header .navbar .nav',disabledInEditableMode:false,events:{'show.bs.dropdown':'_onDropdownShow',},start:function(){this.defaultAlignment=this.$el.is('.ms-auto, .ms-auto ~ *')?'end':'start';this.isRtl=!!this.el.closest('#wrapwrap.o_rtl');return this._super.apply(this,arguments);},_checkOpening:function(alignment,liOffset,liWidth,menuWidth,pageWidth){if(alignment==='start'&&!this.isRtl||alignment==='end'&&this.isRtl){return(liOffset+menuWidth<=pageWidth);}else{return(liOffset+liWidth-menuWidth>=0);}},_onDropdownShow:function(ev){const $dropdown=$(ev.target).closest('.dropdown, .dropup');var $menu=$dropdown.children('.dropdown-menu');var liOffset=$dropdown.offset().left;var liWidth=$dropdown.outerWidth();var menuWidth=$menu.outerWidth();var pageWidth=$('#wrapwrap').outerWidth();$menu.removeClass('dropdown-menu-start dropdown-menu-end');var alignment=this.defaultAlignment;if($dropdown.nextAll(':visible').length===0){alignment='end';} 9484for(var i=0;i<2;i++){if(!this._checkOpening(alignment,liOffset,liWidth,menuWidth,pageWidth)){alignment=(alignment==='start'?'end':'start');}} 9485$menu.addClass('dropdown-menu-'+alignment);},});publicWidget.registry.hoverableDropdown=animations.Animation.extend({selector:'header.o_hoverable_dropdown',disabledInEditableMode:false,effects:[{startEvents:'resize',update:'_dropdownHover',}],events:{'mouseenter .dropdown':'_onMouseEnter','mouseleave .dropdown':'_onMouseLeave',},start:function(){this.$dropdownMenus=this.$el.find('.dropdown-menu');this.$dropdownToggles=this.$el.find('.dropdown-toggle');this._dropdownHover();return this._super.apply(this,arguments);},_dropdownHover:function(){this.$dropdownMenus.attr('data-bs-popper','none');if(config.device.size_class>=config.device.SIZES.LG){this.$dropdownMenus.css('margin-top','0');this.$dropdownMenus.css('top','unset');}else{this.$dropdownMenus.css('margin-top','');this.$dropdownMenus.css('top','');}},_hideDropdowns(){for(const toggleEl of this.el.querySelectorAll('.dropdown-toggle.show')){Dropdown.getOrCreateInstance(toggleEl).hide();}},_updateDropdownVisibility:function(ev,method){const{currentTarget}=ev;if(config.device.size_class<config.device.SIZES.LG){return;} 9486if(currentTarget.classList.contains('o_extra_menu_items')){return;} 9487const dropdownToggle=currentTarget.querySelector('.dropdown-toggle');
9487if(dropdownToggle){Dropdown.getOrCreateInstance(dropdownToggle)[method]();}},_onMouseEnter:function(ev){if(this.editableMode){if(this.el.querySelector('.dropdown-toggle.show')){return;}} 9488const focusedEl=this.el.ownerDocument.querySelector(":focus")||window.frameElement&&window.frameElement.ownerDocument.querySelector(":focus");this._updateDropdownVisibility(ev,'show');if(focusedEl){focusedEl.focus({preventScroll:true});}else{const dropdownToggleEl=ev.currentTarget.querySelector(".dropdown-toggle");if(dropdownToggleEl){dropdownToggleEl.blur();}}},_onMouseLeave:function(ev){if(this.editableMode){return;} 9489this._updateDropdownVisibility(ev,'hide');},_onPageClick(ev){if(ev.target.closest('.dropdown-menu.show')){return;} 9490this._hideDropdowns();},});publicWidget.registry.HeaderMainCollapse=publicWidget.Widget.extend({selector:'header#top',disabledInEditableMode:false,events:{'show.bs.collapse #top_menu_collapse':'_onCollapseShow','hidden.bs.collapse #top_menu_collapse':'_onCollapseHidden',},start(){this.languageSelectorMustBeMoved=false;if(this.$target[0].querySelector('.o_offcanvas_menu_toggler')){this.navbarEl=this.$target[0].querySelector('#top_menu');this.languageSelectorEl=this.$target[0].querySelectorAll('#top_menu_collapse .js_language_selector');this.languageSelectorEl=this.languageSelectorEl[this.languageSelectorEl.length-1];this.languageSelectorMustBeMoved=this.languageSelectorEl&&!this.navbarEl.contains(this.languageSelectorEl);if(this.$target[0].querySelector('.o_header_hamburger_full_toggler')){const callToActionEl=this.$target[0].querySelector('.oe_structure_solo');if(callToActionEl){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();callToActionEl.classList.add('nav-item');this.navbarEl.append(callToActionEl);this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();}} 9491this.offcanvasAndBoxedHeader=false;if(weUtils.getCSSVariableValue('header-template').includes('boxed')){this.boxedHeaderCallToActionEl=this.$target[0].querySelector('#top_menu_collapse .oe_structure_solo');this.offcanvasAndBoxedHeader=!!this.boxedHeaderCallToActionEl;}} 9492return this._super(...arguments);},_onCollapseShow(){this.el.classList.add('o_top_menu_collapse_shown');if(this.languageSelectorMustBeMoved){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();this.languageSelectorEl.classList.add('nav-item');this.navbarEl.append(this.languageSelectorEl);this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();} 9493if(this.offcanvasAndBoxedHeader){this.boxedHeaderCallToActionEl.classList.add('nav-item');this.navbarEl.append(this.boxedHeaderCallToActionEl);}},_onCollapseHidden(){this.el.classList.remove('o_top_menu_collapse_shown');if(this.languageSelectorMustBeMoved){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();this.languageSelectorEl.classList.remove('nav-item');this.navbarEl.after(this.languageSelectorEl);this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();} 9494if(this.offcanvasAndBoxedHeader){this.boxedHeaderCallToActionEl.classList.remove('nav-item');this.navbarEl.after(this.boxedHeaderCallToActionEl);}},});return{extraMenuUpdateCallbacks:extraMenuUpdateCallbacks,};});; 9495 9496/* /website/static/src/js/content/snippets.animation.js */ 9497odoo.define('website.content.snippets.animation',function(require){'use strict';const{loadJS}=require('@web/core/assets');var Class=require('web.Class');var config=require('web.config');var core=require('web.core');const dom=require('web.dom');var mixins=require('web.mixins');var publicWidget=require('web.public.widget');const wUtils=require('website.utils');var qweb=core.qweb;window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame;window.cancelAnimationFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||window.oCancelAnimationFrame;if(!window.performance||!window.performance.now){window.performance={now:function(){return Date.now();}};} 9498publicWidget.Widget.include({disabledInEditableMode:true,edit_events:null,read_events:null,init:function(parent,options){this._super.apply(this,arguments);this.editableMode=this.options.editableMode||false;var extraEvents=this.editableMode?this.edit_events:this.read_events;if(extraEvents){this.events=_.extend({},this.events||{},extraEvents);}},});var AnimationEffect=Class.extend(mixins.ParentedMixin,{init:function(parent,updateCallback,startEvents,$startTarget,options){mixins.ParentedMixin.init.call(this);this.setParent(parent);options=options||{};this._minFrameTime=1000/(options.maxFPS||100);this._updateCallback=updateCallback;this.startEvents=startEvents||'scroll';const modalEl=options.enableInModal?parent.target.closest('.modal'):null;const mainScrollingElement=modalEl?modalEl:$().getScrollingElement()[0];const mainScrollingTarget=$().getScrollingTarget(mainScrollingElement)[0];this.$startTarget=$($startTarget?$startTarget:this.startEvents==='scroll'?mainScrollingTarget:window);if(options.getStateCallback){this._getStateCallback=options.getStateCallback;}else if(this.startEvents==='scroll'&&this.$startTarget[0]===mainScrollingTarget){const $scrollable=this.$startTarget;this._getStateCallback=function(){return $scrollable.scrollTop();};}else if(this.startEvents==='resize'&&this.$startTarget[0]===window){this._getStateCallback=function(){return{width:window.innerWidth,height:window.innerHeight,};};}else{this._getStateCallback=function(){return undefined;};} 9499this.endEvents=options.endEvents||false;this.$endTarget=options.$endTarget?$(options.$endTarget):this.$startTarget;this._updateCallback=this._updateCallback.bind(parent);this._getStateCallback=this._getStateCallback.bind(parent);this._uid='_animationEffect'+_.uniqueId();this.startEvents=_processEvents(this.startEvents,this._uid);if(this.endEvents){this.endEvents=_processEvents(this.endEvents,this._uid);} 9500function _processEvents(events,namespace){events=events.split(' ');return _.each(events,function(e,index){events[index]+=('.'+namespace);}).join(' ');}},destroy:function(){mixins.ParentedMixin.destroy.call(this);this.stop();},start:function(){this._paused=false;this._rafID=window.requestAnimationFrame((function(t){this._update(t);this._paused=true;}).bind(this));if(this.endEvents){this.$startTarget.on(this.startEvents,(function(e){if(this._paused){_.defer(this.play.bind(this,e));}}).bind(this));this.$endTarget.on(this.endEvents,(function(){if(!this._paused){_.defer(this.pause.bind(this));}}).bind(this));}else{var pauseTimer=null;this.$startTarget.on(this.startEvents,_.throttle((function(e){this.play(e);clearTimeout(pauseTimer);pauseTimer=_.delay((function(){this.pause();pauseTimer=null;}).bind(this),2000);}).bind(this),250,{trailing:false}));}},stop:function(){this.$startTarget.off(this.startEvents);if(this.endEvents){this.$endTarget.off(this.endEvents);} 9501this.pause();},play:function(e){this._newEvent=e;if(!this._paused){return;} 9502this._paused=false;this._rafID=window.requestAnimationFrame(this._update.bind(this));this._lastUpdateTimestamp=undefined;},pause:function(){if(this._paused){return;} 9503this._paused=true;window.cancelAnimationFrame(this._rafID);this._lastUpdateTimestamp=undefined;},_update:function(timestamp){if(this._paused){return;} 9504this._rafID=window.requestAnimationFrame(this._update.bind(this));var elapsedTime=0;
9504if(this._lastUpdateTimestamp){elapsedTime=timestamp-this._lastUpdateTimestamp;if(elapsedTime<this._minFrameTime){return;}} 9505var animationState=this._getStateCallback(elapsedTime,this._newEvent);if(!this._newEvent&&animationState!==undefined&&_.isEqual(animationState,this._animationLastState)){return;} 9506this._animationLastState=animationState;this._updateCallback(this._animationLastState,elapsedTime,this._newEvent);this._lastUpdateTimestamp=timestamp;this._newEvent=undefined;},});var Animation=publicWidget.Widget.extend({maxFPS:100,effects:[],start:function(){this._prepareEffects();_.each(this._animationEffects,function(effect){effect.start();});return this._super.apply(this,arguments);},_prepareEffects:function(){this._animationEffects=[];var self=this;_.each(this.effects,function(desc){self._addEffect(self[desc.update],desc.startEvents,_findTarget(desc.startTarget),{getStateCallback:desc.getState&&self[desc.getState],endEvents:desc.endEvents||undefined,$endTarget:_findTarget(desc.endTarget),maxFPS:self.maxFPS,enableInModal:desc.enableInModal||undefined,});function _findTarget(selector){if(selector){if(selector==='selector'){return self.$target;} 9507return self.$(selector);} 9508return undefined;}});},_addEffect:function(updateCallback,startEvents,$startTarget,options){this._animationEffects.push(new AnimationEffect(this,updateCallback,startEvents,$startTarget,options));},});var registry=publicWidget.registry;registry.slider=publicWidget.Widget.extend({selector:'.carousel',disabledInEditableMode:false,edit_events:{'content_changed':'_onContentChanged',},start:function(){this.$('img').on('load.slider',()=>this._computeHeights());this._computeHeights();this.$target.carousel(this.editableMode?'pause':undefined);$(window).on('resize.slider',_.debounce(()=>this._computeHeights(),250));if(this.editableMode&&this.el.matches("section > .carousel")&&!this.options.wysiwyg.options.enableTranslation){this.controlEls=this.el.querySelectorAll(".carousel-control-prev, .carousel-control-next");const indicatorEls=this.el.querySelectorAll(".carousel-indicators > li");this.options.wysiwyg.odooEditor.observerUnactive("disable_controls");this.controlEls.forEach(controlEl=>controlEl.removeAttribute("data-bs-slide"));indicatorEls.forEach(indicatorEl=>indicatorEl.removeAttribute("data-bs-slide-to"));this.options.wysiwyg.odooEditor.observerActive("disable_controls");this.__onControlClick=this._onControlClick.bind(this);[...this.controlEls,...indicatorEls].forEach(controlEl=>{controlEl.addEventListener("mousedown",this.__onControlClick);});} 9509return this._super.apply(this,arguments);},destroy:function(){this._super.apply(this,arguments);this.$('img').off('.slider');this.$target.carousel('pause');this.$target.removeData('bs.carousel');this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive("destroy");_.each(this.$('.carousel-item'),function(el){$(el).css('min-height','');});this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive("destroy");$(window).off('.slider');this.$target.off('.slider');if(this.editableMode&&this.el.matches("section > .carousel")&&!this.options.wysiwyg.options.enableTranslation){const indicatorEls=this.el.querySelectorAll(".carousel-indicators > li");this.options.wysiwyg.odooEditor.observerUnactive("restore_controls");this.controlEls.forEach(controlEl=>{const direction=controlEl.classList.contains("carousel-control-prev")?"prev":"next";controlEl.setAttribute("data-bs-slide",direction);});indicatorEls.forEach((indicatorEl,i)=>indicatorEl.setAttribute("data-bs-slide-to",i));this.options.wysiwyg.odooEditor.observerActive("restore_controls");[...this.controlEls,...indicatorEls].forEach(controlEl=>{controlEl.removeEventListener("mousedown",this.__onControlClick);});}},_computeHeights:function(){var maxHeight=0;var $items=this.$('.carousel-item');this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive("_computeHeights");$items.css('min-height','');_.each($items,el=>{var $item=$(el);var isActive=$item.hasClass('active');$item.addClass('active');var height=$item.outerHeight();if(height>maxHeight){maxHeight=height;} 9510$item.toggleClass('active',isActive);});$items.css('min-height',maxHeight);this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive("_computeHeights");},_onContentChanged:function(ev){this._computeHeights();},_onControlClick(){this.el.querySelector(".carousel-item.active").click();},});registry.Parallax=Animation.extend({selector:'.parallax',disabledInEditableMode:false,effects:[{startEvents:'scroll',update:'_onWindowScroll',enableInModal:true,}],start:function(){this._rebuild();$(window).on('resize.animation_parallax',_.debounce(this._rebuild.bind(this),500));this.modalEl=this.$target[0].closest('.modal');if(this.modalEl){$(this.modalEl).on('shown.bs.modal.animation_parallax',()=>{this._rebuild();
9510this.modalEl.dispatchEvent(new Event('scroll'));});} 9511return this._super.apply(this,arguments);},destroy:function(){this._super.apply(this,arguments);this._updateBgCss({transform:'',top:'',bottom:'',});$(window).off('.animation_parallax');if(this.modalEl){$(this.modalEl).off('.animation_parallax');}},_rebuild:function(){this.$bg=this.$('> .s_parallax_bg');this.speed=parseFloat(this.$target.attr('data-scroll-background-ratio')||0);var noParallaxSpeed=(this.speed===0||this.speed===1);if(noParallaxSpeed){this._updateBgCss({transform:'',top:'',bottom:'',});return;} 9512this.viewport=document.body.clientHeight-$('#wrapwrap').position().top;this.visibleArea=[this.$target.offset().top];this.visibleArea.push(this.visibleArea[0]+this.$target.innerHeight()+this.viewport);this.ratio=this.speed*(this.viewport/10);const absoluteRatio=Math.abs(this.ratio);this._updateBgCss({top:-absoluteRatio,bottom:-absoluteRatio,});},_updateBgCss(cssValues){if(!this.$bg){return;} 9513if(this.options.wysiwyg){this.options.wysiwyg.odooEditor.observerUnactive('_updateBgCss');} 9514this.$bg.css(cssValues);if(this.options.wysiwyg){this.options.wysiwyg.odooEditor.observerActive('_updateBgCss');}},_onWindowScroll:function(scrollOffset){if(this.speed===0||this.speed===1){return;} 9515var vpEndOffset=scrollOffset+this.viewport;if(vpEndOffset>=this.visibleArea[0]&&vpEndOffset<=this.visibleArea[1]){this._updateBgCss({'transform':'translateY('+_getNormalizedPosition.call(this,vpEndOffset)+'px)'});} 9516function _getNormalizedPosition(pos){var r=(pos-this.visibleArea[1])/(this.visibleArea[0]-this.visibleArea[1]);return Math.round(this.ratio*(2*r-1));}},});const MobileYoutubeAutoplayMixin={_setupAutoplay:function(src){let promise=Promise.resolve();this.isYoutubeVideo=src.indexOf('youtube')>=0;this.isMobileEnv=config.device.size_class<=config.device.SIZES.LG&&config.device.touch;if(this.isYoutubeVideo&&this.isMobileEnv&&!window.YT){const oldOnYoutubeIframeAPIReady=window.onYouTubeIframeAPIReady;promise=new Promise(resolve=>{window.onYouTubeIframeAPIReady=()=>{if(oldOnYoutubeIframeAPIReady){oldOnYoutubeIframeAPIReady();} 9517return resolve();};});loadJS('https://www.youtube.com/iframe_api');} 9518return promise;},_triggerAutoplay:function(iframeEl){if(this.isMobileEnv&&this.isYoutubeVideo){new window.YT.Player(iframeEl,{events:{onReady:ev=>ev.target.playVideo(),}});}},};registry.mediaVideo=publicWidget.Widget.extend(MobileYoutubeAutoplayMixin,{selector:'.media_iframe_video',
9518start:function(){const proms=[this._super.apply(this,arguments)];let iframeEl=this.$target[0].querySelector(':scope > iframe');if(!iframeEl){iframeEl=this._generateIframe();} 9519if(!iframeEl||!iframeEl.getAttribute('src')){return Promise.all(proms);} 9520proms.push(this._setupAutoplay(iframeEl.getAttribute('src')));return Promise.all(proms).then(()=>{this._triggerAutoplay(iframeEl);});},_generateIframe:function(){this.$target.empty();this.$target.append('<div class="css_editable_mode_display"> </div>'+'<div class="media_iframe_video_size"> </div>');var src=_.escape(this.$target.data('oe-expression')||this.$target.data('src'));var m=src.match(/^(?:https?:)?\/\/([^/?#]+)/);if(!m){return;} 9521var domain=m[1].replace(/^www\./,'');var supportedDomains=['youtu.be','youtube.com','youtube-nocookie.com','instagram.com','vine.co','player.vimeo.com','vimeo.com','dailymotion.com','player.youku.com','youku.com'];if(!_.contains(supportedDomains,domain)){return;} 9522const iframeEl=$('<iframe/>',{src:src,frameborder:'0',allowfullscreen:'allowfullscreen',})[0];this.$target.append(iframeEl);return iframeEl;},});registry.backgroundVideo=publicWidget.Widget.extend(MobileYoutubeAutoplayMixin,{selector:'.o_background_video',disabledInEditableMode:false,start:function(){var proms=[this._super(...arguments)];this.videoSrc=this.el.dataset.bgVideoSrc;this.iframeID=_.uniqueId('o_bg_video_iframe_');proms.push(this._setupAutoplay(this.videoSrc));if(this.isYoutubeVideo&&this.isMobileEnv&&!this.videoSrc.includes('enablejsapi=1')){this.videoSrc+='&enablejsapi=1';} 9523var throttledUpdate=_.throttle(()=>this._adjustIframe(),50);var $dropdownMenu=this.$el.closest('.dropdown-menu');if($dropdownMenu.length){this.$dropdownParent=$dropdownMenu.parent();this.$dropdownParent.on('shown.bs.dropdown.backgroundVideo',throttledUpdate);} 9524$(window).on('resize.'+this.iframeID,throttledUpdate);const $modal=this.$target.closest('.modal');if($modal.length){$modal.on('show.bs.modal',()=>{const videoContainerEl=this.$target[0].querySelector('.o_bg_video_container');videoContainerEl.classList.add('d-none');});$modal.on('shown.bs.modal',()=>{this._adjustIframe();const videoContainerEl=this.$target[0].querySelector('.o_bg_video_container');videoContainerEl.classList.remove('d-none');});} 9525this.__adjustIframe=_.debounce(()=>this._adjustIframe(),100);const resizeObserver=new ResizeObserver(this.__adjustIframe.bind(this));resizeObserver.observe(this.$target[0].parentElement);resizeObserver.observe(this.$target[0]);return Promise.all(proms).then(()=>this._appendBgVideo());},destroy:function(){this._super.apply(this,arguments);if(this.$dropdownParent){this.$dropdownParent.off('.backgroundVideo');} 9526$(window).off('resize.'+this.iframeID);if(this.$bgVideoContainer){this.$bgVideoContainer.remove();}},_adjustIframe:function(){if(!this.$iframe){return;} 9527this.$iframe.removeClass('show');var wrapperWidth=this.$target.innerWidth();var wrapperHeight=this.$target.innerHeight();var relativeRatio=(wrapperWidth/wrapperHeight)/(16/9);var style={};if(relativeRatio>=1.0){style['width']='100%';style['height']=(relativeRatio*100)+'%';style['inset-inline-start']='0';style['inset-block-start']=(-(relativeRatio-1.0)/2*100)+'%';}else{style['width']=((1/relativeRatio)*100)+'%';style['height']='100%';style['inset-inline-start']=(-((1/relativeRatio)-1.0)/2*100)+'%';style['inset-block-start']='0';} 9528this.$iframe.css(style);void this.$iframe[0].offsetWidth;this.$iframe.addClass('show');},_appendBgVideo:function(){var $oldContainer=this.$bgVideoContainer||this.$('> .o_bg_video_container');this.$bgVideoContainer=$(qweb.render('website.background.video',{videoSrc:this.videoSrc,iframeID:this.iframeID,}));this.$iframe=this.$bgVideoContainer.find('.o_bg_video_iframe');this.$iframe.one('load',()=>{this.$bgVideoContainer.find('.o_bg_video_loading').remove();this._adjustIframe();});this.$bgVideoContainer.prependTo(this.$target);$oldContainer.remove();this._adjustIframe();this._triggerAutoplay(this.$iframe[0]);},});registry.socialShare=publicWidget.Widget.extend({selector:'.oe_social_share',events:{'mouseenter':'_onMouseEnter',},_bindSocialEvent:function(){this.$('.oe_social_facebook').click($.proxy(this._renderSocial,this,'facebook'));this.$('.oe_social_twitter').click($.proxy(this._renderSocial,this,'twitter'));this.$('.oe_social_linkedin').click($.proxy(this._renderSocial,this,'linkedin'));},_render:function(){this.$el.popover({content:qweb.render('website.social_hover',{medias:this.socialList}),placement:'bottom',container:this.$el,html:true,trigger:'manual',animation:false,}).popover("show");
9528this.$el.off('mouseleave.socialShare').on('mouseleave.socialShare',function(){var self=this;setTimeout(function(){if(!$(".popover:hover").length){$(self).popover('dispose');}},200);});},_renderSocial:function(social){var url=this.$el.data('urlshare')||document.URL.split(/[?#]/)[0];url=encodeURIComponent(url);const titleParts=document.title.split(" | ");const title=titleParts[0];const hashtags=titleParts.length===1?` ${this.hashtags}`:` #${titleParts[1].replace(" ", "")} ${this.hashtags}`;var socialNetworks={'facebook':'https://www.facebook.com/sharer/sharer.php?u='+url,'twitter':'https://twitter.com/intent/tweet?original_referer='+url+'&text='+encodeURIComponent(title+hashtags+' - ')+url,'linkedin':'https://www.linkedin.com/sharing/share-offsite/?url='+url,};if(!_.contains(_.keys(socialNetworks),social)){return;} 9529var wHeight=500;var wWidth=500;window.open(socialNetworks[social],'','menubar=no, toolbar=no, resizable=yes, scrollbar=yes, height='+wHeight+',width='+wWidth);},_onMouseEnter:function(){var social=this.$el.data('social');this.socialList=social?social.split(','):['facebook','twitter','linkedin'];this.hashtags=this.$el.data('hashtags')||'';this._render();this._bindSocialEvent();},});registry.anchorSlide=publicWidget.Widget.extend({selector:'a[href^="/"][href*="#"], a[href^="#"]',events:{'click':'_onAnimateClick',},async _scrollTo($el,scrollValue='true'){return dom.scrollTo($el[0],{duration:scrollValue==='true'?500:0,extraOffset:this._computeExtraOffset(),});},_computeExtraOffset(){return 0;},_onAnimateClick:function(ev){const ensureSlash=path=>path.endsWith("/")?path:path+"/";if(ensureSlash(this.$target[0].pathname)!==ensureSlash(window.location.pathname)){return;} 9530if(this.$target[0].pathname!==window.location.pathname){this.$target[0].pathname=window.location.pathname;} 9531var hash=this.$target[0].hash;if(hash==='#top'||hash==='#bottom'){dom.scrollTo(hash,{duration:500,extraOffset:this._computeExtraOffset(),});return;} 9532if(!hash.length){return;} 9533hash='#'+$.escapeSelector(hash.substring(1));var $anchor=$(hash);const scrollValue=$anchor.attr('data-anchor');if(!$anchor.length||!scrollValue){return;} 9534const collapseMenuEl=this.el.closest('#top_menu_collapse');if(collapseMenuEl&&collapseMenuEl.classList.contains('show')){$(collapseMenuEl).collapse("hide");} 9535ev.preventDefault();this._scrollTo($anchor,scrollValue);},});registry.FullScreenHeight=publicWidget.Widget.extend({selector:'.o_full_screen_height',disabledInEditableMode:false,start(){this.inModal=!!this.el.closest('.modal');if(this.$el.is(':not(:visible)')||this.$el.outerHeight()>this._computeIdealHeight()){this._adaptSize();$(window).on('resize.FullScreenHeight',_.debounce(()=>this._adaptSize(),250));} 9536return this._super(...arguments);},destroy(){this._super(...arguments);$(window).off('.FullScreenHeight');this.el.style.setProperty('min-height','');},_adaptSize(){const height=this._computeIdealHeight();this.el.style.setProperty('min-height',`${height}px`,'important');},_computeIdealHeight(){const windowHeight=$(window).outerHeight();if(this.inModal){return(windowHeight-$('#wrapwrap').position().top);} 9537const firstContentEl=$('#wrapwrap > main > :first-child')[0];const modalOpen=document.body.classList.contains("modal-open");document.body.classList.remove("modal-open");const mainTopPos=firstContentEl.getBoundingClientRect().top+dom.closestScrollable(firstContentEl.parentNode).scrollTop;document.body.classList.toggle("modal-open",modalOpen);return(windowHeight-mainTopPos);},});registry.ScrollButton=registry.anchorSlide.extend({selector:'.o_scroll_button',_onAnimateClick:function(ev){ev.preventDefault();const currentSectionEl=this.el.closest('section');let nextEl=currentSectionEl.nextElementSibling;while(nextEl){if($(nextEl).is(':visible')){this._scrollTo($(nextEl));return;} 9538nextEl=nextEl.nextElementSibling;}},});registry.FooterSlideout=publicWidget.Widget.extend({selector:'#wrapwrap:has(.o_footer_slideout)',disabledInEditableMode:false,async start(){const $main=this.$('> main');const slideoutEffect=$main.outerHeight()>=$(window).outerHeight();this.el.classList.toggle('o_footer_effect_enable',slideoutEffect);this.__pixelEl=document.createElement('div');this.__pixelEl.style.width=`1px`;this.__pixelEl.style.height=`1px`;this.__pixelEl.style.marginTop=`-1px`;if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){this.__pixelEl.style.backgroundColor="transparent";this.__pixelEl.style.backgroundAttachment="fixed";this.__pixelEl.style.backgroundImage="url(/website/static/src/img/website_logo.svg)";} 9539this.el.appendChild(this.__pixelEl);return this._super(...arguments);},destroy(){this._super(...arguments);this.el.classList.remove('o_footer_effect_enable');this.__pixelEl.remove();},});registry.TopMenuCollapse=publicWidget.Widget.extend({selector:"header #top_menu_collapse",async start(){this.throttledResize=_.throttle(()=>this._onResize(),25);window.addEventListener("resize",this.throttledResize);return this._super(...arguments);},destroy(){this._super(...arguments);window.removeEventListener("resize",this.throttledResize);},_onResize(){if(this.el.classList.contains("show")){const togglerEl=this.el.closest("nav").querySelector(".navbar-toggler");if(getComputedStyle(togglerEl).display==="none"){this.$el.collapse("hide");}}},});registry.HeaderHamburgerFull=publicWidget.Widget.extend({selector:'header:has(.o_header_hamburger_full_toggler):not(:has(.o_offcanvas_menu_toggler))',events:{'click .o_header_hamburger_full_toggler':'_onToggleClick',},_onToggleClick(){document.body.classList.add('overflow-hidden');setTimeout(()=>$(window).trigger('scroll'),100);},});registry.BottomFixedElement=publicWidget.Widget.extend({selector:'#wrapwrap',async start(){this.$scrollingElement=$().getScrollingElement();this.$scrollingTarget=$().getScrollingTarget(this.$scrollingElement);this.__hideBottomFixedElements=_.debounce(()=>this._hideBottomFixedElements(),100);this.$scrollingTarget.on('scroll.bottom_fixed_element',this.__hideBottomFixedElements);$(window).on('resize.bottom_fixed_element',this.__hideBottomFixedElements);return this._super(...arguments);},destroy(){this._super(...arguments);this.$scrollingElement.off('.bottom_fixed_element');this.$scrollingTarget.off('.bottom_fixed_element');$(window).off('.bottom_fixed_element');this._restoreBottomFixedElements($('.o_bottom_fixed_element'));},_hideBottomFixedElements(){const $bottomFixedElements=$('.o_bottom_fixed_element');if(!$bottomFixedElements.length){return;} 9540if(this.el.querySelector('.s_popup_no_backdrop.show')){for(const el of $bottomFixedElements){el.classList.add('o_bottom_fixed_element_hidden');} 9541return;} 9542this._restoreBottomFixedElements($bottomFixedElements);if((this.$scrollingElement[0].offsetHeight+this.$scrollingElement[0].scrollTop)>=(this.$scrollingElement[0].scrollHeight-2)){const buttonEls=[...this.$('a:visible, .btn:visible')];for(const el of $bottomFixedElements){const hiddenButtonEl=buttonEls.find(button=>dom.areColliding(button,el));if(hiddenButtonEl){if(el.classList.contains('o_bottom_fixed_element_move_up')){el.style.marginBottom=window.innerHeight-hiddenButtonEl.getBoundingClientRect().top+5+'px';}else{el.classList.add('o_bottom_fixed_element_hidden');}}}}},_restoreBottomFixedElements($elements){$elements.removeClass('o_bottom_fixed_element_hidden');$elements.filter('.o_bottom_fixed_element_move_up').css('margin-bottom','');},});registry.WebsiteAnimate=publicWidget.Widget.extend({selector:'#wrapwrap',disabledInEditableMode:false,offsetRatio:0.3,offsetMin:10,start(){this.lastScroll=0;this.$scrollingElement=$().getScrollingElement();this.$scrollingTarget=$().getScrollingTarget(this.$scrollingElement);this.$animatedElements=this.$('.o_animate');const couldOverflowBecauseOfSafariBug=[...this.$animatedElements].some(el=>{return window.getComputedStyle(el).transform!=='none';});this.forceOverflowXYHidden=false;if(couldOverflowBecauseOfSafariBug){this._toggleOverflowXYHidden(true);this.forceOverflowXYHidden=true;} 9543_.each(this.$animatedElements,el=>{if(el.closest('.dropdown')){el.classList.add('o_animate_in_dropdown');return;} 9544if(!el.classList.contains('o_animate_on_scroll')){this._resetAnimation($(el));}});this.$animatedElements.css("visibility","visible");this.__onScrollWebsiteAnimate=_.throttle(this._onScrollWebsiteAnimate.bind(this),10);this.$scrollingTarget[0].addEventListener('scroll',this.__onScrollWebsiteAnimate,{capture:true});$(window).on('resize.o_animate, shown.bs.modal.o_animate, slid.bs.carousel.o_animate, shown.bs.tab.o_animate, shown.bs.collapse.o_animate',()=>{this.windowsHeight=$(window).height();this._scrollWebsiteAnimate(this.$scrollingElement[0]);}).trigger("resize");return this._super(...arguments);},destroy(){this._super(...arguments);this.$target.find('.o_animate').removeClass('o_animating o_animated o_animate_preview o_animate_in_dropdown').css({'animation-name':'','animation-play-state':'','visibility':'',});$(window).off('.o_animate');this.$scrollingTarget[0].removeEventListener('scroll',this.__onScrollWebsiteAnimate,{capture:true});this.$scrollingElement[0].classList.remove('o_wanim_overflow_xy_hidden');},_startAnimation($el){setTimeout(()=>{this._toggleOverflowXYHidden(true);$el.css({"animation-play-state":"running"}).addClass("o_animating").one('webkitAnimationEnd oanimationend msAnimationEnd animationend',()=>{$el.addClass("o_animated").removeClass("o_animating");this._toggleOverflowXYHidden(false);$(window).trigger("resize");});});},_resetAnimation($el){const animationName=$el.css("animation-name");$el.css({"animation-name":"dummy-none","animation-play-state":""}).removeClass("o_animated o_animating");this._toggleOverflowXYHidden(false);void $el[0].offsetWidth;$el.css({'animation-name':animationName,'animation-play-state':'paused'});},_toggleOverflowXYHidden(add){if(this.forceOverflowXYHidden){return;} 9545if(add){this.$scrollingElement[0].classList.add('o_wanim_overflow_xy_hidden');}else if(!this.$scrollingElement.find('.o_animating').length){this.$scrollingElement[0].classList.remove('o_wanim_overflow_xy_hidden');}},_getElementOffsetTop(el,topEl){var top=0;do{top+=el.offsetTop||0;el=el.offsetParent;if(topEl&&el===topEl){return top;}}while(el);return top;},_scrollWebsiteAnimate(el){_.each(this.$target.find('.o_animate:not(.o_animate_in_dropdown)'),el=>{const $el=$(el);const elHeight=el.offsetHeight;
9545const animateOnScroll=el.classList.contains('o_animate_on_scroll');let elOffset=animateOnScroll?0:Math.max((elHeight*this.offsetRatio),this.offsetMin);const state=$el.css("animation-play-state");const closestModal=$el.closest(".modal:visible")[0];let scrollTop=this.$scrollingElement[0].scrollTop;if(closestModal){scrollTop=closestModal.classList.contains("s_popup_no_backdrop")?closestModal.querySelector(".modal-content").scrollTop:closestModal.scrollTop;} 9546const elTop=this._getElementOffsetTop(el)-scrollTop;let visible;const footerEl=el.closest('.o_footer_slideout');const wrapEl=this.$target[0];if(footerEl&&wrapEl.classList.contains('o_footer_effect_enable')){const actualScroll=wrapEl.scrollTop+this.windowsHeight;const totalScrollHeight=wrapEl.scrollHeight;const heightFromFooter=this._getElementOffsetTop(el,footerEl);visible=actualScroll>=totalScrollHeight-heightFromFooter-elHeight+elOffset;}else{visible=this.windowsHeight>(elTop+elOffset)&&0<(elTop+elHeight-elOffset);} 9547if(animateOnScroll){if(visible){const start=100/(parseFloat(el.dataset.scrollZoneStart)||1);const end=100/(parseFloat(el.dataset.scrollZoneEnd)||1);const out=el.classList.contains('o_animate_out');const ratio=(out?elTop+elHeight:elTop)/(this.windowsHeight-(this.windowsHeight/start));const duration=parseFloat(window.getComputedStyle(el).animationDuration);const delay=(ratio-1)*(duration*end);el.style.animationDelay=(out?-duration-delay:delay)+"s";el.classList.add('o_animating');this._toggleOverflowXYHidden(true);}else if(el.classList.contains('o_animating')){el.classList.remove('o_animating');this._toggleOverflowXYHidden(false);}}else{if(visible&&state==='paused'){$el.addClass('o_visible');this._startAnimation($el);}else if(!visible&&$el.hasClass('o_animate_both_scroll')&&state==='running'){$el.removeClass('o_visible');this._resetAnimation($el);}}});},_onScrollWebsiteAnimate(ev){this._scrollWebsiteAnimate(ev.currentTarget);},});registry.ImagesLazyLoading=publicWidget.Widget.extend({selector:'#wrapwrap',start(){const imgEls=this.$target[0].querySelectorAll('img[loading="lazy"]');for(const imgEl of imgEls){imgEl.dataset.lazyLoadingInitialMinHeight=imgEl.style.minHeight;imgEl.style.minHeight='1px';wUtils.onceAllImagesLoaded($(imgEl)).then(()=>{if(this.isDestroyed()){return;} 9548this._restoreImage(imgEl);});} 9549return this._super(...arguments);},destroy(){this._super(...arguments);const imgEls=this.$target[0].querySelectorAll('img[data-lazy-loading-initial-min-height]');for(const imgEl of imgEls){this._restoreImage(imgEl);}},_restoreImage(imgEl){imgEl.style.minHeight=imgEl.dataset.lazyLoadingInitialMinHeight;delete imgEl.dataset.lazyLoadingInitialMinHeight;},});registry.ZoomedBackgroundShape=publicWidget.Widget.extend({selector:'.o_we_shape',disabledInEditableMode:false,start(){this._onBackgroundShapeResize();this.throttledShapeResize=_.throttle(()=>this._onBackgroundShapeResize(),25);window.addEventListener('resize',this.throttledShapeResize);return this._super(...arguments);},destroy(){this._updateShapePosition();window.removeEventListener('resize',this.throttledShapeResize);this._super(...arguments);},_updateShapePosition(offset=''){this.el.style.left=offset;this.el.style.right=offset;},_onBackgroundShapeResize(){this._updateShapePosition();let decimalPart=this.el.getBoundingClientRect().width%1;decimalPart=Math.round((decimalPart+Number.EPSILON)*100)/100;if(decimalPart>0){let offset=(decimalPart<0.5?decimalPart:decimalPart-1)/2;this._updateShapePosition(offset+'px');}},});return{Widget:publicWidget.Widget,Animation:Animation,registry:registry,Class:Animation,};});; 9550 9551/* /website/static/src/js/show_password.js */ 9552odoo.define('website.show_password',function(require){'use strict';var publicWidget=require('web.public.widget');publicWidget.registry.ShowPassword=publicWidget.Widget.extend({selector:'#showPass',events:{'mousedown':'_onShowText','touchstart':'_onShowText',},destroy:function(){this._super(...arguments);$('body').off(".ShowPassword");},_onShowPassword:function(){this.$el.closest('.input-group').find('#password').attr('type','password');},_onShowText:function(){$('body').one('mouseup.ShowPassword touchend.ShowPassword',this._onShowPassword.bind(this));this.$el.closest('.input-group').find('#password').attr('type','text');},});return publicWidget.registry.ShowPassword;});; 9553 9554/* /website/static/src/js/post_link.js */ 9555odoo.define('website.post_link',function(require){'use strict';const publicWidget=require('web.public.widget');const wUtils=require('website.utils');publicWidget.registry.postLink=publicWidget.Widget.extend({selector:'.post_link',events:{'click':'_onClickPost',},start(){this.el.classList.add('o_post_link_js_loaded');return this._super(...arguments);},destroy(){this._super(...arguments);this.el.classList.remove('o_post_link_js_loaded');},_onClickPost:function(ev){ev.preventDefault();const url=this.el.dataset.post||this.el.href;let data={};
9555for(let[key,value]of Object.entries(this.el.dataset)){if(key.startsWith('post_')){data[key.slice(5)]=value;}} 9556wUtils.sendRequest(url,data);},});});; 9557 9558/* /website/static/src/js/plausible.js */ 9559odoo.define('@website/js/plausible',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');publicWidget.registry.o_plausible_push=publicWidget.Widget.extend({selector:'.js_plausible_push',start(){window.plausible=window.plausible||function(){(window.plausible.q=window.plausible.q||[]).push(arguments);};this._push();return this._super(...arguments);},_push(){const evName=this.$el.data('event-name').toString();const evParams=this.$el.data('event-params')||{};window.plausible(evName,{props:evParams});},});return __exports;});; 9560 9561/* /website/static/src/js/user_custom_javascript.js */ 9562; 9563 9564/* /website/static/src/js/http_cookie.js */ 9565odoo.define('@website/js/http_cookie',async function(require){'use strict';let __exports={};const cookieUtils=require('web.utils.cookies');const originFunc=cookieUtils.isAllowedCookie;cookieUtils.isAllowedCookie=(type)=>{const result=originFunc.apply(cookieUtils,[type]);if(result&&type==='optional'){if(!document.getElementById('cookies-consent-essential')){return true;} 9566const consents=JSON.parse(cookieUtils.getCookie('website_cookies_bar')||'{}');if(typeof consents!=='object'){cookieUtils.deleteCookie('website_cookies_bar');return false;} 9567if('optional'in consents){return consents['optional'];} 9568return false;} 9569return result;};return __exports;});; 9570 9571/* /website/static/src/snippets/s_embed_code/000.js */ 9572odoo.define('@website/snippets/s_embed_code/000',async function(require){'use strict';let __exports={};const publicWidget=require("web.public.widget");const{_t}=require("@web/core/l10n/translation");const{cloneContentEls}=require("website.utils");const EmbedCodeWidget=publicWidget.Widget.extend({selector:".s_embed_code",disabledInEditableMode:false,async start(){this.embedCodeEl=this.el.querySelector(".s_embed_code_embedded");if(!this.el.querySelector("template.s_embed_code_saved")){const templateEl=document.createElement("template");templateEl.classList.add("s_embed_code_saved");templateEl.content.append(cloneContentEls(this.embedCodeEl,true));this.el.prepend(templateEl);} 9573if(this.editableMode&&this.embedCodeEl.offsetHeight===0){const placeholderEl=document.createElement("div");placeholderEl.classList.add("s_embed_code_placeholder","alert","alert-info","pt16","pb16");placeholderEl.textContent=_t("Your Embed Code snippet doesn't have anything to display. Click on Edit to modify it.");this.el.querySelector(".s_embed_code_embedded").appendChild(placeholderEl);} 9574return this._super(...arguments);},destroy(){this._super(...arguments);if(!this.editableMode){const templateContent=this.el.querySelector("template.s_embed_code_saved").content;this.embedCodeEl.replaceChildren(cloneContentEls(templateContent));}},});publicWidget.registry.EmbedCode=EmbedCodeWidget;__exports[Symbol.for("default")]=EmbedCodeWidget;return __exports;});; 9575 9576/* /project/static/src/js/portal_rating.js */ 9577odoo.define('@project/js/portal_rating',async function(require){'use strict';let __exports={};const time=require('web.time');const publicWidget=require('web.public.widget');publicWidget.registry.ProjectRatingImage=publicWidget.Widget.extend({selector:'.o_portal_project_rating .o_rating_image',start:function(){this.$el.popover({placement:'bottom',trigger:'hover',html:true,content:function(){var $elem=$(this);var id=$elem.data('id');var ratingDate=$elem.data('rating-date');var baseDate=time.auto_str_to_date(ratingDate);var duration=moment(baseDate).fromNow();var $rating=$('#rating_'+id);$rating.find('.rating_timeduration').text(duration);return $rating.html();},});return this._super.apply(this,arguments);},});return __exports;});; 9578 9579/* /website_payment/static/src/js/website_payment_donation.js */ 9580odoo.define('@website_payment/js/website_payment_donation',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');publicWidget.registry.WebsitePaymentDonation=publicWidget.Widget.extend({selector:'.o_donation_payment_form',events:{'focus .o_amount_input':'_onFocusAmountInput','change #donation_comment_checkbox':'_onChangeDonationComment'},_onFocusAmountInput(ev){this.$target.find('#other_amount').prop("checked",true);},_onChangeDonationComment(ev){const $donationComment=this.$target.find('#donation_comment');const checked=$(ev.currentTarget).is(':checked');$donationComment.toggleClass('d-none',!checked);if(!checked){$donationComment.val('');}},});return __exports;});; 9581 9582/* /website_payment/static/src/js/website_payment_form.js */ 9583odoo.define('@website_payment/js/website_payment_form',async function(require){'use strict';let __exports={};const core=require('web.core');const{_t}=core;const checkoutForm=require('payment.checkout_form');const{memoize}=require("@web/core/utils/functions");checkoutForm.include({events:_.extend({},checkoutForm.prototype.events||{},{'change .o_wpayment_fee_impact':'_onFeeParameterChange','focus .o_wpayment_fee_impact':'_onFeeParameterChange',}),start:function(){core.bus.on('update_shipping_cost',this,this._updateShippingCost);this._memoizedGetProviderFees=memoize(this._getProviderFees.bind(this));return this._super.apply(this,arguments);},_processPayment:function(code,paymentOptionId,flow){if($('.o_donation_payment_form').length){const errorFields={};if(!this.$('input[name="email"]')[0].checkValidity()){errorFields['email']=_t("Email is invali
9583d");} 9584const mandatoryFields={'name':_t('Name'),'email':_t('Email'),'country_id':_t('Country'),};for(const id in mandatoryFields){const $field=this.$('input[name="'+id+'"],select[name="'+id+'"]');$field.removeClass('is-invalid').popover('dispose');if(!$field.val().trim()){errorFields[id]=_.str.sprintf(_t("Field '%s' is mandatory"),mandatoryFields[id]);}} 9585if(Object.keys(errorFields).length){for(const id in errorFields){const $field=this.$('input[name="'+id+'"],select[name="'+id+'"]');$field.addClass('is-invalid');$field.popover({content:errorFields[id],trigger:'hover',container:'body',placement:'top'});} 9586this._displayError(_t("Validation Error"),_t("Some information is missing to process your payment."));return Promise.resolve();}} 9587return this._super(...arguments);},_prepareTransactionRouteParams:function(code,paymentOptionId,flow){const transactionRouteParams=this._super(...arguments);return $('.o_donation_payment_form').length?{...transactionRouteParams,'partner_details':{'name':this.$('input[name="name"]').val(),'email':this.$('input[name="email"]').val(),'country_id':this.$('select[name="country_id"]').val(),},'donation_comment':this.$('#donation_comment').val(),'donation_recipient_email':this.$('input[name="donation_recipient_email"]').val(),}:transactionRouteParams;},_updateShippingCost:function(amount){this.txContext.amount=amount;},_onFeeParameterChange:function(ev){const targetId=ev.target.id;if(targetId.indexOf("amount")>=0){this.txContext.amount=ev.target.value;if(targetId==="other_amount_value"){const otherAmountInputEl=document.querySelector("input[id=\"other_amount\"]");if(otherAmountInputEl){otherAmountInputEl.value=ev.target.value;}}} 9588const providerIds=[];for(const card of this.$('.o_payment_option_card:has(.o_payment_fee)')){const radio=$(card).find('input[name="o_payment_radio"]');if(radio.data("paymentOptionType")==='provider'){providerIds.push(radio.data("paymentOptionId"));}} 9589const countryId=this.$('select[name="country_id"]').val();if(providerIds&&this.txContext.amount){const params={"provider_ids":providerIds,'amount':this.txContext.amount!==undefined?parseFloat(this.txContext.amount):null,'currency_id':this.txContext.currencyId?parseInt(this.txContext.currencyId):null,'country_id':countryId,} 9590const cacheKey=`${params.amount}-${params.currency_id}-${params.country_id}`;this._memoizedGetProviderFees(cacheKey,params).then(feesPerProvider=>{for(const card of this.$('.o_payment_option_card:has(.o_payment_fee)')){const radio=$(card).find('input[name="o_payment_radio"]');let providerId;if(radio.data("paymentOptionType")==='provider'){providerId=radio.data("paymentOptionId");}else{providerId=radio.data("paymentProviderId");} 9591const chunk=$(card).find('.o_payment_fee .oe_currency_value')[0];chunk.innerText=(feesPerProvider[providerId]||0).toFixed(2);}}).guardedCatch(error=>{error.event.preventDefault();this._displayError(_t("Server Error"),_t("We could not obtain payment fees."),error.message.data.message);});}},_getProviderFees:function(cacheKey,params){return this._rpc({route:"/donation/get_provider_fees",params:params,});},});return __exports;});; 9592 9593/* /website_mail/static/src/js/follow.js */ 9594odoo.define('website_mail.follow',function(require){'use strict';var publicWidget=require('web.public.widget');const{ReCaptcha}=require("google_recaptcha.ReCaptchaV3");const{_t}=require("web.core");publicWidget.registry.follow=publicWidget.Widget.extend({selector:'#wrapwrap:has(.js_follow)',disabledInEditableMode:false,init(){this._super(...arguments);this._recaptcha=new ReCaptcha();},async willStart(){return this._recaptcha.loadLibs();},start:function(){var self=this;this.isUser=false;var $jsFollowEls=this.$el.find('.js_follow');var always=function(data){self.isUser=data[0].is_user;const $jsFollowToEnable=$jsFollowEls.filter(function(){const model=this.dataset.object;return model in data[1]&&data[1][model].includes(parseInt(this.dataset.id));});self._toggleSubscription(true,data[0].email,$jsFollowToEnable);self._toggleSubscription(false,data[0].email,$jsFollowEls.not($jsFollowToEnable));$jsFollowEls.removeClass('d-none');};const records={};for(const el of $jsFollowEls){const model=el.dataset.object;if(!(model in records)){records[model]=[];} 9595records[model].push(parseInt(el.dataset.id));} 9596this._rpc({route:'/website_mail/is_follower',params:{records:records,},}).then(always).guardedCatch(always);if(!this.editableMode){$('.js_follow > .d-none').removeClass('d-none');this.$target.find('.js_follow_btn, .js_unfollow_btn').on('click',function(event){event.preventDefault();self._onClick(event);});} 9597return this._super.apply(this,arguments);},_toggleSubscription:function(follow,email,$jsFollowEls){if(follow){this._updateSubscriptionDOM(follow,email,$jsFollowEls);}else{for(const el of $jsFollowEls){const follow=!email&&el.getAttribute('data-unsubscribe');this._updateSubscriptionDOM(follow,email,$(el));}}},_updateSubscriptionDOM:function(follow,email,$jsFollowEls){$jsFollowEls.find('input.js_follow_email').val(email||"").attr("disabled",email&&(follow||this.isUser)?"disabled":false);$jsFollowEls.attr("data-follow",follow?'on':'off');},async _onClick(ev){var self=this;var $jsFollow=$(ev.currentTarget).closest('.js_follow');var $email=$jsFollow.find(".js_follow_email");if($email.length&&!$email.val().match(/.+@.+/)){$jsFollow.addClass('o_has_error').find('.form-control, .form-select').addClass('is-invalid');return false;} 9598$jsFollow.removeClass('o_has_error').find('.form-control, .form-select').removeClass('is-invalid');var email=$email.length?$email.val():false;if(email||this.isUser){const tokenCaptcha=await this._recaptcha.getToken("website_mail_follow");const token=tokenCaptcha.token;
9598if(tokenCaptcha.error){self.displayNotification({type:"danger",title:_t("Error"),message:tokenCaptcha.error,sticky:true});return false;} 9599this._rpc({route:'/website_mail/follow',params:{'id':+$jsFollow.data('id'),'object':$jsFollow.data('object'),'message_is_follower':$jsFollow.attr("data-follow")||"off",'email':email,'recaptcha_token_response':token,},}).then(function(follow){self._toggleSubscription(follow,email,$jsFollow);});}},});});; 9600 9601/* /portal_rating/static/src/js/portal_chatter.js */ 9602odoo.define('rating.portal.chatter',function(require){'use strict';var core=require('web.core');var portalChatter=require('portal.chatter');var utils=require('web.utils');var time=require('web.time');var _t=core._t;var PortalChatter=portalChatter.PortalChatter;var qweb=core.qweb;PortalChatter.include({events:_.extend({},PortalChatter.prototype.events,{'click .o_website_rating_table_row':'_onClickStarDomain','click .o_website_rating_selection_reset':'_onClickStarDomainReset','click .o_wrating_js_publisher_comment_btn':'_onClickPublisherComment','click .o_wrating_js_publisher_comment_edit':'_onClickPublisherComment','click .o_wrating_js_publisher_comment_delete':'_onClickPublisherCommentDelete','click .o_wrating_js_publisher_comment_submit':'_onClickPublisherCommentSubmit','click .o_wrating_js_publisher_comment_cancel':'_onClickPublisherCommentCancel',}),init:function(parent,options){this._super.apply(this,arguments);if(!_.contains(this.options,'display_rating')){this.options=_.defaults(this.options,{'display_rating':false,'rating_default_value':0.0,});} 9603this.set('rating_card_values',{});this.set('rating_value',false);this.on("change:rating_value",this,this._onChangeRatingDomain);},start:function(){this._super.apply(this,arguments);this.on("change:rating_card_values",this,this._renderRatingCard);},preprocessMessages:function(messages){var self=this;messages=this._super.apply(this,arguments);if(this.options['display_rating']){_.each(messages,function(m,i){m.rating_value=self.roundToHalf(m['rating_value']);m.rating=self._preprocessCommentData(m.rating,i);});} 9604this.messages=messages;return messages;},roundToHalf:function(value){var converted=parseFloat(value);var decimal=(converted-parseInt(converted,10));decimal=Math.round(decimal*10);if(decimal===5){return(parseInt(converted,10)+0.5);} 9605if((decimal<3)||(decimal>7)){return Math.round(converted);}else{return(parseInt(converted,10)+0.5);}},_chatterInit:async function(){const result=await this._super(...arguments);this._updateRatingCardValues(result);return result;},messageFetch:async function(domain){const result=await this._super(...arguments);this._updateRatingCardValues(result);return result;},_updateRatingCardValues:function(result){if(!result['rating_stats']){return;} 9606const self=this;const ratingData={'avg':Math.round(result['rating_stats']['avg']*100)/100,'percent':[],};_.each(_.sortBy(_.keys(result['rating_stats']['percent'])).reverse(),function(rating){ratingData['percent'].push({'num':self.roundToHalf(rating),'percent':utils.round_precision(result['rating_stats']['percent'][rating],0.01),});});this.set('rating_card_values',ratingData);},_messageFetchPrepareParams:function(){var params=this._super.apply(this,arguments);if(this.options['display_rating']){params['rating_include']=true;const ratingValue=this.get('rating_value');if(ratingValue!==false){params['rating_value']=ratingValue;}} 9607return params;},_renderRatingCard:function(){this.$('.o_website_rating_card_container').replaceWith(qweb.render("portal_rating.rating_card",{widget:this}));},_newPublisherCommentData:function(messageIndex){return{mes_index:messageIndex,publisher_id:this.options.partner_id,publisher_avatar:_.str.sprintf('/web/image/res.partner/%s/avatar_128/50x50',this.options.partner_id),publisher_name:_t("Write your comment"),publisher_datetime:'',publisher_comment:'',};},_preprocessCommentData:function(rawRating,messageIndex){var ratingData={id:rawRating.id,mes_index:messageIndex,publisher_datetime:rawRating.publisher_datetime?moment(time.str_to_datetime(rawRating.publisher_datetime)).format('MMMM Do YYYY, h:mm:ss a'):"",publisher_comment:rawRating.publisher_comment?rawRating.publisher_comment:'',};if(rawRating.publisher_id&&rawRating.publisher_id.length>=2){ratingData.publisher_id=rawRating.publisher_id[0];ratingData.publisher_name=rawRating.publisher_id[1];ratingData.publisher_avatar=_.str.sprintf('/web/image/res.partner/%s/avatar_128/50x50',ratingData.publisher_id);} 9608var commentData=_.extend(this._newPublisherCommentData(messageIndex),ratingData);return commentData;},_getCommentContainer:function($source){return $source.parents(".o_wrating_publisher_container").first().find(".o_wrating_publisher_comment").first();},_getCommentButton:function($source){return $source.parents(".o_wrating_publisher_container").first().find(".o_wrating_js_publisher_comment_btn").first();},_getCommentTextarea:function($source){return $source.parents(".o_wrating_publisher_container").first().find(".o_portal_rating_comment_input").first();},_focusTextComment:function($source){this._getCommentTextarea($source).focus();},_onChangeDomain:function(){const spinnerDelayed=setTimeout(()=>{this.$('.o_portal_chatter_messages_loading').removeClass('d-none');this.$('.o_portal_chatter_messages').addClass('d-none');},500);return this._super.apply(this,arguments).finally(()=>{clearTimeout(spinnerDelayed);this.$('.o_portal_chatter_messages_loading').addClass('d-none');this.$('.o_portal_chatter_messages').removeClass('d-none');});},_onClickStarDomain:function(ev){var $tr=this.$(ev.currentTarget);var num=$tr.data('star');this.set('rating_value',num);},_onClickStarDomainReset:function(ev){ev.stopPropagation();ev.preventDefault();this.set('rating_value',false);},_onClickPublisherComment:function(ev){var $source=this.$(ev.currentTarget);if(this._getCommentTextarea($source).length===1){this._getCommentContainer($source).empty();return;} 9609var messageIndex=$source.data("mes_index");var data={is_publisher:this.options['is_user_publisher']};data.rating=this._newPublisherCommentData(messageIndex);var oldRating=this.messages[messageIndex].rating;data.rating.publisher_comment=oldRating.publisher_comment?oldRating.publisher_comment:'';this._getCommentContainer($source).html($(qweb.render("portal_rating.chatter_rating_publisher_form",data)));this._focusTextComment($source);},_onClickPublisherCommentDelete:function(ev){var self=this;var $source=this.$(ev.currentTarget);var messageIndex=$source.data("mes_index");var ratingId=this.messages[messageIndex].rating.id;this._rpc({route:'/website/rating/comment',params:{"rating_id":ratingId,"publisher_comment":''}}).then(function(res){self.messages[messageIndex].rating=self._preprocessCommentData(res,messageIndex);self._getCommentButton($source).removeClass("d-none");self._getCommentContainer($source).empty();});},_onClickPublisherCommentSubmit:function(ev){var self=this;var $source=this.$(ev.currentTarget);var messageIndex=$source.data("mes_index");var comment=this._getCommentTextarea($source).val();var ratingId=this.messages[messageIndex].rating.id;this._rpc({route:'/website/rating/comment',params:{"rating_id":ratingId,"publisher_comment":comment}}).then(function(res){self.messages[messageIndex].rating=self._preprocessCommentData(res,messageIndex);if(self.messages[messageIndex].rating.publisher_comment!==''){self._getCommentButton($source).addClass('d-none');self._getCommentContainer($source).html($(qweb.render("portal_rating.chatter_rating_publisher_comment",{rating:self.messages[messageIndex].rating,is_publisher:self.options.is_user_publisher})));}else{self._getCommentButton($source).removeClass("d-none");self._getCommentContainer($source).empty();}});},_onClickPublisherCommentCancel:function(ev){var $source=this.$(ev.currentTarget);var messageIndex=$source.data("mes_index");var comment=this.messages[messageIndex].rating.publisher_comment;if(comment){var data={rating:this.messages[messageIndex].rating,is_publisher:this.options.is_user_publisher};this._getCommentContainer($source).html($(qweb.render("portal_rating.chatter_rating_publisher_comment",data)));}else{this._getCommentContainer($source).empty();}},_onChangeRatingDomain:function(){var domain=[];if(this.get('rating_value')){domain=[['rating_value','=',this.get('rating_value')
9609]];} 9610this._changeCurrentPage(1,domain);},});});; 9611 9612/* /portal_rating/static/src/js/portal_composer.js */ 9613odoo.define('rating.portal.composer',function(require){'use strict';var core=require('web.core');var portalComposer=require('portal.composer');var _t=core._t;var PortalComposer=portalComposer.PortalComposer;PortalComposer.include({events:_.extend({},PortalComposer.prototype.events,{'click .stars i':'_onClickStar','mouseleave .stars':'_onMouseleaveStarBlock','mousemove .stars i':'_onMoveStar','mouseleave .stars i':'_onMoveLeaveStar',}),init:function(parent,options){this._super.apply(this,arguments);if(options.default_rating_value){options.default_rating_value=parseFloat(options.default_rating_value);} 9614this.options=_.defaults(this.options,{'rate_with_void_content':false,'default_message':false,'default_message_id':false,'default_rating_value':4.0,'force_submit_url':false,});this.labels={'0':"",'1':_t("I hate it"),'2':_t("I don't like it"),'3':_t("It's okay"),'4':_t("I like it"),'5':_t("I love it"),};this.user_click=false;this.set("star_value",this.options.default_rating_value);this.on("change:star_value",this,this._onChangeStarValue);},start:function(){var self=this;return this._super.apply(this,arguments).then(function(){self.$input=self.$('input[name="rating_value"]');self.$star_list=self.$('.stars').find('i');if(!self.options.default_message_id){self.$star_list.removeClass('text-black-25');} 9615self.set("star_value",self.options.default_rating_value);self.$input.val(self.options.default_rating_value);});},_prepareMessageData:function(){return Object.assign(this._super(...arguments)||{},{'message_id':this.options.default_message_id,'rating_value':this.$input.val()});},_onChangeStarValue:function(){var val=this.get("star_value");var index=Math.floor(val);var decimal=val-index;this.$star_list.removeClass('fa-star fa-star-half-o').addClass('fa-star-o');this.$('.stars').find("i:lt("+index+")").removeClass('fa-star-o fa-star-half-o').addClass('fa-star');if(decimal){this.$('.stars').find("i:eq("+index+")").removeClass('fa-star-o fa-star fa-star-half-o').addClass('fa-star-half-o');} 9616this.$('.rate_text .badge').text(this.labels[index]);},_onClickStar:function(ev){var index=this.$('.stars i').index(ev.currentTarget);this.set("star_value",index+1);this.user_click=true;this.$input.val(this.get("star_value"));},_onMouseleaveStarBlock:function(){this.$('.rate_text').hide();},_onMoveStar:function(ev){var index=this.$('.stars i').index(ev.currentTarget);this.$('.rate_text').show();this.set("star_value",index+1);},_onMoveLeaveStar:function(){if(!this.user_click){this.set("star_value",parseInt(this.$input.val()));} 9617this.user_click=false;},_onSubmitButtonClick:function(ev){return this._super(...arguments).then((result)=>{const $modal=this.$el.closest('#ratingpopupcomposer');$modal.on('hidden.bs.modal',()=>{this.trigger_up('reload_rating_popup_composer',result);});$modal.modal('hide');});},_onSubmitCheckContent:function(ev){if(this.options.rate_with_void_content){if(this.$input.val()===0){return _t('The rating is required. Please make sure to select one before sending your review.')} 9618return false;} 9619return this._super.apply(this,arguments);},});});; 9620 9621/* /portal_rating/static/src/js/portal_rating_composer.js */ 9622odoo.define('portal.rating.composer',function(require){'use strict';const publicWidget=require('web.public.widget');const session=require('web.session');const portalComposer=require('portal.composer');const{_t,qweb}=require('web.core');const PortalComposer=portalComposer.PortalComposer;const RatingPopupComposer=publicWidget.Widget.extend({selector:'.o_rating_popup_composer',custom_events:{reload_rating_popup_composer:'_onReloadRatingPopupComposer',},willStart:function(parent){const def=this._super.apply(this,arguments);const options=this.$el.data();this.rating_avg=Math.round(options['rating_avg']*100)/100||0.0;this.rating_count=options['rating_count']||0.0;this.options=_.defaults({},options,{'token':false,'res_model':false,'res_id':false,'pid':0,'display_rating':true,'csrf_token':odoo.csrf_token,'user_id':session.user_id,});return def;},start:function(){return Promise.all([this._super.apply(this,arguments),this._reloadRatingPopupComposer(),]);},_reloadRatingPopupComposer:function(){if(this.options.hide_rating_avg){this.$('.o_rating_popup_composer_stars').empty();}else{const ratingAverage=qweb.render('portal_rating.rating_stars_static',{inline_mode:true,widget:this,val:this.rating_avg,});this.$('.o_rating_popup_composer_stars').empty().html(ratingAverage);} 9623const modal=qweb.render('portal_rating.PopupComposer',{inline_mode:true,widget:this,val:this.rating_avg,});this.$('.o_rating_popup_composer_modal').html(modal);if(this._composer){this._composer.destroy();} 9624this._composer=new PortalComposer(this,this.options);return this._composer.appendTo(this.$('.o_rating_popup_composer_modal .o_portal_chatter_composer')).then(()=>{this.$('.o_rating_popup_composer_text').text(this.options.is_fullscreen?_t('Review'):this.options.default_message_id?_t('Edit Review'):_t('Add Review'));});},_onReloadRatingPopupComposer:function(event){const data=event.data;this.rating_avg=data.rating_avg;this.rating_count=data.rating_count;this.rating_value=data.rating_value;delete data.rating_avg;delete data.rating_count;delete data.rating_value;this.options=_.extend(this.options,data);this._reloadRatingPopupComposer();}});publicWidget.registry.RatingPopupComposer=RatingPopupComposer;return RatingPopupComposer;});; 9625 9626/* /website_sale/static/src/js/tours/tour_utils.js */ 9627odoo.define("website_sale.tour_utils",function(require){"use strict";const core=require("web.core");const _t=core._t;const wTourUtils=require('website.tour_utils');function addToCart({productName,search=true,productHasVariants=false}){const steps=[];if(search){steps.push(...searchProduct(productName));} 9628steps.push(wTourUtils.clickOnElement(productName,`a:contains(${productName})`));steps.push(wTourUtils.clickOnElement('Add to cart','#add_to_cart'));if(productHasVariants){steps.push(wTourUtils.clickOnElement('Continue Shopping','button:contains("Continue Shopping")'));} 9629return steps;} 9630function assertCartContains({productName,backend,notContains=false}={}){let trigger=`a:contains(${productName})`;if(notContains){trigger=`:not(${trigger})`;} 9631return{content:`Checking if ${productName} is in the cart`,trigger:`${backend ? "iframe" : ""} ${trigger}`,run:()=>{}};} 9632function assertProductPrice(attribute,value,productName){return{content:`The ${attribute} of the ${productName} is ${value}`,trigger:`div:contains("${productName}") [data-oe-expression="template_price_vals['${attribute}']"] .oe_currency_value:contains("${value}")`,run:()=>{}};} 9633function fillAdressForm(adressParams={name:"John Doe",phone:"123456789",email:"[email protected]",street:"1 rue de la paix",city:"Paris",zip:"75000"}){let steps=[];steps.push({content:"Address filling",trigger:'select[name="country_id"]',run:()=>{$('input[name="name"]').val(adressParams.name);$('input[name="phone"]').val(adressParams.phone);$('input[name="email"]').val(adressParams.email);$('input[name="street"]').val(adressParams.street);$('input[name="city"]').val(adressParams.city);$('input[name="zip"]').val(adressParams.zip);$('#country_id option:eq(1)').attr('selected',true);}});steps.push({content:"Next",trigger:'.oe_cart .btn:contains("Next")',});return steps;} 9634function goToCart({quantity=1,position="bottom",backend=false}={}){return{content:_t("Go to cart"),trigger:`${backend ? "iframe" : ""} a:has(.my_cart_quantity:containsExact(${quantity}))`,position:position,run:"click",};} 9635function searchProduct(productName){return[wTourUtils.clickOnElement('Shop','a:contains("Shop")'),{content:"Search for the product",trigger:'form input[name="search"]',run:`text ${productName}`},wTourUtils.clickOnElement('Search','form:has(input[name="search"]) .oe_search_button'),];} 9636function selectPriceList(pricelist){return[{content:"Click on pricelist dropdown",trigger:"div.o_pricelist_dropdown a[data-bs-toggle=dropdown]",},{content:"Click on pricelist",trigger:`span:contains(${pricelist})`,},];} 9637return{addToCart,assertCartContains,assertProductPrice,fillAdressForm,goToCart,selectPriceList,searchProduct,};});; 9638 9639/* /sale/static/src/js/variant_mixin.js */ 9640odoo.define('sale.VariantMixin',function(require){'use strict';var concurrency=require('web.concurrency');var core=require('web.core');var utils=require('web.utils');var ajax=require('web.ajax');var session=require('web.session');var _t=core._t;var VariantMixin={events:{'change .css_attribute_color input':'_onChangeColorAttribute','click .o_variant_pills':'_onChangePillsAttribute','change .main_product:not(.in_cart) input.js_quantity':'onChangeAddQuantity','change [data-attribute_exclusions]':'onChangeVariant'},onChangeVariant:function(ev){var $parent=$(ev.target).closest('.js_product');if(!$parent.data('uniqueId')){$parent.data('uniqueId',_.uniqueId());} 9641this._throttledGetCombinationInfo($parent.data('uniqueId'))(ev);},_getCombinationInfo:function(ev){if($(ev.target).hasClass('variant_custom_value')){return Promise.resolve();} 9642const $parent=$(ev.target).closest('.js_product');if(!$parent.length){return Promise.resolve();} 9643const combination=this.getSelectedVariantValues($parent);let parentCombination;if($parent.hasClass('main_product')){parentCombination=$parent.find('ul[data-attribute_exclusions]').data('attribute_exclusions').parent_combination;const $optProducts=$parent.parent().find(`[data-parent-unique-id='${$parent.data('uniqueId')}']`);for(const optionalProduct of $optProducts){const $currentOptionalProduct=$(optionalProduct);const childCombination=this.getSelectedVariantValues($currentOptionalProduct);const productTemplateId=parseInt($currentOptionalProduct.find('.product_template_id').val());ajax.jsonRpc(this._getUri('/sale/get_combination_info'),'call',{'product_template_id':productTemplateId,'product_id':this._getProductId($currentOptionalProduct),'comb
9643ination':childCombination,'add_qty':parseInt($currentOptionalProduct.find('input[name="add_qty"]').val()),'pricelist_id':this.pricelistId||false,'parent_combination':combination,'context':session.user_context,...this._getOptionalCombinationInfoParam($currentOptionalProduct),}).then((combinationData)=>{if(this._shouldIgnoreRpcResult()){return;} 9644this._onChangeCombination(ev,$currentOptionalProduct,combinationData);this._checkExclusions($currentOptionalProduct,childCombination,combinationData.parent_exclusions);});}}else{parentCombination=this.getSelectedVariantValues($parent.parent().find('.js_product.in_cart.main_product'));} 9645return ajax.jsonRpc(this._getUri('/sale/get_combination_info'),'call',{'product_template_id':parseInt($parent.find('.product_template_id').val()),'product_id':this._getProductId($parent),'combination':combination,'add_qty':parseInt($parent.find('input[name="add_qty"]').val()),'pricelist_id':this.pricelistId||false,'parent_combination':parentCombination,'context':session.user_context,...this._getOptionalCombinationInfoParam($parent),}).then((combinationData)=>{if(this._shouldIgnoreRpcResult()){return;} 9646this._onChangeCombination(ev,$parent,combinationData);this._checkExclusions($parent,combination,combinationData.parent_exclusions);});},_getOptionalCombinationInfoParam($product){return{};},handleCustomValues:function($target){var $variantContainer;var $customInput=false;if($target.is('input[type=radio]')&&$target.is(':checked')){$variantContainer=$target.closest('ul').closest('li');$customInput=$target;}else if($target.is('select')){$variantContainer=$target.closest('li');$customInput=$target.find('option[value="'+$target.val()+'"]');} 9647if($variantContainer){if($customInput&&$customInput.data('is_custom')==='True'){var attributeValueId=$customInput.data('value_id');var attributeValueName=$customInput.data('value_name');if($variantContainer.find('.variant_custom_value').length===0||$variantContainer.find('.variant_custom_value').data('custom_product_template_attribute_value_id')!==parseInt(attributeValueId)){$variantContainer.find('.variant_custom_value').remove();const previousCustomValue=$customInput.attr("previous_custom_value");var $input=$('<input>',{type:'text','data-custom_product_template_attribute_value_id':attributeValueId,'data-attribute_value_name':attributeValueName,class:'variant_custom_value form-control mt-2'});$input.attr('placeholder',attributeValueName);$input.addClass('custom_value_radio');$variantContainer.append($input);if(previousCustomValue){$input.val(previousCustomValue);}}}else{$variantContainer.find('.variant_custom_value').remove();}}},onClickAddCartJSON:function(ev){ev.preventDefault();var $link=$(ev.currentTarget);var $input=$link.closest('.input-group').find("input");var min=parseFloat($input.data("min")||0);var max=parseFloat($input.data("max")||Infinity);var previousQty=parseFloat($input.val()||0,10);var quantity=($link.has(".fa-minus").length?-1:1)+previousQty;var newQty=quantity>min?(quantity<max?quantity:max):min;if(newQty!==previousQty){$input.val(newQty).trigger('change');} 9648return false;},onChangeAddQuantity:function(ev){var $parent;if($(ev.currentTarget).closest('.oe_advanced_configurator_modal').length>0){$parent=$(ev.currentTarget).closest('.oe_advanced_configurator_modal');}else if($(ev.currentTarget).closest('form').length>0){$parent=$(ev.currentTarget).closest('form');}else{$parent=$(ev.currentTarget).closest('.o_product_configurator');} 9649this.triggerVariantChange($parent);},triggerVariantChange:function($container){$container.find('ul[data-attribute_exclusions]').trigger('change');$container.find('input.js_variant_change:checked, select.js_variant_change').each(function(){VariantMixin.handleCustomValues($(this));});},getCustomVariantValues:function($container){var variantCustomValues=[];$container.find('.variant_custom_value').each(function(){var $variantCustomValueInput=$(this);if($variantCustomValueInput.length!==0){variantCustomValues.push({'custom_product_template_attribute_value_id':$variantCustomValueInput.data('custom_product_template_attribute_value_id'),'attribute_value_name':$variantCustomValueInput.data('attribute_value_name'),'custom_value':$variantCustomValueInput.val(),});}});return variantCustomValues;},getNoVariantAttributeValues:function($container){var noVariantAttributeValues=[];var variantsValuesSelectors=['input.no_variant.js_variant_change:checked','select.no_variant.js_variant_change'];$container.find(variantsValuesSelectors.join(',')).each(function(){var $variantValueInput=$(this);var singleNoCustom=$variantValueInput.data('is_single')&&!$variantValueInput.data('is_custom');if($variantValueInput.is('select')){$variantValueInput=$variantValueInput.find('option[value='+$variantValueInput.val()+']');} 9650if($variantValueInput.length!==0&&!singleNoCustom){noVariantAttributeValues.push({'custom_product_template_attribute_value_id':$variantValueInput.data('value_id'),'attribute_value_name':$variantValueInput.data('value_name'),'value':$variantValueInput.val(),'attribute_name':$variantValueInput.data('attribute_name'),'is_custom':$variantValueInput.data('is_custom')});}});return noVariantAttributeValues;},getSelectedVariantValues:function($container){var values=[];var unchangedValues=$container.find('div.oe_unchanged_value_ids').data('unchanged_value_ids')||[];var variantsValuesSelectors=['input.js_variant_change:checked','select.js_variant_change'];_.each($container.find(variantsValuesSelectors.join(', ')),function(el){values.push(+$(el).val());});return values.concat(unchangedValues);},selectOrCreateProduct:function($container,productId,productTemplateId,useAjax){productId=parseInt(productId);productTemplateId=parseInt(productTemplateId);
9650var productReady=Promise.resolve();if(productId){productReady=Promise.resolve(productId);}else{var params={product_template_id:productTemplateId,product_template_attribute_value_ids:JSON.stringify(VariantMixin.getSelectedVariantValues($container)),};var route='/sale/create_product_variant';if(useAjax){productReady=ajax.jsonRpc(route,'call',params);}else if(Boolean(this._rpc)){productReady=this._rpc({route:route,params:params});}else{productReady=this.rpc(route,params);}} 9651return productReady;},_checkExclusions:function($parent,combination,parentExclusions){var self=this;var combinationData=$parent.find('ul[data-attribute_exclusions]').data('attribute_exclusions');if(parentExclusions&&combinationData.parent_exclusions){combinationData.parent_exclusions=parentExclusions;} 9652$parent.find('option, input, label, .o_variant_pills').removeClass('css_not_available').attr('title',function(){return $(this).data('value_name')||'';}).data('excluded-by','');if(combinationData.exclusions){_.each(combination,function(current_ptav){if(combinationData.exclusions.hasOwnProperty(current_ptav)){_.each(combinationData.exclusions[current_ptav],function(excluded_ptav){self._disableInput($parent,excluded_ptav,current_ptav,combinationData.mapped_attribute_names);});}});} 9653if(combinationData.archived_combinations){combinationData.archived_combinations.forEach((excludedCombination)=>{const ptavCommon=excludedCombination.filter((ptav)=>combination.includes(ptav));if(!!ptavCommon&&(combination.length===excludedCombination.length)&&(ptavCommon.length===combination.length)){combination.forEach((ptav)=>{combination.forEach((ptavOther)=>{if(ptav===ptavOther){return;} 9654self._disableInput($parent,ptav,ptavOther,combinationData.mapped_attribute_names,);})})}else if(!!ptavCommon&&(combination.length===excludedCombination.length)&&(ptavCommon.length===(combination.length-1))){const disabledPtav=excludedCombination.find((ptav)=>!combination.includes(ptav));excludedCombination.forEach((ptav)=>{if(ptav===disabledPtav){return;} 9655self._disableInput($parent,disabledPtav,ptav,combinationData.mapped_attribute_names,)});}});} 9656_.each(combinationData.parent_exclusions,function(exclusions,excluded_by){_.each(exclusions,function(ptav){self._disableInput($parent,ptav,excluded_by,combinationData.mapped_attribute_names,combinationData.parent_product_name);});});},_getProductId:function($parent){return parseInt($parent.find('.product_id').val());},_disableInput:function($parent,attributeValueId,excludedBy,attributeNames,productName){var $input=$parent.find('option[value='+attributeValueId+'], input[value='+attributeValueId+']');$input.addClass('css_not_available');$input.closest('label').addClass('css_not_available');$input.closest('.o_variant_pills').addClass('css_not_available');if(excludedBy&&attributeNames){var $target=$input.is('option')?$input:$input.closest('label').add($input);var excludedByData=[];if($target.data('excluded-by')){excludedByData=JSON.parse($target.data('excluded-by'));} 9657var excludedByName=attributeNames[excludedBy];if(productName){excludedByName=productName+' ('+excludedByName+')';} 9658excludedByData.push(excludedByName);$target.attr('title',_.str.sprintf(_t('Not available with %s'),excludedByData.join(', ')));$target.data('excluded-by',JSON.stringify(excludedByData));}},_onChangeCombination:function(ev,$parent,combination){var self=this;var $price=$parent.find(".oe_price:first .oe_currency_value");var $default_price=$parent.find(".oe_default_price:first .oe_currency_value");var $optional_price=$parent.find(".oe_optional:first .oe_currency_value");$price.text(self._priceToStr(combination.price));$default_price.text(self._priceToStr(combination.list_price));var isCombinationPossible=true;if(!_.isUndefined(combination.is_combination_possible)){isCombinationPossible=combination.is_combination_possible;} 9659this._toggleDisable($parent,isCombinationPossible);if(combination.has_discounted_price&&!combination.compare_list_price){$default_price.closest('.oe_website_sale').addClass("discount");$optional_price.closest('.oe_optional').removeClass('d-none').css('text-decoration','line-through');$default_price.parent().removeClass('d-none');}else{$default_price.closest('.oe_website_sale').removeClass("discount");$optional_price.closest('.oe_optional').addClass('d-none');$default_price.parent().addClass('d-none');} 9660var rootComponentSelectors=['tr.js_product','.oe_website_sale','.o_product_configurator'];if(!combination.product_id||!this.last_product_id||combination.product_id!==this.last_product_id){this.last_product_id=combination.product_id;self._updateProductImage($parent.closest(rootComponentSelectors.join(', ')),combination.display_image,combination.product_id,combination.product_template_id,combination.carousel,isCombinationPossible);} 9661$parent.find('.product_id').first().val(combination.product_id||0).trigger('change');$parent.find('.product_display_name').first().text(combination.display_name);$parent.find('.js_raw_price').first().text(combination.price).trigger('change');this.handleCustomValues($(ev.target));},_priceToStr:function(price){var l10n=_t.database.parameters;var precision=2;if($('.decimal_precision').length){precision=parseInt($('.decimal_precision').last().data('precision'));} 9662var formatted=_.str.sprintf('%.'+precision+'f',price).split('.');formatted[0]=utils.insert_thousand_seps(formatted[0]);return formatted.join(l10n.decimal_point);},_throttledGetCombinationInfo:_.memoize(function(uniqueId){var dropMisordered=new concurrency.DropMisordered();var _getCombinationInfo=_.throttle(this._getCombinationInfo.bind(this),500);return function(ev,params){return dropMisordered.add(_getCombinationInfo(ev,params));};}),_toggleDisable:function($parent,isCombinationPossible){$parent.toggleClass('css_not_available',!isCombinationPossible);if($parent.hasClass('in_cart')){const primaryButton=$parent.parents('.modal
9662-content').find('.modal-footer .btn-primary');primaryButton.prop('disabled',!isCombinationPossible);primaryButton.toggleClass('disabled',!isCombinationPossible);}},_updateProductImage:function($productContainer,displayImage,productId,productTemplateId){var model=productId?'product.product':'product.template';var modelId=productId||productTemplateId;var imageUrl='/web/image/{0}/{1}/'+(this._productImageField?this._productImageField:'image_1024');var imageSrc=imageUrl.replace("{0}",model).replace("{1}",modelId);var imagesSelectors=['span[data-oe-model^="product."][data-oe-type="image"] img:first','img.product_detail_img','span.variant_image img','img.variant_image',];var $img=$productContainer.find(imagesSelectors.join(', '));if(displayImage){$img.removeClass('invisible').attr('src',imageSrc);}else{$img.addClass('invisible');}},_onChangeColorAttribute:function(ev){var $parent=$(ev.target).closest('.js_product');$parent.find('.css_attribute_color').removeClass("active").filter(':has(input:checked)').addClass("active");},_onChangePillsAttribute:function(ev){const radio=ev.target.closest('.o_variant_pills').querySelector("input");radio.click();var $parent=$(ev.target).closest('.js_product');$parent.find('.o_variant_pills').removeClass("active").filter(':has(input:checked)').addClass("active");},_shouldIgnoreRpcResult(){return(typeof this.isDestroyed==="function"&&this.isDestroyed());},_getUri:function(uri){return uri;}};return VariantMixin;});; 9663 9664/* /website_sale/static/src/js/variant_mixin.js */ 9665odoo.define('website_sale.VariantMixin',function(require){'use strict';var VariantMixin=require('sale.VariantMixin');VariantMixin._getUri=function(uri){if(this.isWebsite){return uri+'_website';}else{return uri;}};const originalOnChangeCombination=VariantMixin._onChangeCombination;VariantMixin._onChangeCombination=function(ev,$parent,combination){const $pricePerUom=$parent.find(".o_base_unit_price:first .oe_currency_value");if($pricePerUom){if(combination.is_combination_possible!==false&&combination.base_unit_price!=0){$pricePerUom.parents(".o_base_unit_price_wrapper").removeClass("d-none");$pricePerUom.text(this._priceToStr(combination.base_unit_price));$parent.find(".oe_custom_base_unit:first").text(combination.base_unit_name);}else{$pricePerUom.parents(".o_base_unit_price_wrapper").addClass("d-none");}} 9666if('product_tracking_info'in combination){const $product=$('#product_detail');$product.data('product-tracking-info',combination['product_tracking_info']);$product.trigger('view_item_event',combination['product_tracking_info']);} 9667const addToCart=$parent.find('#add_to_cart_wrap');const contactUsButton=$parent.find('#contact_us_wrapper');const productPrice=$parent.find('.product_price');const quantity=$parent.find('.css_quantity');const product_unavailable=$parent.find('#product_unavailable');if(combination.prevent_zero_price_sale){productPrice.removeClass('d-inline-block').addClass('d-none');quantity.removeClass('d-inline-flex').addClass('d-none');addToCart.removeClass('d-inline-flex').addClass('d-none');contactUsButton.removeClass('d-none').addClass('d-flex');product_unavailable.removeClass('d-none').addClass('d-flex')}else{productPrice.removeClass('d-none').addClass('d-inline-block');quantity.removeClass('d-none').addClass('d-inline-flex');addToCart.removeClass('d-none').addClass('d-inline-flex');contactUsButton.removeClass('d-flex').addClass('d-none');product_unavailable.removeClass('d-flex').addClass('d-none')} 9668originalOnChangeCombination.apply(this,[ev,$parent,combination]);};const originalToggleDisable=VariantMixin._toggleDisable;VariantMixin._toggleDisable=function($parent,isCombinationPossible){if($parent.hasClass('in_cart')){const secondaryButton=$parent.parents('.modal-content').find('.modal-footer .btn-secondary');secondaryButton.prop('disabled',!isCombinationPossible);secondaryButton.toggleClass('disabled',!isCombinationPossible);} 9669originalToggleDisable.apply(this,[$parent,isCombinationPossible]);};return VariantMixin;});; 9670 9671/* /website_sale/static/src/js/website_sale.js */ 9672odoo.define('website_sale.cart',function(require){'use strict';const{browser}=require("@web/core/browser/browser");const sessionStorage=browser.sessionStorage;var publicWidget=require('web.public.widget');var core=require('web.core');var _t=core._t;var timeout;publicWidget.registry.websiteSaleCartLink=publicWidget.Widget.extend({selector:'#top a[href$="/shop/cart"]:not(.js_change_lang), #top_menu a[href$="/shop/cart"]:not(.js_change_lang)',events:{'mouseenter':'_onMouseEnter','mouseleave':'_onMouseLeave','click':'_onClick',},init:function(){this._super.apply(this,arguments);this._popoverRPC=null;this._onVisibilityChange=this._onVisibilityChange.bind(this);},willStart(){return Promise.all([this._super.apply(this,arguments),this._updateCartQuantityValue()]);},start:function(){this.$el.popover({trigger:'manual',animation:true,html:true,title:function(){return _t("My Cart");},container:'body',placement:'auto',template:'<div class="popover mycart-popover" role="tooltip"><div class="tooltip-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'});window.addEventListener('visibilitychange',this._onVisibilityChange);this._updateCartQuantityText();return this._super.apply(this,arguments);},destroy(){window.removeEventListener('visibilitychange',this._onVisibilityChange);this._super(...arguments);},_onMouseEnter:function(ev){let self=this;self.hovered=true;clearTimeout(timeout);$(this.selector).not(ev.currentTarget).popover('hide');timeout=setTimeout(function(){if(!self.hovered||$('.mycart-popover:visible').length){return;} 9673self._popoverRPC=$.get("/shop/cart",{type:'popover',}).then(function(data){const popover=Popover.getInstance(self.$el[0]);popover._config.content=data;popover.setContent(popover.getTipElement());self.$el.popover("show");$('.popover').on('mouseleave',function(){self.$el.trigger('mouseleave');});self.cartQty=+$(data).find('.o_wsale_cart_quantity').text();sessionStorage.setItem('website_sale_cart_quantity',self.cartQty);self._updateCartQuantityText();});},300);},_onMouseLeave:function(ev){let self=this;self.hovered=false;setTimeout(function(){if($('.popover:hover').length){return;} 9674if(!self.$el.is(':hover')){self.$el.popover('hide');}},1000);},_onClick:function(ev){clearTimeout(timeout);
9674if(this._popoverRPC&&this._popoverRPC.state()==='pending'){ev.preventDefault();var href=ev.currentTarget.href;this._popoverRPC.then(function(){window.location.href=href;});}},_onVisibilityChange(ev){if(ev.target.visibilityState==='visible'){this._updateCartQuantityValue().then(this._updateCartQuantityText.bind(this));}},async _updateCartQuantityValue(){if('website_sale_cart_quantity'in sessionStorage){this.cartQty=sessionStorage.getItem('website_sale_cart_quantity');} 9675if(this.el.querySelector('.my_cart_quantity')&&this.el.querySelector('.my_cart_quantity').innerText!=this.cartQty){return this._rpc({route:"/shop/cart/quantity"}).then((cartQty)=>{this.cartQty=cartQty;sessionStorage.setItem('website_sale_cart_quantity',this.cartQty);});}},_updateCartQuantityText(){if(this.cartQty!==undefined&&this.el.querySelector('.my_cart_quantity')){this.el.querySelector('.my_cart_quantity').innerText=this.cartQty;}}});});odoo.define('website_sale.website_sale_offcanvas',function(require){'use strict';var publicWidget=require('web.public.widget');publicWidget.registry.websiteSaleOffcanvas=publicWidget.Widget.extend({selector:'#o_wsale_offcanvas',events:{'show.bs.offcanvas':'_toggleFilters','hidden.bs.offcanvas':'_toggleFilters',},_toggleFilters:function(ev){for(const btn of this.el.querySelectorAll('button[data-status]')){if(btn.classList.contains('collapsed')&&btn.dataset.status=="active"||!btn.classList.contains('collapsed')&&btn.dataset.status=="inactive"){btn.click();}}},});});odoo.define('website_sale.website_sale',function(require){'use strict';var core=require('web.core');var config=require('web.config');var publicWidget=require('web.public.widget');var VariantMixin=require('website_sale.VariantMixin');var wSaleUtils=require('website_sale.utils');const cartHandlerMixin=wSaleUtils.cartHandlerMixin;require("web.zoomodoo");const{extraMenuUpdateCallbacks}=require('website.content.menu');const dom=require('web.dom');const{ComponentWrapper}=require('web.OwlCompatibility');const{ProductImageViewerWrapper}=require("@website_sale/js/components/website_sale_image_viewer");publicWidget.registry.WebsiteSale=publicWidget.Widget.extend(VariantMixin,cartHandlerMixin,{selector:'.oe_website_sale',events:_.extend({},VariantMixin.events||{},{'change form .js_product:first input[name="add_qty"]':'_onChangeAddQuantity','mouseup .js_publish':'_onMouseupPublish','touchend .js_publish':'_onMouseupPublish','change .oe_cart input.js_quantity[data-product-id]':'_onChangeCartQuantity','click .oe_cart a.js_add_suggested_products':'_onClickSuggestedProduct','click a.js_add_cart_json':'_onClickAddCartJSON','click .a-submit':'_onClickSubmit','change form.js_attributes input, form.js_attributes select':'_onChangeAttribute','mouseup form.js_add_cart_json label':'_onMouseupAddCartLabel','touchend form.js_add_cart_json label':'_onMouseupAddCartLabel','click .show_coupon':'_onClickShowCoupon','submit .o_wsale_products_searchbar_form':'_onSubmitSaleSearch','change select[name="country_id"]':'_onChangeCountry','change #shipping_use_same':'_onChangeShippingUseSame','click .toggle_summary':'_onToggleSummary','click #add_to_cart, .o_we_buy_now, #products_grid .o_wsale_product_btn .a-submit':'async _onClickAdd','click input.js_product_change':'onChangeVariant','change .js_main_product [data-attribute_exclusions]':'onChangeVariant','change oe_advanced_configurator_modal [data-attribute_exclusions]':'onChangeVariant','click .o_product_page_reviews_link':'_onClickReviewsLink','submit':'_onClickConfirmOrder','mousedown .o_wsale_filmstip_wrapper':'_onMouseDown','mouseleave .o_wsale_filmstip_wrapper':'_onMouseLeave','mouseup .o_wsale_filmstip_wrapper':'_onMouseUp','mousemove .o_wsale_filmstip_wrapper':'_onMouseMove','click .o_wsale_filmstip_wrapper':'_onClickHandler',}),init:function(){this._super.apply(this,arguments);this._changeCartQuantity=_.debounce(this._changeCartQuantity.bind(this),500);this._changeCountry=_.debounce(this._changeCountry.bind(this),500);this.isWebsite=true;this.filmStripStartX=0;this.filmStripIsDown=false;this.filmStripScrollLeft=0;this.filmStripMoved=false;delete this.events['change .main_product:not(.in_cart) input.js_quantity'];delete this.events['change [data-attribute_exclusions]'];},start(){const def=this._super(...arguments);this._applyHashFromSearch();_.each(this.$('div.js_product'),function(product){$('input.js_product_change',product).first().trigger('change');});this.triggerVariantChange(this.$el);this.$('select[name="country_id"]').change();core.bus.on('resize',this,function(){if(config.device.size_class===config.device.SIZES.XL){$('.toggle_summary_div').addClass('d-none d-xl-block');}});this._startZoom();window.addEventListener('hashchange',()=>{this._applyHash();this.triggerVariantChange(this.$el);});this.getRedirectOption();return def;},destroy(){this._super.apply(this,arguments);this._cleanupZoom();}
9675,getSelectedVariantValues:function($container){var combination=$container.find('input.js_product_change:checked').data('combination');if(combination){return combination;} 9676return VariantMixin.getSelectedVariantValues.apply(this,arguments);},_onMouseDown:function(ev){this.filmStripIsDown=true;this.filmStripStartX=ev.pageX-ev.currentTarget.offsetLeft;this.filmStripScrollLeft=ev.currentTarget.scrollLeft;this.formerTarget=ev.target;this.filmStripMoved=false;},_onMouseLeave:function(ev){if(!this.filmStripIsDown){return;} 9677ev.currentTarget.classList.remove('activeDrag');this.filmStripIsDown=false},_onMouseUp:function(ev){this.filmStripIsDown=false;ev.currentTarget.classList.remove('activeDrag');},_onMouseMove:function(ev){if(!this.filmStripIsDown){return;} 9678ev.preventDefault();ev.currentTarget.classList.add('activeDrag');this.filmStripMoved=true;const x=ev.pageX-ev.currentTarget.offsetLeft;const walk=(x-this.filmStripStartX)*2;ev.currentTarget.scrollLeft=this.filmStripScrollLeft-walk;},_onClickHandler:function(ev){if(this.filmStripMoved){ev.stopPropagation();ev.preventDefault();}},_applyHash:function(){var hash=window.location.hash.substring(1);if(hash){var params=$.deparam(hash);if(params['attr']){var attributeIds=params['attr'].split(',');var $inputs=this.$('input.js_variant_change, select.js_variant_change option');_.each(attributeIds,function(id){var $toSelect=$inputs.filter('[data-value_id="'+id+'"]');if($toSelect.is('input[type="radio"]')){$toSelect.prop('checked',true);}else if($toSelect.is('option')){$toSelect.prop('selected',true);}});this._changeAttribute(['.css_attribute_color','.o_variant_pills']);}}},_setUrlHash:function($parent){var $attributes=$parent.find('input.js_variant_change:checked, select.js_variant_change option:selected');var attributeIds=_.map($attributes,function(elem){return $(elem).data('value_id');});window.location.replace('#attr='+attributeIds.join(','));},_changeAttribute:function(valueSelectors){_.each(valueSelectors,function(selector){$(selector).removeClass("active").filter(':has(input:checked)').addClass("active");});},_changeCartQuantity:function($input,value,$dom_optional,line_id,productIDs){_.each($dom_optional,function(elem){$(elem).find('.js_quantity').text(value);productIDs.push($(elem).find('span[data-product-id]').data('product-id'));});$input.data('update_change',true);this._rpc({route:"/shop/cart/update_json",params:{line_id:line_id,product_id:parseInt($input.data('product-id'),10),set_qty:value},}).then(function(data){$input.data('update_change',false);var check_value=parseInt($input.val()||0,10);if(isNaN(check_value)){check_value=1;} 9679if(value!==check_value){$input.trigger('change');return;} 9680sessionStorage.setItem('website_sale_cart_quantity',data.cart_quantity);if(!data.cart_quantity){return window.location='/shop/cart';} 9681$input.val(data.quantity);$('.js_quantity[data-line-id='+line_id+']').val(data.quantity).text(data.quantity);wSaleUtils.updateCartNavBar(data);wSaleUtils.showWarning(data.warning);core.bus.trigger('cart_amount_changed',data.amount,data.minor_amount);});},_changeCountry:function(){if(!$("#country_id").val()){return;} 9682this._rpc({route:"/shop/country_infos/"+$("#country_id").val(),params:{mode:$("#country_id").attr('mode'),},}).then(function(data){$("input[name='phone']").attr('placeholder',data.phone_code!==0?'+'+data.phone_code:'');var selectStates=$("select[name='state_id']");if(selectStates.data('init')===0||selectStates.find('option').length===1){if(data.states.length||data.state_required){selectStates.html('');_.each(data.states,function(x){var opt=$('<option>').text(x[1]).attr('value',x[0]).attr('data-code',x[2]);selectStates.append(opt);});selectStates.parent('div').show();}else{selectStates.val('').parent('div').hide();} 9683selectStates.data('init',0);}else{selectStates.data('init',0);} 9684if(data.fields){if($.inArray('zip',data.fields)>$.inArray('city',data.fields)){$(".div_zip").before($(".div_city"));}else{$(".div_zip").after($(".div_city"));} 9685var all_fields=["street","zip","city","country_name"];_.each(all_fields,function(field){$(".checkout_autoformat .div_"+field.split('_')[0]).toggle($.inArray(field,data.fields)>=0);});} 9686if($("label[for='zip']").length){$("label[for='zip']").toggleClass('label-optional',!data.zip_required);$("label[for='zip']").get(0).toggleAttribute('required',!!data.zip_required);} 9687if($("label[for='zip']").length){$("label[for='state_id']").toggleClass('label-optional',!data.state_required);$("label[for='state_id']").get(0).toggleAttribute('required',!!data.state_required);}});},_getProductId:function($parent){if($parent.find('input.js_product_change').length!==0){return parseInt($parent.find('input.js_product_change:checked').val());} 9688else{return VariantMixin._getProductId.apply(this,arguments);}},_getProductImageLayout:function(){return document.querySelector("#product_detail_main").dataset.image_layout;},_getProductImageWidth:function(){return document.querySelector("#product_detail_main").dataset.image_width;},_getProductImageContainerSelector:function(){return{'carousel':"#o-carousel-product",'grid':"#o-grid-product",}[this._getProductImageLayout()];},_getProductImageContainer:function(){return document.querySelector(this._getProductImageContainerSelector());},_isEditorEnabled(){return document.body.classList.contains("editor_enable");},_startZoom:function(){const salePage=document.querySelector(".o_wsale_product_page");if(!salePage||config.device.mobile||this._getProductImageWidth()==="none"){return;} 9689this._cleanupZoom();this.zoomCleanup=[];if(salePage.dataset.ecomZoomAuto){const images=salePage.querySelectorAll("img[data-zoom]");for(const image of images){const $image=$(image);const callback=()=>
9689{$image.zoomOdoo({event:"mouseenter",attach:this._getProductImageContainerSelector(),preventClicks:salePage.dataset.ecomZoomClick,attachToTarget:this._getProductImageLayout()==="grid",});image.dataset.zoom=1;};image.addEventListener('load',callback);this.zoomCleanup.push(()=>{image.removeEventListener('load',callback);const zoomOdoo=$image.data("zoomOdoo");if(zoomOdoo){zoomOdoo.hide();$image.unbind();}});if(image.complete){callback();}}} 9690if(salePage.dataset.ecomZoomClick){const images=salePage.querySelectorAll(".product_detail_img");for(const image of images){const handler=()=>{if(salePage.dataset.ecomZoomAuto){const flyouts=document.querySelectorAll(".zoomodoo-flyout");for(const flyout of flyouts){flyout.remove();}} 9691const dialog=new ComponentWrapper(this,ProductImageViewerWrapper,{selectedImageIdx:[...images].indexOf(image),images,});dialog.mount(document.body);};image.addEventListener("click",handler);this.zoomCleanup.push(()=>{image.removeEventListener("click",handler);});}}},_cleanupZoom(){if(!this.zoomCleanup||!this.zoomCleanup.length){return;} 9692for(const cleanup of this.zoomCleanup){cleanup();} 9693this.zoomCleanup=undefined;},_updateProductImage:function($productContainer,displayImage,productId,productTemplateId,newImages,isCombinationPossible){let $images=$productContainer.find(this._getProductImageContainerSelector());if($images.length&&!this._isEditorEnabled()){const $newImages=$(newImages);$images.after($newImages);$images.remove();$images=$newImages;if($images.attr('id')==='o-carousel-product'){$images.carousel(0);} 9694this._startZoom();this.trigger_up('widgets_start_request',{$target:$images});} 9695$images.toggleClass('css_not_available',!isCombinationPossible);},_onClickAdd:function(ev){ev.preventDefault();var def=()=>{this.getCartHandlerOptions(ev);return this._handleAdd($(ev.currentTarget).closest('form'));};if($('.js_add_cart_variants').children().length){return this._getCombinationInfo(ev).then(()=>{return!$(ev.target).closest('.js_product').hasClass("css_not_available")?def():Promise.resolve();});} 9696return def();},_handleAdd:function($form){var self=this;this.$form=$form;var productSelector=['input[type="hidden"][name="product_id"]','input[type="radio"][name="product_id"]:checked'];var productReady=this.selectOrCreateProduct($form,parseInt($form.find(productSelector.join(', ')).first().val(),10),$form.find('.product_template_id').val(),false);return productReady.then(function(productId){$form.find(productSelector.join(', ')).val(productId);self._updateRootProduct($form,productId);return self._onProductReady();});},_onProductReady:function(){return this._submitForm();},_submitForm:function(){const params=this.rootProduct;const $product=$('#product_detail');const productTrackingInfo=$product.data('product-tracking-info');if(productTrackingInfo){productTrackingInfo.quantity=params.quantity;$product.trigger('add_to_cart_event',[productTrackingInfo]);} 9697params.add_qty=params.quantity;params.product_custom_attribute_values=JSON.stringify(params.product_custom_attribute_values);params.no_variant_attribute_values=JSON.stringify(params.no_variant_attribute_values);delete params.quantity;return this.addToCart(params);},_onClickAddCartJSON:function(ev){this.onClickAddCartJSON(ev);},_onChangeAddQuantity:function(ev){this.onChangeAddQuantity(ev);},_onMouseupPublish:function(ev){$(ev.currentTarget).parents('.thumbnail').toggleClass('disabled');},_onChangeCartQuantity:function(ev){var $input=$(ev.currentTarget);if($input.data('update_change')){return;} 9698var value=parseInt($input.val()||0,10);if(isNaN(value)){value=1;} 9699var $dom=$input.closest('tr');var $dom_optional=$dom.nextUntil(':not(.optional_product.info)');var line_id=parseInt($input.data('line-id'),10);var productIDs=[parseInt($input.data('product-id'),10)];this._changeCartQuantity($input,value,$dom_optional,line_id,productIDs);},_onClickSuggestedProduct:function(ev){$(ev.currentTarget).prev('input').val(1).trigger('change');},_onClickSubmit:function(ev,forceSubmit){if($(ev.currentTarget).is('#add_to_cart, #products_grid .a-submit')&&!forceSubmit){return;} 9700var $aSubmit=$(ev.currentTarget);if(!ev.isDefaultPrevented()&&!$aSubmit.is(".disabled")){ev.preventDefault();$aSubmit.closest('form').submit();} 9701if($aSubmit.hasClass('a-submit-disable')){$aSubmit.addClass("disabled");} 9702if($aSubmit.hasClass('a-submit-loading')){var loading='<span class="fa fa-cog fa-spin"/>';var fa_span=$aSubmit.find('span[class*="fa"]');if(fa_span.length){fa_span.replaceWith(loading);}else{$aSubmit.append(loading);}}},_onChangeAttribute:function(ev){if(!ev.isDefaultPrevented()){ev.preventDefault();const productGrid=this.el.querySelector(".o_wsale_products_grid_table_wrapper");if(productGrid){productGrid.classList.add("opacity-50");} 9703$(ev.currentTarget).closest("form").submit();}},_onMouseupAddCartLabel:function(ev){var $label=$(ev.currentTarget);var $price=$label.parents("form:first").find(".oe_price .oe_currency_value");if(!$price.data("price")){$price.data("price",parseFloat($price.text()));} 9704var value=$price.data("price")+parseFloat($label.find(".badge span").text()||0);var dec=value%1;$price.html(value+(dec<0.01?".00":(dec<1?"0":"")));},_onClickShowCoupon:function(ev){$(".show_coupon").hide();$('.coupon_form').removeClass('d-none');},_onSubmitSaleSearch:function(ev){if(!this.$('.dropdown_sorty_by').length){return;} 9705var $this=$(ev.currentTarget);if(!ev.isDefaultPrevented()&&!$this.is(".disabled")){ev.preventDefault();var oldurl=$this.attr('action');oldurl+=(oldurl.indexOf("?")===-1)?"?":"";if($this.find('[name=noFuzzy]').val()==="true"){oldurl+='&noFuzzy=true';} 9706var search=$this.find('input.search-query');window.location=oldurl+'&'+search.attr('name')+'='+encodeURIComponent(search.val());}},_onChangeCountry:function(ev){if(!this.$('.checkout_autoformat').length){return;} 9707this._changeCountry();},_onChangeShippingUseSame:function(ev){$('.ship_to_other').toggle(!$(ev.currentTarget).prop('checked'));},_toggleDisable:function($parent,isCombinationPossible){VariantMixin._toggleDisable.apply(this,arguments);$parent.find("#add_to_cart").toggleClass('disabled',!isCombinationPossible);$parent.find(".o_we_buy_now").toggleClass('disabled',!isCombinationPossible);},onChangeVariant:function(ev){var $component=$(ev.currentTarget).closest('.js_product');$component.find('input').each(function(){var $el=$(this);$el.attr('checked',$el.is(':checked'));});$component.find('select option').each(function(){var $el=$(this);$el.attr('selected',$el.is(':selected'));});this._setUrlHash($component);return VariantMixin.onChangeVariant.apply(this,arguments);},_onToggleSummary:function(){$('.toggle_summary_div').toggleClass('d-none');$('.toggle_summary_div').removeClass('d-xl-block');},_applyHashFromSearch(){const params=$.deparam(window.location.search.slice(1));if(params.attrib){const dataValueIds=[];for(const attrib of[].concat(params.attrib)){const attribSplit=attrib.split('-');const attribValueSelector=`.js_variant_change[name="ptal-${attribSplit[0]}"][value="${attribSplit[1]}"]`;const attribValue=this.el.querySelector(attribValueSelector);if(attribValue!==null){dataValueIds.push(attribValue.dataset.value_id);}} 9708if(dataValueIds.length){window.location.hash=`attr=${dataValueIds.join(',')}`;}} 9709this._applyHash();},_onClickReviewsLink:function(){$('#o_product_page_reviews_content').collapse('show');},_onClickConfirmOrder:function(){const submitFormButton=$('form[name="o_wsale_confirm_order"]').find('button[type="submit"]');submitFormButton.attr('disabled',true);setTimeout(()=>submitFormButton.attr('disabled',false),5000);},_updateRootProduct($form,productId){this.rootProduct={product_id:productId,quantity:parseFloat($form.find('input[name="add_qty"]').val()||1),product_custom_attribute_values:this.getCustomVariantValues($form.find('.js_product')),variant_values:this.getSelectedVariantValues($form.find('.js_product')),no_variant_attribute_values:this.getNoVariantAttributeValues($form.find('.js_product'))};},});publicWidget.registry.WebsiteSaleLayout=publicWidget.Widget.extend({selector:'.oe_website_sale',disabledInEditableMode:false,events:{'change .o_wsale_apply_layout input':'_onApplyShopLayoutChange',},_onApplyShopLayoutChange:function(ev){const wysiwyg=this.options.wysiwyg;if(wysiwyg){wysiwyg.odooEditor.observerUnactive('_onApplyShopLayoutChange');} 9710var clickedValue=$(ev.target).val();var isList=clickedValue==='list';if(!this.editableMode){this._rpc({route:'/shop/save_shop_layout_mode',params:{'layout_mode':isList?'list':'grid',},});} 9711const activeClasses=ev.target.parentElement.dataset.activeClasses.split(' ');ev.target.parentElement.querySelectorAll('.btn').forEach((btn)=>{activeClasses.map(c=>btn.classList.toggle(c));});var $grid=this.$('#products_grid');$grid.find('*').css('transition','none');$grid.toggleClass('o_wsale_layout_list',isList);void $grid[0].offsetWidth;$grid.find('*').css('transition','');if(wysiwyg){wysiwyg.odooEditor.observerActive('_onApplyShopLayoutChange');}},});publicWidget.registry.websiteSaleCart=publicWidget.Widget.extend({selector:'.oe_website_sale .oe_cart',events:{'click .js_change_shipping':'_onClickChangeShipping','click .js_edit_address':'_onClickEditAddress','click .js_delete_product':'_onClickDeleteProduct',},_onClickChangeShipping:function(ev){var $old=$('.all_shipping').find('.card.border.border-primary');$old.find('.btn-ship').toggle();$old.addClass('js_change_shipping');$old.removeClass('border border-primary');var $new=$(ev.currentTarget).parent('div.one_kanban').find('.card');$new.find('.btn-ship').toggle();$new.removeClass('js_change_shipping');$new.addClass('border border-primary');var $form=$(ev.currentTarget).parent('div.one_kanban').find('form.d-none');$.post($form.attr('action'),$form.serialize()+'&xhr=1');},_onClickEditAddress:function(ev){ev.preventDefault();$(ev.currentTarget).closest('div.one_kanban').find('form.d-none').attr('action','/s
9711hop/address').submit();},_onClickDeleteProduct:function(ev){ev.preventDefault();$(ev.currentTarget).closest('tr').find('.js_quantity').val(0).trigger('change');},});publicWidget.registry.websiteSaleCarouselProduct=publicWidget.Widget.extend({selector:'#o-carousel-product',disabledInEditableMode:false,events:{'wheel .o_carousel_product_indicators':'_onMouseWheel',},async start(){await this._super(...arguments);this._updateCarouselPosition();extraMenuUpdateCallbacks.push(this._updateCarouselPosition.bind(this));if(this.$target.find('.carousel-indicators').length>0){this.$target.on('slide.bs.carousel.carousel_product_slider',this._onSlideCarouselProduct.bind(this));$(window).on('resize.carousel_product_slider',_.throttle(this._onSlideCarouselProduct.bind(this),150));this._updateJustifyContent();}},destroy(){this.$target.css('top','');this.$target.off('.carousel_product_slider');this._super(...arguments);},_updateCarouselPosition(){this.$target.css('top',dom.scrollFixedOffset()+5);},_onSlideCarouselProduct:function(ev){const isReversed=this.$target.css('flex-direction')==="column-reverse";const isLeftIndicators=this.$target.hasClass('o_carousel_product_left_indicators');const $indicatorsDiv=isLeftIndicators?this.$target.find('.o_carousel_product_indicators'):this.$target.find('.carousel-indicators');let indicatorIndex=$(ev.relatedTarget).index();indicatorIndex=indicatorIndex>-1?indicatorIndex:this.$target.find('li.active').index();const $indicator=$indicatorsDiv.find('[data-bs-slide-to='+indicatorIndex+']');const indicatorsDivSize=isLeftIndicators&&!isReversed?$indicatorsDiv.outerHeight():$indicatorsDiv.outerWidth();const indicatorSize=isLeftIndicators&&!isReversed?$indicator.outerHeight():$indicator.outerWidth();const indicatorPosition=isLeftIndicators&&!isReversed?$indicator.position().top:$indicator.position().left;const scrollSize=isLeftIndicators&&!isReversed?$indicatorsDiv[0].scrollHeight:$indicatorsDiv[0].scrollWidth;let indicatorsPositionDiff=(indicatorPosition+(indicatorSize/2))-(indicatorsDivSize/2);indicatorsPositionDiff=Math.min(indicatorsPositionDiff,scrollSize-indicatorsDivSize);this._updateJustifyContent();const indicatorsPositionX=isLeftIndicators&&!isReversed?'0':'-'+indicatorsPositionDiff;const indicatorsPositionY=isLeftIndicators&&!isReversed?'-'+indicatorsPositionDiff:'0';const translate3D=indicatorsPositionDiff>0?"translate3d("+indicatorsPositionX+"px,"+indicatorsPositionY+"px,0)":'';$indicatorsDiv.css("transform",translate3D);},_updateJustifyContent:function(){const $indicatorsDiv=this.$target.find('.carousel-indicators');$indicatorsDiv.css('justify-content','start');if(config.device.size_class<=config.device.SIZES.MD){if(($indicatorsDiv.children().last().position().left+this.$target.find('li').outerWidth())<$indicatorsDiv.outerWidth()){$indicatorsDiv.css('justify-content','center');}}},_onMouseWheel:function(ev){ev.preventDefault();if(ev.originalEvent.deltaY>0){this.$target.carousel('next');}else{this.$target.carousel('prev');}},});publicWidget.registry.websiteSaleProductPageReviews=publicWidget.Widget.extend({selector:'#o_product_page_reviews',disabledInEditableMode:false,async start(){await this._super(...arguments);this._updateChatterComposerPosition();extraMenuUpdateCallbacks.push(this._updateChatterComposerPosition.bind(this));},destroy(){this.$target.find('.o_portal_chatter_composer').css('top','');this._super(...arguments);},_updateChatterComposerPosition(){this.$target.find('.o_portal_chatter_composer').css('top',dom.scrollFixedOffset()+20);},});return{WebsiteSale:publicWidget.registry.WebsiteSale,WebsiteSaleLayout:publicWidget.registry.WebsiteSaleLayout,websiteSaleCart:publicWidget.registry.websiteSaleCart,WebsiteSaleCarouselProduct:publicWidget.registry.websiteSaleCarouselProduct,WebsiteSaleProductPageReviews:publicWidget.registry.websiteSaleProductPageReviews,};});odoo.define('website_sale.price_range_option',function(require){'use strict';const publicWidget=require('web.public.widget');publicWidget.registry.multirangePriceSelector=publicWidget.Widget.extend({selector:'.o_wsale_products_page',events:{'newRangeValue #o_wsale_price_range_option input[type="range"]':'_onPriceRangeSelected',},_onPriceRangeSelected(ev){const range=ev.currentTarget;const searchParams=new URLSearchParams(window.location.search);searchParams.delete("min_price");
9711searchParams.delete("max_price");if(parseFloat(range.min)!==range.valueLow){searchParams.set("min_price",range.valueLow);} 9712if(parseFloat(range.max)!==range.valueHigh){searchParams.set("max_price",range.valueHigh);} 9713let product_list_div=this.el.querySelector('.o_wsale_products_grid_table_wrapper');if(product_list_div){product_list_div.classList.add('opacity-50');} 9714window.location.search=searchParams.toString();},});});; 9715 9716/* /website_sale/static/src/js/website_sale_utils.js */ 9717odoo.define('website_sale.utils',function(require){'use strict';const wUtils=require('website.utils');const cartHandlerMixin={getRedirectOption(){const html=document.documentElement;this.stayOnPageOption=html.dataset.add2cartRedirect==='1';this.forceDialog=html.dataset.add2cartRedirect==='2';},getCartHandlerOptions(ev){this.isBuyNow=ev.currentTarget.classList.contains('o_we_buy_now');const targetSelector=ev.currentTarget.dataset.animationSelector||'img';this.$itemImgContainer=this.$(ev.currentTarget).closest(`:has(${targetSelector})`);},addToCart(params){if(this.isBuyNow){params.express=true;}else if(this.stayOnPageOption){return this._addToCartInPage(params);} 9718return wUtils.sendRequest('/shop/cart/update',params);},_addToCartInPage(params){params.force_create=true;return this._rpc({route:"/shop/cart/update_json",params:params,}).then(async data=>{sessionStorage.setItem('website_sale_cart_quantity',data.cart_quantity);if(data.cart_quantity&&(data.cart_quantity!==parseInt($(".my_cart_quantity").text()))){if($('div[data-image_width]').data('image_width')!=='none'){await animateClone($('header .o_wsale_my_cart').first(),this.$itemImgContainer,25,40);} 9719updateCartNavBar(data);}});},};function animateClone($cart,$elem,offsetTop,offsetLeft){if(!$cart.length){return Promise.resolve();} 9720$cart.removeClass('d-none').find('.o_animate_blink').addClass('o_red_highlight o_shadow_animation').delay(500).queue(function(){$(this).removeClass("o_shadow_animation").dequeue();}).delay(2000).queue(function(){$(this).removeClass("o_red_highlight").dequeue();});return new Promise(function(resolve,reject){if(!$elem)resolve();var $imgtodrag=$elem.find('img').eq(0);if($imgtodrag.length){var $imgclone=$imgtodrag.clone().offset({top:$imgtodrag.offset().top,left:$imgtodrag.offset().left}).removeClass().addClass('o_website_sale_animate').appendTo(document.body).css({width:$imgtodrag.width(),height:$imgtodrag.height(),}).animate({top:$cart.offset().top+offsetTop,left:$cart.offset().left+offsetLeft,width:75,height:75,},1000,'easeInOutExpo');$imgclone.animate({width:0,height:0,},function(){resolve();$(this).detach();});}else{resolve();}});} 9721function updateCartNavBar(data){$(".my_cart_quantity").parents('li.o_wsale_my_cart').removeClass('d-none').end().addClass('o_mycart_zoom_animation').delay(300).queue(function(){$(this).toggleClass('fa fa-warning',!data.cart_quantity).attr('title',data.warning).text(data.cart_quantity||'').removeClass('o_mycart_zoom_animation').dequeue();});$(".js_cart_lines").first().before(data['website_sale.cart_lines']).end().remove();$(".js_cart_summary").replaceWith(data['website_sale.short_cart_summary']);} 9722function showWarning(message){if(!message){return;} 9723var $page=$('.oe_website_sale');var cart_alert=$page.children('#data_warning');if(!cart_alert.length){cart_alert=$('<div class="alert alert-danger alert-dismissible" role="alert" id="data_warning">'+'<button type="button" class="btn-close" data-bs-dismiss="alert">×</button> '+'<span></span>'+'</div>').prependTo($page);} 9724cart_alert.children('span:last-child').text(message);} 9725return{animateClone:animateClone,updateCartNavBar:updateCartNavBar,cartHandlerMixin:cartHandlerMixin,showWarning:showWarning,};});; 9726 9727/* /website_sale/static/src/js/website_sale_payment.js */ 9728odoo.define('website_sale.payment',require=>{'use strict';const checkoutForm=require('payment.checkout_form');const publicWidget=require('web.public.widget');const websiteSalePaymentMixin={init:function(){this._onClickTCCheckbox=_.debounce(this._onClickTCCheckbox,100,true);this._super(...arguments);},start:function(){this.$checkbox=this.$('#checkbox_tc');this.$submitButton=this.$('button[name="o_payment_submit_button"]');this._adaptConfirmButton();return this._super(...arguments);},_adaptConfirmButton:function(){if(this.$checkbox.length>0){const disabledReasons=this.$submitButton.data('disabled_reasons')||{};disabledReasons.tc=!this.$checkbox.prop('checked');this.$submitButton.data('disabled_reasons',disabledReasons);}},};checkoutForm.include(Object.assign({},websiteSalePaymentMixin,{events:Object.assign({},checkoutForm.prototype.events,{'change #checkbox_tc':'_onClickTCCheckbox',}),_isButtonReady:function(){const disabledReasonFound=_.contains(this.$submitButton.data('disabled_reasons'),true);return!disabledReasonFound&&this._super();},_onClickTCCheckbox:function(){this._adaptConfirmButton();if(!this._enableButton()){this._disableButton(false);}},}));publicWidget.registry.WebsiteSalePayment=publicWidget.Widget.extend(Object.assign({},websiteSalePaymentMixin,{selector:'div[name="o_website_sale_free_cart"]',events:{'change #checkbox_tc':'_onClickTCCheckbox',},start:function(){this.$checkbox=this.$('#checkbox_tc');this.$submitButton=this.$('button[name="o_payment_submit_button"]');this._onClickTCCheckbox();return this._super(...arguments);},_onClickTCCheckbox:function(){this._adaptConfirmButton();const disabledReasonFound=_.contains(this.$submitButton.data('disabled_reasons'),true);this.$submitButton.prop('disabled',disabledReasonFound);},}));});; 9729 9730/* /website_sale/static/src/js/website_sale_validate.js */ 9731odoo.define('website_sale.validate',function(require){'use strict';var publicWidget=require('web.public.widget');var core=require('web.core');var _t=core._t;publicWidget.registry.websiteSaleValidate=publicWidget.Widget.extend({selector:'div.oe_website_sale_tx_status[data-order-id]',start:function(){var def=this._super.apply(this,arguments);this._poll_nbr=0;this._paymentTransationPollStatus();return def;},_paymentTransationPollStatus:function(){var self=this;this._rpc({route:'/shop/payment/get_status/'+parseInt(this.$el.data('order-id')),}).then(function(result){self._poll_nbr+=1;if(result.recall){if(self._poll_nbr<20){setTimeout(function(){self._paymentTransationPollStatus();},Math.ceil(self._poll_nbr/3)*1000);}else{var $message=$(result.message);var $warning=$("<i class='fa fa-warning' style='margin-right:10px;'>");$warning.attr("title",_t("We are waiting for confirmation from the bank or the payment provider"));$message.find('span:first').prepend($warning);result.message=$message.html();}} 9732self.$el.html(result.message);});},});});; 9733 9734/* /website_sale/static/src/js/website_sale_recently_viewed.js */ 9735odoo.define('website_sale.recently_viewed',function(require){var publicWidget=require('web.public.widget');const{getCookie,setCookie}=require('web.utils.cookies');publicWidget.registry.productsRecentlyViewedUpdate=publicWidget.Widget.extend({selector:'#product_detail',events:{'change input.product_id[name="product_id"]':'_onProductChange',},debounceValue:500,init:function(){this._super.apply(this,arguments);this._onProductChange=_.debounce(this._onProductChange,this.debounceValue);},_updateProductView:function($input){var productId=parseInt($input.val());var cookieName='seen_product_id_'+productId;if(!parseInt(this.el.dataset.viewTrack,10)){return;} 9736if(getCookie(cookieName)){return;} 9737if($(this.el).find('.js_product.css_not_available').length){return;} 9738this._rpc({route:'/shop/products/recently_viewed_update',params:{product_id:productId,}}).then(function(res){setCookie(cookieName,productId,30*60,'optional');});},_onProductChange:function(ev){this._updateProductView($(ev.currentTarget));},});});; 9739 9740/* /website_sale/static/src/js/website_sale_tracking.js */ 9741odoo.define('website_sale.tracking',function(require){var publicWidget=require('web.public.widget');publicWidget.registry.websiteSaleTracking=publicWidget.Widget.extend({selector:'.oe_website_sale',events:{'click form[action="/shop/cart/update"] a.a-submit':'_onAddProductIntoCart','click a[href="/shop/checkout"]':'_onCheckoutStart','click div.oe_cart a[href^="/web?redirect"][href$="/shop/checkout"]':'_onCustomerSignin','click form[action="/shop/confirm_order"] a.a-submit':'_onOrder','click form[target="_self"] button[type=submit]':'_onOrderPayment','view_item_event':'_onViewItem','add_to_cart_event':'_onAddToCart',},start:function(){var self=this;const $confirmation=this.$('div.oe_website_sale_tx_status');if($confirmation.length){const orderID=$confirmation.data('order-id');const json=$confirmation.data('order-tracking-info');this._vpv('/stats/ecom/order_confirmed/'+orderID);self._trackGA('event','purchase',json);} 9742return this._super.apply(this,arguments);},_trackGA:function(){const websiteGA=window.gtag||function(){};websiteGA.apply(this,arguments);},_vpv:function(page){this._trackGA('event','page_view',{'page_path':page,});},_onViewItem(event,productTrackingInfo){const trackingInfo={'currency':productTrackingInfo['currency'],'value':productTrackingInfo['price'],'items':[productTrackingInfo],};this._trackGA('event','view_item',trackingInfo);},_onAddToCart(event,...productsTrackingInfo){const trackingInfo={'currency':productsTrackingInfo[0]['currency'],'value':productsTrackingInfo.reduce((acc,val)=>acc+val['price']*val['quantity'],0),'items':productsTrackingInfo,};this._trackGA('event','add_to_cart',trackingInfo);},_onAddProductIntoCart:function(){var productID=this.$('input[name="product_id"]').attr('value');this._vpv('/stats/ecom/product_add_to_cart/'+productID);},_onCheckoutStart:function(){this._vpv('/stats/ecom/customer_checkout');},_onCustomerSignin:function(){this._vpv('/stats/ecom/customer_signin');},_onOrder:function(){if($('#top_menu [href="/web/login"]').length){this._vpv('/stats/ecom/customer_signup');} 9743this._vpv('/stats/ecom/order_checkout');},_onOrderPayment:function(){var method=$('#payment_method input[name=provider]:checked').nextAll('span:first').text();this._vpv('/stats/ecom/order_payment/'+method);},});return publicWidget.registry.websiteSaleTracking;});; 9744 9745/* /website/static/lib/multirange/multirange_custom.js */ 9746odoo.define('website_sale.multirange',function(){'use strict';const HTMLInputElement=window.HTMLInputElement;const descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");class Multirange{constructor(input,options={}){const self=this;this.input=input;this.rangeWithInput=options.rangeWithInput===true||this.input.classList.contains('range-with-input');const value=options.value||this.input.getAttribute("value");const values=value===null?[]:value.split(",");this.input.min=this.min=options.min||this.input.min||0;this.input.max=this.max=options.max||this.input.max||100;this.input.step=this.step=options.step||this.input.step||1;this.currency=options.currency||this.input.dataset.currency||'';this.currencyPosition=options.currencyPosition||this.input.dataset.currencyPosition||'after';const inputClasses=["multirange","d-inline-block","p-0","align-top"];this.rangeDiv=document.createElement("div");this.rangeDiv.classList.add("multirange-wrapper","position-relative","mb-5");this.countersWrapper=document.createElement("small");this.countersWrapper.classList.add("d-flex","justify-content-between","mt-2");this.rangeDiv.appendChild(this.countersWrapper);this.input.parentNode.insertBefore(this.rangeDiv,this.input.nextSibling);this.rangeDiv.appendChild(this.input);this.ghost=this.input.cloneNode();this.rangeDiv.appendChild(this.ghost);this.input.classList.add("original","position-absolute","w-100","m-0",...inputClasses);this.ghost.classList.add("ghost","position-relative",...inputClasses);this.input.value=values[0]||this.min;this.ghost.value=values[1]||this.max;this.leftCounter=document.createElement("span");this.leftCounter.classList.add("multirange-min","position-absolute","opacity-75","opacity-100-hover","mt-1");this.rightCounter=document.createElement("span");this.rightCounter.classList.add("multirange-max","position-absolute","opacity-75","opacity-100-hover","mt-1","end-0");this.countersWrapper.append(this.leftCounter,this.rightCounter);if(this.rangeWithInput){this.leftInput=document.createElement("input");this.leftInput.type="number";this.leftInput.classList.add("invisible","form-control","form-control-sm","mb-2","mb-lg-1");this.leftInput.min=this.min;this.leftInput.max=this.max;this.leftInput.step=this.step;this.rightInput=this.leftInput.cloneNode();this.leftInput.classList.add("multirange-min","invisible");this.rightInput.classList.add("multirange-max","invisible");this.leftCounter.parentNode.appendChild(this.leftInput);this.rightCounter.parentNode.appendChild(this.rightInput);} 9747Object.defineProperty(this.input,"originalValue",descriptor.get?descriptor:{get:function(){return this.value;},set:function(v){this.value=v;}});Object.defineProperties(this.input,{valueLow:{get:function(){return Math.min(this.originalValue,self.ghost.value);},set:function(v){this.originalValue=v;},enumerable:true},valueHigh:{get:function(){return Math.max(this.originalValue,self.ghost.value);},set:function(v){self.ghost.value=v;},enumerable:true}});if(descriptor.get){Object.defineProperty(this.input,"value",{get:function(){return this.valueLow+","+this.valueHigh;},set:function(v){const values=v.split(",");this.valueLow=values[0];this.valueHigh=values[1];this.update();},enumerable:true});} 9748if(typeof this.input.oninput==="function"){this.ghost.oninput=this.input.oninput.bind(this.input);} 9749this.input.addEventListener("input",this.update.bind(this));this.ghost.addEventListener("input",this.update.bind(this));this.input.addEventListener("touchstart",this.saveOldValues.bind(this));this.ghost.addEventListener("touchstart",this.saveOldValues.bind(this));this.input.addEventListener("mousedown",this.saveOldValues.bind(this));this.ghost.addEventListener("mousedown",this.saveOldValues.bind(this));this.input.addEventListener("touchend",this.dispatchNewValueEvent.bind(this));this.ghost.addEventListener("touchend",this.dispatchNewValueEvent.bind(this));this.input.addEventListener("mouseup",this.dispatchNewValueEvent.bind(this));this.ghost.addEventListener("mouseup",this.dispatchNewValueEvent.bind(this));if(this.rangeWithInput){this.leftCounter.addEventListener("click",this.counterInputSwitch.bind(this));this.rightCounter.addEventListener("click",this.counterInputSwitch.bind(this));this.leftInput.addEventListener("blur",this.counterInputSwitch.bind(this));this.rightInput.addEventListener("blur",this.counterInputSwitch.bind(this));this.leftInput.addEventListener("keypress",this.elementBlurOnEnter.bind(this));this.rightInput.addEventListener("keypress",this.elementBlurOnEnter.bind(this));this.leftInput.addEventListener("focus",this.selectAllFocus.bind(this));this.rightInput.addEventListener("focus",this.selectAllFocus.bind(this));} 9750this.update();$(this.rangeDiv).addClass('visible');} 9751update(){const low=100*(this.input.valueLow-this.min)/(this.max-this.min);const high=100*(this.input.valueHigh-this.min)/(this.max-this.min);
9751this.rangeDiv.style.setProperty("--low",low+'%');this.rangeDiv.style.setProperty("--high",high+'%');this.counterInputUpdate();} 9752counterInputUpdate(){if(this.rangeWithInput){this.leftCounter.innerText=this.formatNumber(this.input.valueLow);this.rightCounter.innerText=this.formatNumber(this.input.valueHigh);this.leftInput.value=this.input.valueLow;this.rightInput.value=this.input.valueHigh;}} 9753counterInputSwitch(ev){let counter=this.rightCounter;let input=this.rightInput;if(ev.currentTarget.classList.contains('multirange-min')){counter=this.leftCounter;input=this.leftInput;} 9754if(counter.classList.contains("invisible")){this.input.valueLow=this.leftInput.value;this.input.valueHigh=this.rightInput.value;this.dispatchNewValueEvent();this.update();counter.classList.remove("invisible");input.classList.add("invisible");}else{counter.classList.add("invisible");input.classList.remove("invisible");this.saveOldValues();window.setTimeout(function(){input.focus();},1);}} 9755elementBlurOnEnter(ev){if(ev.key==="Enter"){ev.currentTarget.blur();}} 9756selectAllFocus(ev){ev.currentTarget.select();} 9757dispatchNewValueEvent(){if(this._previousMaxPrice!==this.input.valueHigh||this._previousMinPrice!==this.input.valueLow){this.input.dispatchEvent(new CustomEvent("newRangeValue",{bubbles:true,}));}} 9758saveOldValues(){this._previousMinPrice=this.input.valueLow;this._previousMaxPrice=this.input.valueHigh;} 9759formatNumber(number){const language=document.querySelector("html").getAttribute("lang");const locale=language==="sr@latin"?"sr-Latn-RS":language.replace(/_/g,"-");let formatedNumber=number.toLocaleString(locale,{minimumFractionDigits:2,maximumFractionDigits:2,});if(this.currency.length){if(this.currencyPosition==='after'){formatedNumber=formatedNumber+' '+this.currency;}else{formatedNumber=this.currency+' '+formatedNumber;}} 9760return formatedNumber;}} 9761function multirange(input,options){if(input.classList.contains('multirange')){return;} 9762new Multirange(input,options);} 9763return{Multirange:Multirange,init:multirange,};});odoo.define('website_sale.multirange.instance',function(require){'use strict';const publicWidget=require('web.public.widget');const multirange=require('website_sale.multirange');publicWidget.registry.WebsiteMultirangeInputs=publicWidget.Widget.extend({selector:'input[type=range][multiple]:not(.multirange)',start(){return this._super.apply(this,arguments).then(()=>{multirange.init(this.el);});},});});; 9764 9765/* /website_sale/static/src/js/website_sale_category_link.js */ 9766odoo.define('@website_sale/js/website_sale_category_link',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget') 9767publicWidget.registry.ProductCategoriesLinks=publicWidget.Widget.extend({selector:'.o_wsale_products_page',events:{'click [data-link-href]':'_openLink',},_openLink:function(ev){const productsDiv=this.el.querySelector('.o_wsale_products_grid_table_wrapper');if(productsDiv){productsDiv.classList.add('opacity-50');} 9768window.location.href=ev.currentTarget.getAttribute('data-link-href');},});return __exports;});; 9769 9770/* /website_sale/static/src/js/components/website_sale_image_viewer.js */ 9771odoo.define('@website_sale/js/components/website_sale_image_viewer',async function(require){'use strict';let __exports={};const{useWowlService}=require('@web/legacy/utils');const{Dialog}=require("@web/core/dialog/dialog");const{useHotkey}=require("@web/core/hotkeys/hotkey_hook");const{Component,onRendered,useRef,useEffect,useState,xml}=owl;const ZOOM_STEP=0.1;const ProductImageViewer=__exports.ProductImageViewer=class ProductImageViewer extends Dialog{setup(){super.setup();this.imageContainerRef=useRef("imageContainer");this.images=[...this.props.images].map(image=>{return{src:image.dataset.zoomImage||image.src,thumbnailSrc:image.src.replace('/image_1024/','/image_128/'),};});this.state=useState({selectedImageIdx:this.props.selectedImageIdx||0,imageScale:1,});this.isDragging=false;this.dragStartPos={x:0,y:0};this.imageTranslate={x:0,y:0};useHotkey("arrowleft",this.previousImage.bind(this));useHotkey("arrowright",this.nextImage.bind(this));useHotkey("r",()=>{this.imageTranslate={x:0,y:0};this.isDragging=false;this.state.imageScale=1;this.updateImage();});useEffect((document)=>{const onGlobalClick=this.onGlobalClick.bind(this);document.addEventListener("click",onGlobalClick);return()=>{document.removeEventListener("click",onGlobalClick)};},()=>[document],);onRendered(()=>{this.updateImage();})} 9772get selectedImage(){return this.images[this.state.selectedImageIdx];} 9773set selectedImage(image){this.state.imageScale=1;this.imageTranslate={x:0,y:0};this.state.selectedImageIdx=this.images.indexOf(image);} 9774get imageStyle(){return`transform: 9775 scale3d(${this.state.imageScale}, ${this.state.imageScale}, 1); 9776 `;} 9777get imageContainerStyle(){return`transform: translate(${this.imageTranslate.x}px, ${this.imageTranslate.y}px);`;} 9778previousImage(){this.selectedImage=this.images[(this.state.selectedImageIdx-1+this.images.length)%this.images.length];} 9779nextImage(){this.selectedImage=this.images[(this.state.selectedImageIdx+1)%this.images.length];} 9780updateImage(){if(!this.imageContainerRef||!this.imageContainerRef.el){return;} 9781this.imageContainerRef.el.style=this.imageContainerStyle;} 9782onGlobalClick(ev){if(ev.target.tagName==="IMG"){if(this.dragStartPos.clientX===ev.clientX&&this.dragStartPos.clientY===ev.clientY){this.zoomIn(ZOOM_STEP*3);}} 9783if(ev.target.classList.contains('o_wsale_image_viewer_void')&&!this.isDragging){ev.stopPropagation();ev.preventDefault();this.data.close();}else{this.isDragging=false;}} 9784zoomIn(step=undefined){this.state.imageScale+=step||ZOOM_STEP;} 9785zoomOut(step=undefined){this.state.imageScale=Math.max(0.5,this.state.imageScale-(step||ZOOM_STEP));} 9786onWheelImage(ev){if(ev.deltaY>0){this.zoomOut();}else{this.zoomIn();}} 9787onMousedownImage(ev){this.isDragging=true;this.dragStartPos={x:ev.clientX-this.imageTranslate.x,y:ev.clientY-this.imageTranslate.y,clientX:ev.clientX,clientY:ev.clientY,};} 9788onGlobalMousemove(ev){if(!this.isDragging){return;} 9789this.imageTranslate.x=ev.clientX-this.dragStartPos.x;this.imageTranslate.y=ev.clientY-this.dragStartPos.y;this.updateImage();}} 9790ProductImageViewer.props={...Dialog.props,images:{type:NodeList,required:true},selectedImageIdx:{type:Number,optional:true},close:Function,};delete ProductImageViewer.props.slots;ProductImageViewer.template="website_sale.ProductImageViewer";const ProductImageViewerWrapper=__exports.ProductImageViewerWrapper=class ProductImageViewerWrapper extends Component{setup(){this.dialogs=useWowlService('dialog');onRendered(()=>{this.dialogs.add(ProductImageViewer,this.props);});}} 9791ProductImageViewerWrapper.template=xml``;return __exports;});; 9792 9793/* /website_sale/static/src/js/website_sale_reorder.js */ 9794odoo.define('@website_sale/js/website_sale_reorder',async function(require){'use strict';let __exports={};const{debounce:debounceFn}=require("@web/core/utils/timing");const publicWidget=require("web.public.widget");const{localization:l10n}=require("@web/core/l10n/localization");const{ComponentWrapper}=require("web.OwlCompatibility");const{intersperse,nbsp}=require("@web/core/utils/strings");const{ConfirmationDialog}=require("@web/core/confirmation_dialog/confirmation_dialog");function insertThousandsSep(number,thousandsSep=",",grouping=[]){const negative=number[0]==="-";number=negative?number.slice(1):number;return(negative?"-":"")+intersperse(number,grouping,thousandsSep);} 9795__exports.formatFloat=formatFloat;function formatFloat(value,digits=2){if(value===false){return"";} 9796const grouping=l10n.grouping;const thousandsSep=l10n.thousandsSep;const decimalPoint=l10n.decimalPoint;let precision=digits;const formatted=(value||0).toFixed(precision).split(".");formatted[0]=insertThousandsSep(formatted[0],thousandsSep,grouping);return formatted[1]?formatted.join(decimalPoint):formatted[0];} 9797__exports.formatMonetary=formatMonetary;function formatMonetary(value,currency){if(value===false){return"";} 9798const digits=(currency&¤cy.decimal_places)||2;let formattedValue=formatFloat(value,digits);if(!currency){return formattedValue;} 9799const formatted=[currency.symbol,formattedValue];if(currency.position==="after"){formatted.reverse();} 9800return formatted.join(nbsp);} 9801publicWidget.registry.SaleOrderPortalReorderWidget=publicWidget.Widget.extend({selector:".o_portal_sidebar",events:{"click .o_wsale_reorder_button":"_onReorder",},_onReorder(ev){const orderId=parseInt(ev.currentTarget.dataset.saleOrderId);const urlSearchParams=new URLSearchParams(window.location.search);if(!orderId||!urlSearchParams.has("access_token")){return;} 9802const dialogWrapper=new ComponentWrapper(this,ReorderDialogWrapper,{orderId:orderId,accessToken:urlSearchParams.get("access_token"),});dialogWrapper.mount(document.body);},});const{useService}=require("@web/core/utils/hooks");const{Dialog}=require("@web/core/dialog/dialog");const{Component,onRendered,onWillStart,xml}=owl;const ReorderDialogWrapper=__exports.ReorderDialogWrapper=class ReorderDialogWrapper extends Component{setup(){this.dialogService=useService("dialog");onRendered(()=>{this.dialogService.add(ReorderDialog,this.props);});}} 9803ReorderDialogWrapper.template=xml``;const ReorderConfirmationDialog=__exports.ReorderConfirmationDialog=class ReorderConfirmationDialog extends ConfirmationDialog{setup(){super.setup();this.env.dialogData.close=()=>this.props.close();}} 9804ReorderConfirmationDialog.template="website_sale.ReorderConfirmationDialog";const ReorderDialog=__exports.ReorderDialog=class ReorderDialog extends Component{setup(){this.rpc=useService("rpc");this.orm=useService("orm");this.dialogService=useService("dialog");this.formatMonetary=formatMonetary;onWillStart(this.onWillStartHandler.bind(this));} 9805async onWillStartHandler(){this.cartQty=parseInt(sessionStorage.getItem("website_sale_cart_quantity"));if(!this.cartQty){this.cartQty=await this.rpc("/shop/cart/quantity");} 9806this.content=await this.rpc("/my/orders/reorder_modal_content",{order_id:this.props.orderId,access_token:this.props.accessToken,});for(const product of this.content.products){product.debouncedLoadProductCombinationInfo=debounceFn(()=>{this.loadProductCombinationInfo(product).then(this.render.bind(this));},200);}} 9807get total(){return this.content.products.reduce((total,product)=>{if(product.add_to_cart_allowed){total+=product.combinationInfo.price*product.qty;} 9808return total;},0);} 9809get hasBuyableProducts(){return this.content.products.some((product)=>product.add_to_cart_allowed);} 9810async loadProductCombinationInfo(product){product.combinationInfo=await this.rpc("/sale/get_combination_info_website",{product_template_id:product.product_template_id,product_id:product.product_id,combination:product.combination,add_qty:product.qty,pricelist_id:false,context:{website_sale_no_images:true,},});} 9811getWarningForProduct(product){if(!product.add_to_cart_allowed){return this.env._t("This product is not available for purchase.");} 9812return false;} 9813changeProductQty(product,newQty){const productNewQty=Math.max(0,newQty);
9813const qtyChanged=productNewQty!==product.qty;product.qty=productNewQty;this.render(true);if(!qtyChanged){return;} 9814product.debouncedLoadProductCombinationInfo();} 9815onChangeProductQtyInput(ev,product){const newQty=parseFloat(ev.target.value)||product.qty;this.changeProductQty(product,newQty);} 9816async confirmReorder(ev){if(this.confirmed){return;} 9817this.confirmed=true;const onConfirm=async()=>{await this.addProductsToCart();window.location="/shop/cart";};if(this.cartQty){this.dialogService.add(ReorderConfirmationDialog,{body:this.env._t("Do you wish to clear your cart before adding products to it?"),confirm:async()=>{await this.rpc("/shop/cart/clear");await onConfirm();},cancel:onConfirm,});}else{await onConfirm();}} 9818async addProductsToCart(){for(const product of this.content.products){if(!product.add_to_cart_allowed){continue;} 9819await this.rpc("/shop/cart/update_json",{product_id:product.product_id,add_qty:product.qty,no_variant_attribute_values:JSON.stringify(product.no_variant_attribute_values),product_custom_attribute_values:JSON.stringify(product.product_custom_attribute_values),});}}} 9820ReorderDialog.props={close:Function,orderId:Number,accessToken:String,};ReorderDialog.components={Dialog,};ReorderDialog.template="website_sale.ReorderModal";return __exports;});; 9821 9822/* /mass_mailing/static/src/js/tours/mass_mailing_code_view.js */ 9823odoo.define('mass_mailing.mass_mailing_code_view_tour',function(require){"use strict";var tour=require('web_tour.tour');tour.register('mass_mailing_code_view_tour',{url:'/web',test:true,},[tour.stepUtils.showAppsMenuItem(),{trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{trigger:'button.o_list_button_add',},{trigger:'input#subject',content:('Pick the <b>email subject</b>.'),position:'bottom',run:'text Test'},{trigger:'div[name="contact_list_ids"] .o_input_dropdown input[type="text"]',content:'Click on the dropdown to open it and then start typing to search.',},{trigger:'div[name="contact_list_ids"] .ui-state-active',content:'Select item from dropdown',run:'click',},{trigger:'div[name="body_arch"] iframe #default',content:'Choose this <b>theme</b>.',run:'click',},{trigger:'iframe .o_codeview_btn',content:('Click here to switch to <b>code view</b>'),run:'click'},{trigger:'iframe .o_codeview',content:('Remove all content from codeview'),run:function(){const iframe=document.querySelector('.wysiwyg_iframe');const iframeDocument=iframe.contentWindow.document;let element=iframeDocument.querySelector(".o_codeview");element.value='';}},{trigger:'iframe .o_codeview_btn',content:('Click here to switch back from <b>code view</b>'),run:'click'},{trigger:'[name="body_arch"] iframe .o_mail_wrapper_td',content:'Verify that the dropable zone was not removed',run:()=>{},},{trigger:'[name="body_arch"] iframe #email_designer_default_body [name="Title"] .ui-draggable-handle',content:'Drag the "Title" snippet from the design panel and drop it in the editor',extra_trigger:'[name="body_arch"] iframe body.editor_enable',run:function(actions){actions.drag_and_drop('[name="body_arch"] iframe .o_editable',this.$anchor);}},{trigger:'[name="body_arch"] iframe .o_editable h1',content:'Verify that the title was inserted properly in the editor',run:()=>{},},{trigger:'button.o_form_button_save',content:'Click on the "Save" button to save the changes.',run:'click',},...tour.stepUtils.saveForm(),]);});; 9824 9825/* /mass_mailing/static/src/js/tours/mass_mailing_editor_tour.js */ 9826odoo.define('mass_mailing.mass_mailing_editor_tour',function(require){"use strict";var tour=require('web_tour.tour');const{boundariesIn,setSelection}=require('@web_editor/js/editor/odoo-editor/src/utils/utils');tour.register('mass_mailing_editor_tour',{url:'/web',test:true,},[tour.stepUtils.showAppsMenuItem(),{trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{trigger:'button.o_list_button_add',},{trigger:'div[name="contact_list_ids"] .o_input_dropdown input[type="text"]',},{trigger:'div[name="contact_list_ids"] .ui-state-active'},{content:'choose the theme "empty" to edit the mailing with snippets',trigger:'[name="body_arch"] iframe #empty',},{content:'wait for the editor to be rendered',trigger:'[name="body_arch"] iframe .o_editable[data-editor-message="DRAG BUILDING BLOCKS HERE"]',run:()=>{},},{content:'drag the "Title" snippet from the design panel and drop it in the editor',trigger:'[name="body_arch"] iframe #email_designer_default_body [name="Title"] .ui-draggable-handle',run:function(actions){actions.drag_and_drop('[name="body_arch"] iframe .o_editable',this.$anchor);}},{content:'wait for the snippet menu to finish the drop process',trigger:'[name="body_arch"] iframe #email_designer_header_elements:not(:has(.o_we_already_dragging))',run:()=>{}},{content:'verify that the title was inserted properly in the editor',trigger:'[name="body_arch"] iframe .o_editable h1',run:()=>{},},{trigger:'button.o_form_button_save',},{content:'verify that the save failed (since the field "subject" was not set and it is required)',trigger:'label.o_field_invali
9826d',run:()=>{},},{content:'verify that the edited mailing body was not lost during the failed save',trigger:'[name="body_arch"] iframe .o_editable h1',run:()=>{},},{trigger:'input#subject',run:'text Test',},{trigger:'.o_form_view',},...tour.stepUtils.saveForm(),{trigger:'iframe .o_editable',run:()=>{},}]);tour.register('mass_mailing_basic_theme_toolbar',{test:true,url:'/web',},[tour.stepUtils.showAppsMenuItem(),{content:"Select the 'Email Marketing' app.",trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{content:"Click on the create button to create a new mailing.",trigger:'button.o_list_button_add',},{content:"Fill in Subject",trigger:'#subject',run:'text Test Basic Theme',},{content:"Fill in Mailing list",trigger:'#contact_list_ids',run:'text Newsletter',},{content:"Pick 'Newsletter' option",trigger:'.o_input_dropdown a:contains(Newsletter)',},{content:"Pick the basic theme",trigger:'iframe #basic',extra_trigger:'iframe .o_mail_theme_selector_new',},{content:"Make sure the snippets menu is hidden",trigger:'iframe html:has(#oe_snippets.d-none)',run:()=>null,},{content:"Click on the New button to create another mailing",trigger:'button.o_form_button_create',},{content:"Fill in Subject",trigger:'#subject',extra_trigger:'iframe .o_mail_theme_selector_new',run:'text Test Newsletter Theme',},{content:"Fill in Mailing list",trigger:'#contact_list_ids',run:'text Newsletter',},{content:"Pick 'Newsletter' option",trigger:'.o_input_dropdown a:contains(Newsletter)',},{content:"Pick the newsletter theme",trigger:'iframe #newsletter',},{content:"Make sure the snippets menu is displayed",trigger:'iframe #oe_snippets',run:()=>null,},{content:'Save form',trigger:'.o_form_button_save',},{content:'Go back to previous mailing',trigger:'button.o_pager_previous',},{content:"Make sure the snippets menu is hidden",trigger:'iframe html:has(#oe_snippets.d-none)',run:()=>null,},{content:"Add some content to be selected afterwards",trigger:'iframe p',run:'text content',},{content:"Select text",trigger:'iframe p:contains(content)',run(){setSelection(...boundariesIn(this.$anchor[0]),false);}},{content:"Make sure the floating toolbar is visible",trigger:'#toolbar.oe-floating[style*="visible"]',run:()=>null,},{content:"Open the color picker",trigger:'#toolbar #oe-text-color',},{content:"Pick a color",trigger:'#toolbar button[data-color="o-color-1"]',},{content:"Check that color was applied",trigger:'iframe p font.text-o-color-1',run:()=>null,},{content:'Save changes',trigger:'.o_form_button_save',},{content:"Go to 'Mailings' list view",trigger:'.breadcrumb a:contains(Mailings)'},{content:"Open newly created mailing",trigger:'td:contains("Test Basic Theme")',},{content:"Make sure the snippets menu is hidden",trigger:'iframe html:has(#oe_snippets.d-none)',run:()=>null,},{content:"Select content",trigger:'iframe p:contains(content)',run(){setSelection(...boundariesIn(this.$anchor[0]),false);}},{content:"Make sure the floating toolbar is visible",trigger:'#toolbar.oe-floating[style*="visible"]',run:()=>null,},...tour.stepUtils.discardForm(),]);tour.register('mass_mailing_campaing_new_mailing',{url:'/web',test:true,},[tour.stepUtils.showAppsMenuItem(),{content:'Select the "Email Marketing" app',trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{content:'Select "Campaings" Navbar item',trigger:'.o_nav_entry[data-menu-xmlid="mass_mailing.menu_email_campaigns"]',},{content:'Select "Newsletter" campaign',trigger:'.oe_kanban_card:contains("Test Newsletter")',},{content:'Add a line (create new mailing)',trigger:'.o_field_x2many_list_row_add a',},{content:'Pick the basic theme',trigger:'iframe',run(actions){const link=this.$anchor[0].contentDocument.querySelector('#basic');actions.click(link);}},{content:'Fill in Subject',trigger:'#subject',run:'text Test',},{content:'Fill in Mailing list',trigger:'#contact_list_ids',run:'text Test Newsletter',},{content:'Pick "Newsletter" option',trigger:'.o_input_dropdown a:contains(Test Newsletter)',},{content:'Save form',trigger:'.o_form_button_save',},{content:'Check that newly created record is on the list',trigger:'[name="mailing_mail_ids"] td[name="subject"]:contains("Test")',run:()=>null,},...tour.stepUtils.saveForm(),]);});; 9827 9828/* /mass_mailing/static/src/js/tours/mass_mailing_snippets_menu_tabs.js */ 9829odoo.define('@mass_mailing/js/tours/mass_mailing_snippets_menu_tabs',async function(require){'use strict';let __exports={};const tour=require('web_tour.tour');tour.register('mass_mailing_snippets_menu_tabs',{test:true,url:'/web',},[tour.stepUtils.showAppsMenuItem(),{content:"Select the 'Email Marketing' app.",trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{content:"Click on the create button to create a new mailing.",trigger:'button.o_list_button_add',},{content:"Click on the 'Start From Scratch' template.",trigger:'iframe #empty',},{content:"Click on the 'Design' tab.",trigger:'iframe .o_we_customize_design_btn',},{content:"Click on the empty 'DRAG BUILDING BLOCKS HERE' area.",trigger:'iframe .oe_structure.o_mail_no_options',},{content:"Click on the 'Design' tab.",trigger:'iframe .o_we_customize_design_btn',},{content:"Verify that the customize panel is not empty.",trigger:'iframe .o_we_customize_panel .snippet-option-DesignTab',run:()=>null,},{content:"Click on the style tab.",trigger:'iframe .o_we_customize_snippet_btn',},{content:"Click on the 'Design' tab.",trigger:'iframe .o_we_customize_design_btn',},{content:"Verify that the customize panel is not empty.",trigger:'iframe .o_we_customize_panel .snippet-option-DesignTab',run:()=>null,},...tour.stepUtils.discardForm(),]);tour.register('mass_mailing_snippets_menu_toolbar_new_mailing_mobile',{test:true,url:'/web',},[tour.stepUtils.showAppsMenuItem(),{content:"Select the 'Email Marketing' app.",trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{content:"Click on the create button to create a new mailing.",trigger:'button.o_list_button_add',mobile:true,},{content:"Check templates available in theme selector",trigger:'iframe .o_mail_theme_selector_new',run:function(){if(this.$anchor[0].querySelector('#empty')){console.error('The empty template should not be visible on mobile.');}},mobile:true,},{content:"Make sure the toolbar isn't floating",trigger:'iframe',run:function(){const iframeDocument=this.$anchor[0].contentDocument;if(iframeDocument.querySelector('#toolbar.oe-floating')){console.error('There should not be a floating toolbar in the iframe');}},mobile:true,},{content:"Click on the 'Start From Scratch' template.",trigger:'iframe #default',mobile:true,},{content:"Select an editable element",trigger:'iframe .s_text_block',mobile:true,},{content:"Make sure the snippets menu is hidden",trigger:'iframe',run:function(){const iframeDocument=this.$anchor[0].contentDocument;if(!iframeDocument.querySelector('#oe_snippets.d-none')){console.error('The snippet menu should be hidden');}},mobile:true,},{content:"Make sure the toolbar is there, with the tables formating tool",trigger:'iframe #toolbar.oe-floating #table:not(.d-none)',run:()=>null,mobile:true,},]);tour.register('mass_mailing_snippets_menu_toolbar',{test:true,url:'/web',},[tour.stepUtils.showAppsMenuItem(),{content:"Select the 'Email Marketing' app.",trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',},{content:"Click on the create button to create a new mailing.",trigger:'button.o_list_button_add',},{content:"Wait for the theme selector to load.",trigger:'iframe .o_mail_theme_selector_new',},{content:"Make sure there does not exist a floating toolbar",trigger:'iframe',run:function(){const iframeDocument=this.$anchor[0].contentDocument;if(iframeDocument.querySelector('#toolbar.oe-floating')){console.error('There should not be a floating toolbar in the iframe');}},},{content:"Make sure the empty template is an option on non-mobile devices.",trigger:'iframe #empty',run:()=>null,},{content:"Click on the default 'welcome' template.",trigger:'iframe #default',},{content:"Wait for template selection event to be over.",trigger:'iframe .o_editable.theme_selection_done',},{content:"Make sure the snippets menu is not hidden",trigger:'iframe #oe_snippets:not(.d-none)',run:()=>null,},{content:"Wait for .s_text_block to be populated",trigger:'iframe .s_text_block p',run:()=>null,},{content:"Click and select p block inside the editor",trigger:'iframe',run:function(){const iframeWindow=this.$anchor[0].contentWindow;const iframeDocument=iframeWindow.document;const p=iframeDocument.querySelector('.s_text_block p');p.click();const selection=iframeWindow.getSelection();const range=iframeDocument.createRange();range.selectNodeContents(p);selection.removeAllRanges();selection.addRange(range);},},{content:"Make sure the toolbar is there",trigger:'iframe #oe_snippets .o_we_customize_panel #toolbar',run:()=>null,},...tour.stepUtils.discardForm(),]);return __exports;});; 9830 9831/* /mass_mailing/static/src/js/tours/mass_mailing_tour.js */ 9832odoo.define('mass_mailing.mass_mailing_tour',function(require){"use strict";const{_t}=require('web.core');const{Markup}=require('web.utils');var tour=require('web_tour.tour');tour.register('mass_mailing_tour',{url:'/web',rainbowManMessage:_t('Congratulations, I love your first mailing. :)'),sequence:200,},[tour.stepUtils.showAppsMenuItem(),{trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',content:_t("Let's try the Email Marketing app."),width:225,position:'bottom',edition:'enterprise',},{trigger:'.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',content:_t("Let's try the Email Marketing app."),edition:'community',},{trigger:'.o_list_button_add',extra_trigger:'.o_mass_mailing_mailing_tree',content:Markup(_t("Start by creating your first <b>Mailing</b>.")),position:'bottom',},{trigger:'div[name="subject"]',content:Markup(_t('Pick the <b>email subject</b>.')),position:'bottom',run:'click',},{trigger:'div[name="contact_list_ids"] > .o_input_dropdown > input[type="text"]',run:'click',auto:true,},{trigger:'li.ui-menu-item',run:'click',auto:true,},{trigger:'div[name="body_arch"] iframe #newsletter',content:Markup(_t('Choose this <b>theme</b>.')),position:'left',edition:'enterprise',run:'click',},{trigger:'div[name="body_arch"] iframe #default',content:Markup(_t('Choose this <b>theme</b>.')),position:'right',edition:'community',run:'click',},{trigger:'div[name="body_arch"] iframe div.theme_selection_done div.s_text_block',content:_t('Click on this paragraph to edit it.'),position:'top',edition:'enterprise',run:'click',},{trigger:'div[name="body_arch"] iframe div.o_mail_block_title_text',content:_t('Click on this paragraph to edit it.'),position:'top',edition:'community',run:'click',},{trigger:'button[name="action_set_favorite"]',content:_t('Click on this button to add this mailing to your templates.'),position:'bottom',run:'click',},{trigger:'button[name="action_test"]',content:_t("Test this mailing by sending a copy to yourself."),position:'bottom',},{trigger:'button[name="send_mail_test"]',content:_t("Check the email address and click send."),position:'bottom',},{trigger:'button[name="action_launch"]',content:_t("Ready for take-off!"),position:'bottom',},{trigger:'.btn-primary:contains("Ok")',content:_t("Don't worry, the mailing contact we created is an internal user."),position:'bottom',run:"click",},{trigger:'.o_back_button',content:Markup(_t("By using the <b>Breadcrumb</b>, you can navigate back to the overview.")),position:'bottom',run:'click',}]);});; 9833 9834/* /event/static/src/js/tours/event_tour.js */ 9835odoo.define('event.event_steps',function(require){"use strict";var core=require('web.core');var EventAdditionalTourSteps=core.Class.extend({_get_website_event_steps:function(){return[false];},});return EventAdditionalTourSteps;});odoo.define('event.event_tour',function(require){"use strict";const{_t}=require('web.core');const{Markup}=require('web.utils');var tour=require('web_tour.tour');var EventAdditionalTourSteps=require('event.event_steps');tour.register('event_tour',{url:'/web',rainbowManMessage:_t("Great! Now all you have to do is wait for your attendees to show up!"),sequence:210,},[tour.stepUtils.showAppsMenuItem(),{trigger:'.o_app[data-menu-xmlid="event.event_main_menu"]',content:Markup(_t("Ready to <b>organize events</b> in a few minutes? Let's get started!")),position:'bottom',edition:'enterprise',},{trigger:'.o_app[data-menu-xmlid="event.event_main_menu"]',content:Markup(_t("Ready to <b>organize events</b> in a few minutes? Let's get started!")),edition:'community',},{trigger:'.o-kanban-button-new',extra_trigger:'.o_event_kanban_view',content:Markup(_t("Let's create your first <b>event</b>.")),position:'bottom',width:175,}
9835,{trigger:'.o_event_form_view input[id="name"]',content:Markup(_t("This is the <b>name</b> your guests will see when registering.")),run:'text Odoo Experience 2020',},{trigger:'.o_event_form_view div[name="date_end"]',content:_t("Open date range picker. Pick a Start date for your event"),run:function(){$('input[id="date_begin"]').val('09/30/2020 08:00:00').change();$('input[id="date_end"]').val('10/02/2020 23:00:00').change();$('.o_event_form_view input[id="date_end"]').click();},},{content:_t("Apply change."),trigger:'.daterangepicker .applyBtn',in_modal:false,},{trigger:'.o_event_form_view div[name="event_ticket_ids"] .o_field_x2many_list_row_add a',content:Markup(_t("Ticket types allow you to distinguish your attendees. Let's <b>create</b> a new one.")),},tour.stepUtils.autoExpandMoreButtons(),...new EventAdditionalTourSteps()._get_website_event_steps(),{trigger:'.o_event_form_view div[name="stage_id"]',content:_t("Now that your event is ready, click here to move it to another stage."),position:'bottom',},{trigger:'ol.breadcrumb li.breadcrumb-item:first',extra_trigger:'.o_event_form_view div[name="stage_id"]',content:Markup(_t("Use the <b>breadcrumbs</b> to go back to your kanban overview.")),position:'bottom',run:'click',}].filter(Boolean));});; 9836 9837/* /website_event/static/src/js/tours/event_tour.js */ 9838odoo.define('website_event.event_steps',function(require){"use strict";const{_t}=require('web.core');const{Markup}=require('web.utils');var EventAdditionalTourSteps=require('event.event_steps');EventAdditionalTourSteps.include({init:function(){this._super.apply(this,arguments);},_get_website_event_steps:function(){this._super.apply(this,arguments);return[{trigger:'.o_event_form_view button[title="Unpublished"]',content:Markup(_t("Use this <b>shortcut</b> to easily access your event web page.")),position:'bottom',},{trigger:'.o_edit_website_container a',content:Markup(_t("With the Edit button, you can <b>customize</b> the web page visitors will see when registering.")),position:'bottom',},{trigger:'#oe_snippets.o_loaded div[name="Image - Text"] .oe_snippet_thumbnail',content:Markup(_t("<b>Drag and Drop</b> this snippet below the event title.")),position:'bottom',run:'drag_and_drop iframe #o_wevent_event_main_col',},{trigger:'button[data-action="save"]',content:Markup(_t("Don't forget to click <b>save</b> when you're done.")),position:'bottom',},{trigger:'.o_menu_systray_item .o_switch_danger_success',extra_trigger:'iframe body:not(.editor_enable) .o_wevent_event',content:Markup(_t("Looking great! Let's now <b>publish</b> this page so that it becomes <b>visible</b> on your website!")),position:'bottom',},{trigger:'.o_website_edit_in_backend > a',extra_trigger:'iframe .o_wevent_event',content:_t("This shortcut will bring you right back to the event form."),position:'bottom'}];}});return EventAdditionalTourSteps;});; 9839 9840/* /website_event/static/src/js/display_timer_widget.js */ 9841odoo.define('website_event.display_timer_widget',function(require){'use strict';var publicWidget=require('web.public.widget');publicWidget.registry.displayTimerWidget=publicWidget.Widget.extend({selector:'.o_display_timer',start:function(){var self=this;return this._super.apply(this,arguments).then(function(){self.options=self.$target.data();self.preCountdownDisplay=self.options["preCountdownDisplay"];self.preCountdownTime=self.options["preCountdownTime"];self.preCountdownText=self.options["preCountdownText"];self.mainCountdownTime=self.options["mainCountdownTime"];self.mainCountdownText=self.options["mainCountdownText"];self.mainCountdownDisplay=self.options["mainCountdownDisplay"];self.displayClass=self.options["displayClass"];if(self.preCountdownDisplay){$(self.$el).parent().removeClass('d-none');} 9842self._checkTimer();self.interval=setInterval(function(){self._checkTimer();},1000);});},_checkTimer:function(){var now=new Date();var remainingPreSeconds=this.preCountdownTime-(now.getTime()/1000);if(remainingPreSeconds<=1){this.$('.o_countdown_text').text(this.mainCountdownText);if(this.mainCountdownDisplay){$(this.$el).parent().removeClass('d-none');} 9843var remainingMainSeconds=this.mainCountdownTime-(now.getTime()/1000);if(remainingMainSeconds<=1){clearInterval(this.interval);$(this.displayClass).removeClass('d-none');$(this.$el).parent().addClass('d-none');}else{this._updateCountdown(remainingMainSeconds);}}else{this._updateCountdown(remainingPreSeconds);}},_updateCountdown:function(remainingTime){var remainingSeconds=remainingTime;var days=Math.floor(remainingSeconds/86400);remainingSeconds=remainingSeconds%86400;var hours=Math.floor(remainingSeconds/3600);remainingSeconds=remainingSeconds%3600;var minutes=Math.floor(remainingSeconds/60);remainingSeconds=Math.floor(remainingSeconds%60);this.$("span.o_timer_days").text(days);this.$("span.o_timer_hours").text(this._zeroPad(hours,2));this.$("span.o_timer_minutes").text(this._zeroPad(minutes,2));this.$("span.o_timer_seconds").text(this._zeroPad(remainingSeconds,2));}
9843,_zeroPad:function(num,places){var zero=places-num.toString().length+1;return new Array(+(zero>0&&zero)).join("0")+num;},});return publicWidget.registry.countdownWidget;});; 9844 9845/* /website_event/static/src/js/register_toaster_widget.js */ 9846odoo.define('website_event.register_toaster_widget',function(require){'use strict';let core=require('web.core');const{Markup}=require('web.utils');let _t=core._t;let publicWidget=require('web.public.widget');publicWidget.registry.RegisterToasterWidget=publicWidget.Widget.extend({selector:'.o_wevent_register_toaster',start:function(){const message=this.$el.data('message');if(message&&message.length){this.displayNotification({title:_t("Register"),message:Markup(message),type:'info',});} 9847return this._super.apply(this,arguments);},});return publicWidget.registry.RegisterToasterWidget;});; 9848 9849/* /website_event/static/src/js/website_event.js */ 9850odoo.define('website_event.website_event',function(require){var ajax=require('web.ajax');var core=require('web.core');var Widget=require('web.Widget');var publicWidget=require('web.public.widget');var{ReCaptcha}=require('google_recaptcha.ReCaptchaV3');var _t=core._t;var EventRegistrationForm=Widget.extend({init:function(){this._super(...arguments);this._recaptcha=new ReCaptcha();},willStart:async function(){this._recaptcha.loadLibs();return this._super(...arguments);},start:function(){var self=this;var res=this._super.apply(this,arguments).then(function(){$('#registration_form .a-submit').off('click').click(function(ev){self.on_click(ev);}).prop('disabled',false);});return res;},on_click:function(ev){ev.preventDefault();ev.stopPropagation();var $form=$(ev.currentTarget).closest('form');var $button=$(ev.currentTarget).closest('[type="submit"]');var post={};$('#registration_form table').siblings('.alert').remove();$('#registration_form select').each(function(){post[$(this).attr('name')]=$(this).val();});var tickets_ordered=_.some(_.map(post,function(value,key){return parseInt(value);}));if(!tickets_ordered){$('<div class="alert alert-info"/>').text(_t('Please select at least one ticket.')).insertAfter('#registration_form table');return new Promise(function(){});}else{$button.attr('disabled',true);var action=$form.data('action')||$form.attr('action');var self=this;return ajax.jsonRpc(action,'call',post).then(function(modal){var $modal=$(modal);$modal.find('.modal-body > div').removeClass('container');$modal.appendTo(document.body);const modalBS=new Modal($modal[0],{backdrop:'static',keyboard:false});modalBS.show();$modal.appendTo('body').modal('show');$modal.on('click','.js_goto_event',function(){$modal.modal('hide');$button.prop('disabled',false);});$modal.on('click','.btn-close',function(){$button.prop('disabled',false);});$modal.on('submit','form',async function(ev){if(!self._recaptcha._publicKey){return;} 9851ev.preventDefault();const tokenObj=await self._recaptcha.getToken("website_event_registration");if(tokenObj.error){$button.prop('disabled',false);self.displayNotification({type:'danger',title:_t('Error'),message:tokenObj.error,sticky:true,});return;} 9852const tokenInput=document.createElement('input');tokenInput.setAttribute('name','recaptcha_token_response');tokenInput.setAttribute('type','hidden');tokenInput.setAttribute('value',tokenObj.token);ev.currentTarget.appendChild(tokenInput);ev.currentTarget.submit();})});}},});publicWidget.registry.EventRegistrationFormInstance=publicWidget.Widget.extend({selector:'#registration_form',start:function(){var def=this._super.apply(this,arguments);this.instance=new EventRegistrationForm(this);return Promise.all([def,this.instance.attachTo(this.$el)]);},destroy:function(){this.instance.setElement(null);this._super.apply(this,arguments);this.instance.setElement(this.$el);},});return EventRegistrationForm;});; 9853 9854/* /website_event/static/src/js/website_event_ticket_details.js */ 9855odoo.define('website_event.ticket_details',function(require){var publicWidget=require('web.public.widget');publicWidget.registry.ticketDetailsWidget=publicWidget.Widget.extend({selector:'.o_wevent_js_ticket_details',events:{'click .o_wevent_registration_btn':'_onTicketDetailsClick','change .form-select':'_onTicketQuantityChange'},start:function(){this.foldedByDefault=this.$el.data('foldedByDefault')===1;return this._super.apply(this,arguments);},_getTotalTicketCount:function(){var ticketCount=0;this.$('.form-select').each(function(){ticketCount+=parseInt($(this).val());});return ticketCount;},_onTicketDetailsClick:function(ev){ev.preventDefault();if(this.foldedByDefault){let $target=$(ev.currentTarget);$target.toggleClass('btn-primary');$target.children().toggleClass('d-none');$target.siblings('.o_wevent_registration_title, .o_wevent_price_range').toggleClass('d-none');}},_onTicketQuantityChange:function(){this.$('button.btn-primary').attr('disabled',this._getTotalTicketCount()===0);}});return publicWidget.registry.ticketDetailsWidget;});; 9856 9857/* /base_rest/static/src/js/swagger_ui.js */ 9858odoo.define("base_rest.swagger_ui",function(require){"use strict";var core=require("web.core");var SwaggerUI=core.Class.extend({init:function(selector){this.selector=selector;this.$el=$(this.selector);},_swagger_bundle_settings:function(){const defaults={dom_id:this.selector,deepLinking:true,presets:[SwaggerUIBundle.presets.apis,SwaggerUIStandalonePreset],plugins:[SwaggerUIBundle.plugins.DownloadUrl],layout:"StandaloneLayout",operationsSorter:function(a,b){var methodsOrder=["get","post","put","delete","patch","options","trace",];var result=methodsOrder.indexOf(a.get("method"))- 9859methodsOrder.indexOf(b.get("method"));if(result===0){result=a.get("path").localeCompare(b.get("path"));} 9860return result;}
9860,tagsSorter:"alpha",onComplete:function(){if(this.web_btn===undefined){this.web_btn=$("<a class='fa fa-th-large swg-odoo-web-btn' href='/web' accesskey='h'></a>");$(".topbar").prepend(this.web_btn);}},oauth2RedirectUrl:window.location.origin+"/base_rest/static/lib/swagger-ui-3.51.1/oauth2-redirect.html",};const config=this.$el.data("settings");return Object.assign({},defaults,config);},start:function(){this.ui=SwaggerUIBundle(this._swagger_bundle_settings());},});return SwaggerUI;});; 9861 9862/* /base_rest/static/src/js/swagger.js */ 9863odoo.define("base_rest.swagger",function(require){"use strict";var publicWidget=require("web.public.widget");var SwaggerUi=require("base_rest.swagger_ui");publicWidget.registry.Swagger=publicWidget.Widget.extend({selector:"#swagger-ui",start:function(){var def=this._super.apply(this,arguments);var swagger_ui=new SwaggerUi("#swagger-ui");swagger_ui.start();return def;},});});; 9864 9865/* /mail_group/static/src/js/mail_group.js */ 9866odoo.define('mail_group.mail_group',function(require){'use strict';const publicWidget=require('web.public.widget');const core=require('web.core');const _t=core._t;publicWidget.registry.MailGroup=publicWidget.Widget.extend({selector:'.o_mail_group',events:{'click .o_mg_subscribe_btn':'_onSubscribeBtnClick',},start:function(){this.mailgroupId=this.$target.data('id');this.isMember=this.$target.data('isMember')||false;const searchParams=(new URL(document.location.href)).searchParams;this.token=searchParams.get('token');this.forceUnsubscribe=searchParams.has('unsubscribe');return this._super.apply(this,arguments);},_onSubscribeBtnClick:async function(ev){ev.preventDefault();const $email=this.$target.find(".o_mg_subscribe_email");const email=$email.val();if(!email.match(/.+@.+/)){this.$target.addClass('o_has_error').find('.form-control, .form-select').addClass('is-invalid');return false;} 9867this.$target.removeClass('o_has_error').find('.form-control, .form-select').removeClass('is-invalid');const action=(this.isMember||this.forceUnsubscribe)?'unsubscribe':'subscribe';const response=await this._rpc({route:'/group/'+action,params:{'group_id':this.mailgroupId,'email':email,'token':this.token,},});this.$el.find('.o_mg_alert').remove();if(response==='added'){this.isMember=true;this.$target.find('.o_mg_subscribe_btn').text(_t('Unsubscribe')).removeClass('btn-primary').addClass('btn-outline-primary');}else if(response==='removed'){this.isMember=false;this.$target.find('.o_mg_subscribe_btn').text(_t('Subscribe')).removeClass('btn-outline-primary').addClass('btn-primary');}else if(response==='email_sent'){this.$target.html($('<div class="o_mg_alert alert alert-success" role="alert"/>').text(_t('An email with instructions has been sent.')));}else if(response==='is_already_member'){this.isMember=true;this.$target.find('.o_mg_subscribe_btn').text(_t('Unsubscribe')).removeClass('btn-primary').addClass('btn-outline-primary');this.$target.find('.o_mg_subscribe_form').before($('<div class="o_mg_alert alert alert-warning" role="alert"/>').text(_t('This email is already subscribed.')));}else if(response==='is_not_member'){if(!this.forceUnsubscribe){this.isMember=false;this.$target.find('.o_mg_subscribe_btn').text(_t('Subscribe'));} 9868this.$target.find('.o_mg_subscribe_form').before($('<div class="o_mg_alert alert alert-warning" role="alert"/>').text(_t('This email is not subscribed.')));}},});return publicWidget.registry.MailGroup;});; 9869 9870/* /mail_group/static/src/js/mail_group_message.js */ 9871odoo.define('mail_group.mail_group_message',function(require){'use strict';const publicWidget=require('web.public.widget');publicWidget.registry.MailGroupMessage=publicWidget.Widget.extend({selector:'.o_mg_message',events:{'click .o_mg_link_hide':'_onHideLinkClick','click .o_mg_link_show':'_onShowLinkClick','click button.o_mg_read_more':'_onReadMoreClick',},start:function(){const body=this.$el.find('.card-body').first();const quoted=body.find('*[data-o-mail-quote]');const readMore=$('<button class="btn btn-light btn-sm ms-1"/>').text('. . .');quoted.first().before(readMore);readMore.on('click',()=>{quoted.toggleClass('visible');});return this._super.apply(this,arguments);},_onHideLinkClick:function(ev){ev.preventDefault();ev.stopPropagation();const $link=$(ev.currentTarget);const $container=$link.closest('.o_mg_link_parent');$container.find('.o_mg_link_hide').first().addClass('d-none');$container.find('.o_mg_link_show').first().removeClass('d-none');$container.find('.o_mg_link_content').first().removeClass('d-none');},_onShowLinkClick:function(ev){ev.preventDefault();ev.stopPropagation();const $link=$(ev.currentTarget);const $container=$link.closest('.o_mg_link_parent');$container.find('.o_mg_link_hide').first().removeClass('d-none');$container.find('.o_mg_link_show').first().addClass('d-none');$container.find('.o_mg_link_content').first().addClass('d-none');},_onReadMoreClick:function(ev){const $link=$(ev.target);this._rpc({route:$link.data('href'),params:{last_displayed_id:$link.data('last-displayed-id'),},}).then(function(data){if(!data){return;} 9872const $threadContainer=$link.parents('.o_mg_replies').first().find('ul.list-unstyled').first();if($threadContainer){const $data=$(data);const $lastMsg=$threadContainer.children('li.media').last();const $newMessages=$data.find('ul.list-unstyled').first().children('li.media');$newMessages.insertAfter($lastMsg);$data.find('.o_mg_read_more').parent().appendTo($threadContainer);} 9873const $showMore=$link.parent();$showMore.remove();});},});});; 9874 9875/* /web_unsplash/static/src/js/unsplash_beacon.js */ 9876odoo.define('web_unsplash.beacon',function(require){'use strict';var publicWidget=require('web.public.widget');publicWidget.registry.UnsplashBeacon=publicWidget.Widget.extend({selector:'#wrapwrap',start:function(){var unsplashImages=_.map(this.$('img[src*="/unsplash/"]'),function(img){return img.src.split('/unsplash/')[1].split('/')[0];});if(unsplashImages.length){this._rpc({route:'/web_unsplash/get_app_id',}).then(function(appID){if(!appID){return;} 9877$.get('https://views.unsplash.com/v',{'photo_id':unsplashImages.join(','),'app_id':appID,});});} 9878return this._super.apply(this,arguments);},});});; 9879 9880/* /website_links/static/src/js/website_links.js */ 9881odoo.define('website_links.website_links',function(require){'use strict';var core=require('web.core');var publicWidget=require('web.public.widget');var _t=core._t;var SelectBox=publicWidget.Widget.extend({events:{'change':'_onChange',},init:function(parent,obj,placeholder){this._super.apply(this,arguments);this.obj=obj;this.placeholder=placeholder;},willStart:function(){var self=this;var defs=[this._super.apply(this,arguments)];defs.push(this._rpc({model:this.obj,method:'search_read',kwargs:{fields:['id','name'],},}).then(function(result){self.objects=_.map(result,function(val){return{id:val.id,text:val.name};});}));return Promise.all(defs);},start:function(){var self=this;this.$el.select2({placeholder:self.placeholder,allowClear:true,formatNoMatches:false,createSearchChoice:function(term){if(self._objectExists(term)){return null;} 9882return{id:term,text:_.str.sprintf("Create '%s'",term)};},createSearchChoicePosition:'bottom',multiple:false,data:self.objects,minimumInputLength:self.objects.length>100?3:0,});},_objectExists:function(query){return _.find(this.objects,function(val){return val.text.toLowerCase()===query.toLowerCase();})!==undefined;},_createObject:function(name){var self=this;var args={name:name};if(this.obj==="utm.campaign"){args.is_auto_campaign=true;} 9883return this._rpc({model:this.obj,method:'create',args:[args],}).then(function(record){self.$el.attr('value',record);self.objects.push({'id':record,'text':name});});},_onChange:function(ev){if(!ev.added||!_.isString(ev.added.id)){return;} 9884this._createObject(ev.added.id);},});var RecentLinkBox=publicWidget.Widget.extend({template:'website_links.RecentLink',events:{'click .btn_shorten_url_clipboard':'_toggleCopyButton','click .o_website_links_edit_code':'_editCode','click .o_website_links_ok_edit':'_onLinksOkClick','click .o_website_links_cancel_edit':'_onLinksCancelClick','submit #o_website_links_edit_code_form':'_onSubmitCode',},init:function(parent,obj){this._super.apply(this,arguments);this.link_obj=obj;this.animating_copy=false;},start:function(){new ClipboardJS(this.$('.btn_shorten_url_clipboard').get(0));return this._super.apply(this,arguments);},_toggleCopyButton:function(){if(this.animating_copy){return;} 9885var self=this;this.animating_copy=true;var top=this.$('.o_website_links_short_url').position().top;this.$('.o_website_links_short_url').clone().css('position','absolute').css('left',15).css('top',top-2).css('z-index',2).removeClass('o_website_links_short_url').addClass('animated-link').insertAfter(this.$('.o_website_links_short_url')).animate({opacity:0,top:'-=20',},500,function(){self.$('.animated-link').remove();self.animating_copy=false;});},_notification:function(message){this.$('.notification').append('<strong>'+message+'</strong>');},_editCode:function(){var initCode=this.$('#o_website_links_code').html();this.$('#o_website_links_code').html('<form style="display:inline;" id="o_website_links_edit_code_form"><input type="hidden" id="init_code" value="'+initCode+'"/><input type="text" id="new_code" value="'+initCode+'"/></form>');this.$('.o_website_links_edit_code').hide();
9885this.$('.copy-to-clipboard').hide();this.$('.o_website_links_edit_tools').show();},_cancelEdit:function(){this.$('.o_website_links_edit_code').show();this.$('.copy-to-clipboard').show();this.$('.o_website_links_edit_tools').hide();this.$('.o_website_links_code_error').hide();var oldCode=this.$('#o_website_links_edit_code_form #init_code').val();this.$('#o_website_links_code').html(oldCode);this.$('#code-error').remove();this.$('#o_website_links_code form').remove();},_submitCode:function(){var self=this;var initCode=this.$('#o_website_links_edit_code_form #init_code').val();var newCode=this.$('#o_website_links_edit_code_form #new_code').val();if(newCode===''){self.$('.o_website_links_code_error').html(_t("The code cannot be left empty"));self.$('.o_website_links_code_error').show();return;} 9886function showNewCode(newCode){self.$('.o_website_links_code_error').html('');self.$('.o_website_links_code_error').hide();self.$('#o_website_links_code form').remove();var host=self.$('#o_website_links_host').html();self.$('#o_website_links_code').html(newCode);self.$('.btn_shorten_url_clipboard').attr('data-clipboard-text',host+newCode);self.$('.o_website_links_edit_code').show();self.$('.copy-to-clipboard').show();self.$('.o_website_links_edit_tools').hide();}
9887if(initCode===newCode){showNewCode(newCode);}else{this._rpc({route:'/website_links/add_code',params:{init_code:initCode,new_code:newCode,},}).then(function(result){showNewCode(result[0].code);},function(){self.$('.o_website_links_code_error').show();self.$('.o_website_links_code_error').html(_t("This code is already taken"));});}},_onLinksOkClick:function(ev){ev.preventDefault();this._submitCode();},_onLinksCancelClick:function(ev){ev.preventDefault();this._cancelEdit();},_onSubmitCode:function(ev){ev.preventDefault();this._submitCode();},});var RecentLinks=publicWidget.Widget.extend({getRecentLinks:function(filter){var self=this;return this._rpc({route:'/website_links/recent_links',params:{filter:filter,limit:20,},}).then(function(result){_.each(result.reverse(),function(link){self._addLink(link);});self._updateNotification();},function(){var message=_t("Unable to get recent links");self.$el.append('<div class="alert alert-danger">'+message+'</div>');});},_addLink:function(link){var nbLinks=this.getChildren().length;var recentLinkBox=new RecentLinkBox(this,link);recentLinkBox.prependTo(this.$el);$('.link-tooltip').tooltip();if(nbLinks===0){this._updateNotification();}},removeLinks:function(){_.invoke(this.getChildren(),'destroy');},_updateNotification:function(){if(this.getChildren().length===0){var message=_t("You don't have any recent links.");$('.o_website_links_recent_links_notification').html('<div class="alert alert-info">'+message+'</div>');}else{$('.o_website_links_recent_links_notification').empty();}},});publicWidget.registry.websiteLinks=publicWidget.Widget.extend({selector:'.o_website_links_create_tracked_url',events:{'click #filter-newest-links':'_onFilterNewestLinksClick','click #filter-most-clicked-links':'_onFilterMostClickedLinksClick','click #filter-recently-used-links':'_onFilterRecentlyUsedLinksClick','click #generated_tracked_link a':'_onGeneratedTrackedLinkClick','keyup #url':'_onUrlKeyUp','click #btn_shorten_url':'_onShortenUrlButtonClick','submit #o_website_links_link_tracker_form':'_onFormSubmit',},start:function(){var defs=[this._super.apply(this,arguments)];var campaignSelect=new SelectBox(this,'utm.campaign',_t("e.g. Promotion of June, Winter Newsletter, .."));defs.push(campaignSelect.attachTo($('#campaign-select')));var mediumSelect=new SelectBox(this,'utm.medium',_t("e.g. Newsletter, Social Network, .."));defs.push(mediumSelect.attachTo($('#channel-select')));var sourceSelect=new SelectBox(this,'utm.source',_t("e.g. Search Engine, Website page, .."));defs.push(sourceSelect.attachTo($('#source-select')));this.recentLinks=new RecentLinks(this);defs.push(this.recentLinks.appendTo($('#o_website_links_recent_links')));this.recentLinks.getRecentLinks('newest');new ClipboardJS($('#btn_shorten_url').get(0));this.url_copy_animating=false;$('[data-bs-toggle="tooltip"]').tooltip();return Promise.all(defs);},_onFilterNewestLinksClick:function(){this.recentLinks.removeLinks();this.recentLinks.getRecentLinks('newest');},_onFilterMostClickedLinksClick:function(){this.recentLinks.removeLinks();this.recentLinks.getRecentLinks('most-clicked');},_onFilterRecentlyUsedLinksClick:function(){this.recentLinks.removeLinks();this.recentLinks.getRecentLinks('recently-used');},_onGeneratedTrackedLinkClick:function(){$('#generated_tracked_link a').text(_t("Copied")).removeClass('btn-primary').addClass('btn-success');setTimeout(function(){$('#generated_tracked_link a').text(_t("Copy")).removeClass('btn-success').addClass('btn-primary');},5000);},_onUrlKeyUp:function(ev){if(!$('#btn_shorten_url').hasClass('btn-copy')||ev.which===13){return;} 9888$('#btn_shorten_url').removeClass('btn-success btn-copy').addClass('btn-primary').html('Get tracked link');$('#generated_tracked_link').css('display','none');$('.o_website_links_utm_forms').show();},_onShortenUrlButtonClick:function(){if(!$('#btn_shorten_url').hasClass('btn-copy')||this.url_copy_animating){return;} 9889var self=this;this.url_copy_animating=true;$('#generated_tracked_link').clone().css('position','absolute').css('left','78px').css('bottom','8px').css('z-index',2).removeClass('#generated_tracked_link').addClass('url-animated-link').appendTo($('#generated_tracked_link')).animate({opacity:0,bottom:'+=20',},500,function(){$('.url-animated-link').remove();self.url_copy_animating=false;});},_onFormSubmit:function(ev){var self=this;ev.preventDefault();if($('#btn_shorten_url').hasClass('btn-copy')){return;} 9890ev.stopPropagation();var campaignID=$('#campaign-select').attr('value');var mediumID=$('#channel-select').attr('value');var sourceID=$('#source-select').attr('value');var params={};params.url=$('#url').val();if(campaignID!==''){params.campaign_id=parseInt(campaignID);} 9891if(mediumID!==''){params.medium_id=parseInt(mediumID);}
9892if(sourceID!==''){params.source_id=parseInt(sourceID);} 9893$('#btn_shorten_url').text(_t("Generating link..."));this._rpc({route:'/website_links/new',params:params,}).then(function(result){if('error'in result){if(result.error==='empty_url'){$('.notification').html('<div class="alert alert-danger">The URL is empty.</div>');}else if(result.error==='url_not_found'){$('.notification').html('<div class="alert alert-danger">URL not found (404)</div>');}else{$('.notification').html('<div class="alert alert-danger">An error occur while trying to generate your link. Try again later.</div>');}}else{var link=result[0];$('#btn_shorten_url').removeClass('btn-primary').addClass('btn-success btn-copy').html('Copy');$('#btn_shorten_url').attr('data-clipboard-text',link.short_url);$('.notification').html('');$('#generated_tracked_link').html(link.short_url);$('#generated_tracked_link').css('display','inline');self.recentLinks._addLink(link);$('#campaign-select').select2('val','');$('#channel-select').select2('val','');$('#source-select').select2('val','');$('.o_website_links_utm_forms').hide();}});},});return{SelectBox:SelectBox,RecentLinkBox:RecentLinkBox,RecentLinks:RecentLinks,};});; 9894 9895/* /website_links/static/src/js/website_links_code_editor.js */ 9896odoo.define('website_links.code_editor',function(require){'use strict';var core=require('web.core');var publicWidget=require('web.public.widget');var _t=core._t;publicWidget.registry.websiteLinksCodeEditor=publicWidget.Widget.extend({selector:'#wrapwrap:has(.o_website_links_edit_code)',events:{'click .o_website_links_edit_code':'_onEditCodeClick','click .o_website_links_cancel_edit':'_onCancelEditClick','submit #edit-code-form':'_onEditCodeFormSubmit','click .o_website_links_ok_edit':'_onEditCodeFormSubmit',},_showNewCode:function(newCode){$('.o_website_links_code_error').html('');$('.o_website_links_code_error').hide();$('#o_website_links_code form').remove();var host=$('#short-url-host').html();$('#o_website_links_code').html(newCode);$('.copy-to-clipboard').attr('data-clipboard-text',host+newCode);$('.o_website_links_edit_code').show();$('.copy-to-clipboard').show();$('.o_website_links_edit_tools').hide();},_submitCode:function(){var initCode=$('#edit-code-form #init_code').val();var newCode=$('#edit-code-form #new_code').val();var self=this;if(newCode===''){self.$('.o_website_links_code_error').html(_t("The code cannot be left empty"));self.$('.o_website_links_code_error').show();return;}
9897this._showNewCode(newCode);if(initCode===newCode){this._showNewCode(newCode);}else{return this._rpc({route:'/website_links/add_code',params:{init_code:initCode,new_code:newCode,},}).then(function(result){self._showNewCode(result[0].code);},function(){$('.o_website_links_code_error').show();$('.o_website_links_code_error').html(_t("This code is already taken"));});} 9898return Promise.resolve();},_onEditCodeClick:function(){var initCode=$('#o_website_links_code').html();$('#o_website_links_code').html('<form style="display:inline;" id="edit-code-form"><input type="hidden" id="init_code" value="'+initCode+'"/><input type="text" id="new_code" value="'+initCode+'"/></form>');$('.o_website_links_edit_code').hide();$('.copy-to-clipboard').hide();$('.o_website_links_edit_tools').show();},_onCancelEditClick:function(ev){ev.preventDefault();$('.o_website_links_edit_code').show();$('.copy-to-clipboard').show();$('.o_website_links_edit_tools').hide();$('.o_website_links_code_error').hide();var oldCode=$('#edit-code-form #init_code').val();$('#o_website_links_code').html(oldCode);$('#code-error').remove();$('#o_website_links_code form').remove();},_onEditCodeFormSubmit:function(ev){ev.preventDefault();this._submitCode();},});});; 9899 9900/* /website_links/static/src/js/website_links_charts.js */ 9901odoo.define('website_links.charts',function(require){'use strict';var core=require('web.core');var publicWidget=require('web.public.widget');var _t=core._t;var BarChart=publicWidget.Widget.extend({jsLibs:['/web/static/lib/Chart/Chart.js',],init:function(parent,beginDate,endDate,dates){this._super.apply(this,arguments);this.beginDate=beginDate.locale("en");this.endDate=endDate;this.number_of_days=this.endDate.diff(this.beginDate,'days')+2;this.dates=dates;},start:function(){var clicksArray=[];var beginDateCopy=this.beginDate;for(var i=0;i<this.number_of_days;i++){var dateKey=beginDateCopy.format('YYYY-MM-DD');clicksArray.push([dateKey,(dateKey in this.dates)?this.dates[dateKey]:0]);beginDateCopy.add(1,'days');} 9902var nbClicks=0;var data=[];var labels=[];clicksArray.forEach(function(pt){labels.push(pt[0]);nbClicks+=pt[1];data.push(pt[1]);});this.$('.title').html(nbClicks+_t(' clicks'));var config={type:'line',data:{labels:labels,datasets:[{data:data,fill:'start',label:_t('# of clicks'),backgroundColor:'#ebf2f7',borderColor:'#6aa1ca',}],},};var canvas=this.$('canvas')[0];var context=canvas.getContext('2d');new Chart(context,config);},});var PieChart=publicWidget.Widget.extend({jsLibs:['/web/static/lib/Chart/Chart.js',],init:function(parent,data){this._super.apply(this,arguments);this.data=data;},start:function(){var labels=[];var data=[];for(var i=0;i<this.data.length;i++){var countryName=this.data[i]['country_id']?this.data[i]['country_id'][1]:_t('Undefined');labels.push(countryName+' ('+this.data[i]['country_id_count']+')');data.push(this.data[i]['country_id_count']);} 9903this.$('.title').html(this.data.length+_t(' countries'));var config={type:'pie',data:{labels:labels,datasets:[{data:data,label:this.data.length>0?this.data[0].key:_t('No data'),}]},};var canvas=this.$('canvas')[0];var context=canvas.getContext('2d');new Chart(context,config);},});publicWidget.registry.websiteLinksCharts=publicWidget.Widget.extend({selector:'.o_website_links_chart',events:{'click .copy-to-clipboard':'_onCopyToClipboardClick',},start:function(){var self=this;this.charts={};var linkID=parseInt($('#link_id').val());this.links_domain=['link_id','=',linkID];var defs=[];defs.push(this._totalClicks());defs.push(this._clicksByDay());defs.push(this._clicksByCountry());defs.push(this._lastWeekClicksByCountry());defs.push(this._lastMonthClicksByCountry());defs.push(this._super.apply(this,arguments));new ClipboardJS($('.copy-to-clipboard')[0]);this.animating_copy=false;return Promise.all(defs).then(function(results){var _totalClicks=results[0];var _clicksByDay=results[1];var _clicksByCountry=results[2];var _lastWeekClicksByCountry=results[3];var _lastMonthClicksByCountry=results[4];if(!_totalClicks){$('#all_time_charts').prepend(_t("There is no data to show"));$('#last_month_charts').prepend(_t("There is no data to show"));$('#last_week_charts').prepend(_t("There is no data to show"));return;} 9904var formattedClicksByDay={};var beginDate;for(var i=0;i<_clicksByDay.length;i++){const date=moment(_clicksByDay[i]["__domain"].find((el)=>el.length&&el.includes(">="))[2].split(" ")[0],"YYYY MM DD");if(i===0){beginDate=date;} 9905formattedClicksByDay[date.locale("en").format("YYYY-MM-DD")]=_clicksByDay[i]["create_date_count"];} 9906var now=moment();
9906self.charts.all_time_bar=new BarChart(self,beginDate,now,formattedClicksByDay);self.charts.all_time_bar.attachTo($('#all_time_clicks_chart'));beginDate=moment().subtract(30,'days');self.charts.last_month_bar=new BarChart(self,beginDate,now,formattedClicksByDay);self.charts.last_month_bar.attachTo($('#last_month_clicks_chart'));beginDate=moment().subtract(7,'days');self.charts.last_week_bar=new BarChart(self,beginDate,now,formattedClicksByDay);self.charts.last_week_bar.attachTo($('#last_week_clicks_chart'));self.charts.all_time_pie=new PieChart(self,_clicksByCountry);self.charts.all_time_pie.attachTo($('#all_time_countries_charts'));self.charts.last_month_pie=new PieChart(self,_lastMonthClicksByCountry);self.charts.last_month_pie.attachTo($('#last_month_countries_charts'));self.charts.last_week_pie=new PieChart(self,_lastWeekClicksByCountry);self.charts.last_week_pie.attachTo($('#last_week_countries_charts'));var rowWidth=$('#all_time_countries_charts').parent().width();var $chartCanvas=$('#all_time_countries_charts,last_month_countries_charts,last_week_countries_charts').find('canvas');$chartCanvas.height(Math.max(_clicksByCountry.length*(rowWidth>750?1:2),20)+'em');});},_totalClicks:function(){return this._rpc({model:'link.tracker.click',method:'search_count',args:[[this.links_domain]],});},_clicksByDay:function(){return this._rpc({model:'link.tracker.click',method:'read_group',args:[[this.links_domain],['create_date']],kwargs:{groupby:'create_date:day'},});},_clicksByCountry:function(){return this._rpc({model:'link.tracker.click',method:'read_group',args:[[this.links_domain],['country_id']],kwargs:{groupby:'country_id'},});},_lastWeekClicksByCountry:function(){const aWeekAgoDate=new Date(Date.now()-7*24*60*60*1000);const aWeekAgoString=aWeekAgoDate.toISOString().split("T")[0];return this._rpc({model:'link.tracker.click',method:'read_group',args:[[this.links_domain,["create_date",">",aWeekAgoString]],["country_id"]],kwargs:{groupby:'country_id'},});},_lastMonthClicksByCountry:function(){const aMonthAgoDate=new Date(Date.now()-30*24*60*60*1000);const aMonthAgoString=aMonthAgoDate.toISOString().split("T")[0];return this._rpc({model:'link.tracker.click',method:'read_group',args:[[this.links_domain,["create_date",">",aMonthAgoString]],["country_id"]],kwargs:{groupby:'country_id'},});},_onCopyToClipboardClick:function(ev){ev.preventDefault();if(this.animating_copy){return;} 9907this.animating_copy=true;$('.o_website_links_short_url').clone().css('position','absolute').css('left','15px').css('bottom','10px').css('z-index',2).removeClass('.o_website_links_short_url').addClass('animated-link').appendTo($('.o_website_links_short_url')).animate({opacity:0,bottom:'+=20',},500,function(){$('.animated-link').remove();this.animating_copy=false;});},});return{BarChart:BarChart,PieChart:PieChart,};});; 9908 9909/* /website_mass_mailing/static/src/js/website_mass_mailing.js */ 9910odoo.define('mass_mailing.website_integration',function(require){"use strict";var core=require('web.core');var publicWidget=require('web.public.widget');const{ReCaptcha}=require('google_recaptcha.ReCaptchaV3');var _t=core._t;publicWidget.registry.subscribe=publicWidget.Widget.extend({selector:".js_subscribe",disabledInEditableMode:false,read_events:{'click .js_subscribe_btn':'_onSubscribeClick',},init:function(){this._super(...arguments);this._recaptcha=new ReCaptcha();},willStart:function(){this._recaptcha.loadLibs();return this._super(...arguments);},start:function(){var def=this._super.apply(this,arguments);if(this.editableMode){return def;} 9911const always=this._updateView.bind(this);const inputName=this.$target[0].querySelector('input').name;return Promise.all([def,this._rpc({route:'/website_mass_mailing/is_subscriber',params:{'list_id':this._getListId(),'subscription_type':inputName,},}).then(always).guardedCatch(always)]);},destroy(){this._updateView({is_subscriber:false});this._super.apply(this,arguments);},_updateView(data){const isSubscriber=data.is_subscriber;const subscribeBtnEl=this.$target[0].querySelector('.js_subscribe_btn');const thanksBtnEl=this.$target[0].querySelector('.js_subscribed_btn');const valueInputEl=this.$target[0].querySelector('input.js_subscribe_value, input.js_subscribe_email');subscribeBtnEl.disabled=isSubscriber;valueInputEl.value=data.value||'';valueInputEl.disabled=isSubscriber;this.$target[0].classList.remove('d-none');subscribeBtnEl.classList.toggle('d-none',!!isSubscriber);thanksBtnEl.classList.toggle('d-none',!isSubscriber);},_getListId:function(){return this.$target.closest('[data-snippet=s_newsletter_block').data('list-id')||this.$target.data('list-id');},_onSubscribeClick:async function(){var self=this;const inputName=this.$('input').attr('name');const $input=this.$(".js_subscribe_value:visible, .js_subscribe_email:visible");if(inputName==='email'&&$input.length&&!$input.val().match(/.+@.+/)){this.$target.addClass('o_has_error').find('.form-control').addClass('is-invalid');return false;} 9912this.$target.removeClass('o_has_error').find('.form-control').removeClass('is-invalid');const tokenObj=await this._recaptcha.getToken('website_mass_mailing_subscribe');
9912if(tokenObj.error){self.displayNotification({type:'danger',title:_t("Error"),message:tokenObj.error,sticky:true,});return false;} 9913this._rpc({route:'/website_mass_mailing/subscribe',params:{'list_id':this._getListId(),'value':$input.length?$input.val():false,'subscription_type':inputName,recaptcha_token_response:tokenObj.token,},}).then(function(result){let toastType=result.toast_type;if(toastType==='success'){self.$(".js_subscribe_btn").addClass('d-none');self.$(".js_subscribed_btn").removeClass('d-none');self.$('input.js_subscribe_value, input.js_subscribe_email').prop('disabled',!!result);const $popup=self.$target.closest('.o_newsletter_modal');if($popup.length){$popup.modal('hide');}} 9914self.displayNotification({type:toastType,title:toastType==='success'?_t('Success'):_t('Error'),message:result.toast_content,sticky:true,});});},});publicWidget.registry.fixNewsletterListClass=publicWidget.Widget.extend({selector:'.s_newsletter_subscribe_form:not(.s_subscription_list), .s_newsletter_block',start(){this.$target[0].classList.add('s_newsletter_list');return this._super(...arguments);},});});; 9915 9916/* /website_blog/static/src/js/contentshare.js */ 9917odoo.define('website_blog.contentshare',function(require){'use strict';const dom=require('web.dom');$.fn.share=function(options){var option=$.extend($.fn.share.defaults,options);var selected_text="";$.extend($.fn.share,{init:function(shareable){var self=this;$.fn.share.defaults.shareable=shareable;$.fn.share.defaults.shareable.on('mouseup',function(){if($(this).parents('body.editor_enable').length===0){self.popOver();}});$.fn.share.defaults.shareable.on('mousedown',function(){self.destroy();});},getContent:function(){var $popover_content=$('<div class="h4 m-0"/>');if($('.o_wblog_title, .o_wblog_post_content_field').hasClass('js_comment')){selected_text=this.getSelection('string');var $btn_c=$('<a class="o_share_comment btn btn-link px-2" href="#"/>').append($('<i class="fa fa-lg fa-comment"/>'));$popover_content.append($btn_c);} 9918if($('.o_wblog_title, .o_wblog_post_content_field').hasClass('js_tweet')){var tweet='"%s" - %s';var baseLength=tweet.replace(/%s/g,'').length;var selectedText=this.getSelection('string').substring(0,option.maxLength-baseLength-23);var text=window.btoa(encodeURIComponent(_.str.sprintf(tweet,selectedText,window.location.href)));
9918$popover_content.append(_.str.sprintf("<a onclick=\"window.open('%s' + atob('%s'), '_%s','location=yes,height=570,width=520,scrollbars=yes,status=yes')\"><i class=\"ml4 mr4 fa fa-twitter fa-lg\"/></a>",option.shareLink,text,option.target));} 9919return $popover_content;},commentEdition:function(){$(".o_portal_chatter_composer_form textarea").val('"'+selected_text+'" ').focus();const commentsEl=$('#o_wblog_post_comments')[0];if(commentsEl){dom.scrollTo(commentsEl).then(()=>{window.location.hash='blog_post_comment_quote';});}},getSelection:function(share){if(window.getSelection){var selection=window.getSelection();if(!selection||selection.rangeCount===0){return"";} 9920if(share==='string'){return String(selection.getRangeAt(0)).replace(/\s{2,}/g,' ');}else{return selection.getRangeAt(0);}}else if(document.selection){if(share==='string'){return document.selection.createRange().text.replace(/\s{2,}/g,' ');}else{return document.selection.createRange();}}},popOver:function(){this.destroy();if(this.getSelection('string').length<option.minLength){return;} 9921var data=this.getContent();var range=this.getSelection();var newNode=document.createElement("span");range.insertNode(newNode);newNode.className=option.className;var $pop=$(newNode);$pop.popover({trigger:'manual',placement:option.placement,html:true,content:function(){return data;}}).popover('show');$('.o_share_comment').on('click',this.commentEdition);},destroy:function(){var $span=$('span.'+option.className);$span.popover('hide');$span.remove();}});$.fn.share.init(this);};$.fn.share.defaults={shareLink:"http://twitter.com/intent/tweet?text=",minLength:5,maxLength:140,target:"blank",className:"share",placement:"top",};});; 9922 9923/* /website_blog/static/src/js/website_blog.js */ 9924odoo.define('website_blog.website_blog',function(require){'use strict';var core=require('web.core');const dom=require('web.dom');const publicWidget=require('web.public.widget');publicWidget.registry.websiteBlog=publicWidget.Widget.extend({selector:'.website_blog',events:{'click #o_wblog_next_container':'_onNextBlogClick','click #o_wblog_post_content_jump':'_onContentAnchorClick','click .o_twitter, .o_facebook, .o_linkedin, .o_google, .o_twitter_complete, .o_facebook_complete, .o_linkedin_complete, .o_google_complete':'_onShareArticle',},start:function(){$('.js_tweet, .js_comment').share({});return this._super.apply(this,arguments);},_onNextBlogClick:function(ev){ev.preventDefault();var self=this;var $el=$(ev.currentTarget);var nexInfo=$el.find('#o_wblog_next_post_info').data();$el.find('.o_record_cover_container').addClass(nexInfo.size+' '+nexInfo.text).end().find('.o_wblog_toggle').toggleClass('d-none');const placeholder=document.createElement('div');placeholder.style.minHeight='100vh';this.$('#o_wblog_next_container').append(placeholder);_.defer(function(){self._forumScrollAction($el,300,function(){window.location.href=nexInfo.url;});});},_onContentAnchorClick:function(ev){ev.preventDefault();ev.stopImmediatePropagation();var $el=$(ev.currentTarget.hash);this._forumScrollAction($el,500,function(){window.location.hash='blog_content';});},_onShareArticle:function(ev){ev.preventDefault();var url='';var $element=$(ev.currentTarget);var blogPostTitle=$('#o_wblog_post_name').html()||'';var articleURL=window.location.href;if($element.hasClass('o_twitter')){var twitterText=core._t("Amazing blog article: %s! Check it live: %s");var tweetText=_.string.sprintf(twitterText,blogPostTitle,articleURL);url='https://twitter.com/intent/tweet?tw_p=tweetbutton&text='+encodeURIComponent(tweetText);}else if($element.hasClass('o_facebook')){url='https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(articleURL);}else if($element.hasClass('o_linkedin')){url='https://www.linkedin.com/sharing/share-offsite/?url='+encodeURIComponent(articleURL);} 9925window.open(url,'','menubar=no, width=500, height=400');},_forumScrollAction:function($el,duration,callback){dom.scrollTo($el[0],{duration:duration}).then(()=>callback());},});});; 9926 9927/* /payment_custom/static/src/js/post_processing.js */ 9928odoo.define('payment_custom.post_processing',require=>{'use strict';const paymentPostProcessing=require('payment.post_processing');paymentPostProcessing.include({processPolledData:function(display_values_list){if(display_values_list.length>0&&display_values_list[0].provider_code==='custom'){window.location=display_values_list[0].landing_route;}else{return this._super(...arguments);}}});});; 9929 9930/* /payment_stripe/static/src/js/express_checkout_form.js */ 9931odoo.define('@payment_stripe/js/express_checkout_form',async function(require){'use strict';let __exports={};const{_t}=require("@web/core/l10n/translation");const{paymentExpressCheckoutForm}=require('@payment/js/express_checkout_form');const{StripeOptions}=require('@payment_stripe/js/stripe_options');paymentExpressCheckoutForm.include({_getOrderDetails(deliveryAmount,amountFreeShipping){const pending=this.txContext.shippingInfoRequired&&deliveryAmount===undefined;
9931const amount=deliveryAmount?this.txContext.minorAmount+deliveryAmount+amountFreeShipping:this.txContext.minorAmount;const displayItems=[{label:_t("Your order"),amount:this.txContext.minorAmount,},];if(this.txContext.shippingInfoRequired&&deliveryAmount!==undefined){displayItems.push({label:_t("Delivery"),amount:deliveryAmount,});} 9932if(amountFreeShipping){displayItems.push({label:_t("Free Shipping"),amount:amountFreeShipping,});} 9933return{total:{label:this.txContext.merchantName,amount:amount,pending:pending,},displayItems:displayItems,};},async _prepareExpressCheckoutForm(providerData){if(providerData.providerCode!=='stripe'||!this.txContext.amount){return this._super(...arguments);} 9934const stripeJS=Stripe(providerData.stripePublishableKey,new StripeOptions()._prepareStripeOptions(providerData),);const paymentRequest=stripeJS.paymentRequest({country:providerData.countryCode,currency:this.txContext.currencyName,requestPayerName:true,requestPayerEmail:true,requestPayerPhone:true,requestShipping:this.txContext.shippingInfoRequired,...this._getOrderDetails(),});if(this.stripePaymentRequests===undefined){this.stripePaymentRequests=[];} 9935this.stripePaymentRequests.push(paymentRequest);const paymentRequestButton=stripeJS.elements().create('paymentRequestButton',{paymentRequest:paymentRequest,style:{paymentRequestButton:{type:'buy'}},});const canMakePayment=await paymentRequest.canMakePayment();if(canMakePayment){paymentRequestButton.mount(`#o_stripe_express_checkout_container_${providerData.providerId}`);}else{document.querySelector(`#o_stripe_express_checkout_container_${providerData.providerId}`).style.display='none';} 9936paymentRequest.on('paymentmethod',async(ev)=>{const addresses={'billing_address':{name:ev.payerName,email:ev.payerEmail,phone:ev.payerPhone,street:ev.paymentMethod.billing_details.address.line1,street2:ev.paymentMethod.billing_details.address.line2,zip:ev.paymentMethod.billing_details.address.postal_code,city:ev.paymentMethod.billing_details.address.city,country:ev.paymentMethod.billing_details.address.country,state:ev.paymentMethod.billing_details.address.state,}};if(this.txContext.shippingInfoRequired){addresses.shipping_address={name:ev.shippingAddress.recipient,email:ev.payerEmail,phone:ev.shippingAddress.phone,street:ev.shippingAddress.addressLine[0],street2:ev.shippingAddress.addressLine[1],zip:ev.shippingAddress.postalCode,city:ev.shippingAddress.city,country:ev.shippingAddress.country,state:ev.shippingAddress.region,};addresses.shipping_option=ev.shippingOption;} 9937this.txContext.partnerId=parseInt(await this._rpc({route:this.txContext.expressCheckoutRoute,params:addresses,}));const{client_secret}=await this._rpc({route:this.txContext.transactionRoute,params:this._prepareTransactionRouteParams(providerData.providerId),});const{paymentIntent,error:confirmError}=await stripeJS.confirmCardPayment(client_secret,{payment_method:ev.paymentMethod.id},{handleActions:false});if(confirmError){ev.complete('fail');}else{ev.complete('success');if(paymentIntent.status==='requires_action'){await stripeJS.confirmCardPayment(client_secret);} 9938window.location='/payment/status';}});if(this.txContext.shippingInfoRequired){paymentRequest.on('shippingaddresschange',async(ev)=>{const availableCarriers=await this._rpc({route:this.txContext.shippingAddressUpdateRoute,params:{partial_shipping_address:{zip:ev.shippingAddress.postalCode,city:ev.shippingAddress.city,country:ev.shippingAddress.country,state:ev.shippingAddress.region,},},});if(availableCarriers.length===0){ev.updateWith({status:'invalid_shipping_address'});}else{ev.updateWith({status:'success',shippingOptions:availableCarriers.map(carrier=>({id:String(carrier.id),label:carrier.name,detail:carrier.description?carrier.description:"",amount:carrier.minorAmount,})),...this._getOrderDetails(availableCarriers[0].minorAmount,0),});}});paymentRequest.on('shippingoptionchange',async(ev)=>{const result=await this._rpc({route:'/shop/update_carrier',params:{carrier_id:parseInt(ev.shippingOption.id),},});ev.updateWith({status:'success',...this._getOrderDetails(ev.shippingOption.amount,result.delivery_discount_minor_amount||0,),});});}},_updateAmount(newAmount,newMinorAmount){this._super(...arguments);this.stripePaymentRequests&&this.stripePaymentRequests.map(paymentRequest=>paymentRequest.update(this._getOrderDetails()));},});return __exports;});; 9939 9940/* /payment_stripe/static/src/js/payment_form.js */ 9941odoo.define('@payment_stripe/js/payment_form',async function(require){'use strict';let __exports={};const checkoutForm=require('payment.checkout_form');const manageForm=require('payment.manage_form');const{StripeOptions}=require('@payment_stripe/js/stripe_options');const stripeMixin={_processRedirectPayment:function(code,paymentOptionId,processingValues){if(code!=='stripe'){return this._super(...arguments);} 9942const stripeJS=Stripe(processingValues['publishable_key'],new StripeOptions()._prepareStripeOptions(processingValues),);stripeJS.redirectToCheckout({sessionId:processingValues['session_id']});},};checkoutForm.include(stripeMixin);manageForm.include(stripeMixin);return __exports;});; 9943 9944/* /payment_stripe/static/src/js/stripe_options.js */ 9945odoo.define('@payment_stripe/js/stripe_options',async function(require){'use strict';let __exports={};const StripeOptions=__exports.StripeOptions=class StripeOptions{_prepareStripeOptions(processingValues){return{'apiVersion':'2019-05-16',};};} 9946return __exports;});; 9947 9948/* /website/static/src/snippets/s_share/000.js */ 9949odoo.define('@website/snippets/s_share/000',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');const ShareWidget=publicWidget.Widget.extend({selector:'.s_share, .oe_share',events:{'click a':'_onShareLinkClick',},async start(){this.URL_REGEX=/(\?(?:|.*&)(?:u|url|body)=)(.*?)(&|#|$)/;this.TITLE_REGEX=/(\?(?:|.*&)(?:title|text|subject|description)=)(.*?)(&|#|$)/;this.MEDIA_REGEX=/(\?(?:|.*&)(?:media)=)(.*?)(&|#|$)/;return this._super(...arguments);},destroy(){this._super(...arguments);this.el.classList.add('o_no_link_popover');},_onShareLinkClick(ev){const aEl=ev.currentTarget;const currentHref=aEl.href;if(!this.URL_REGEX.test(currentHref)&&!this.TITLE_REGEX.test(currentHref)&&!this.MEDIA_REGEX.test(currentHref)){return;} 9950ev.preventDefault();ev.stopPropagation();const url=encodeURIComponent(window.location.href);const title=encodeURIComponent(document.title);aEl.href=currentHref.replace(this.URL_REGEX,(match,a,b,c)=>{return a+url+c;}).replace(this.TITLE_REGEX,function(match,a,b,c){if(aEl.classList.contains('s_share_whatsapp')){return`${a + title}%20${url + c}`;} 9951return a+title+c;});
9951const urlObject=new URL(aEl.href);if(urlObject.searchParams.has("media")){const ogImageEl=document.querySelector("meta[property='og:image']");if(ogImageEl){const media=encodeURIComponent(ogImageEl.content);urlObject.searchParams.set("media",media);}else{urlObject.searchParams.delete("media");}} 9952window.open(urlObject.toString(),aEl.target,'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600');},});publicWidget.registry.share=ShareWidget;__exports[Symbol.for("default")]=ShareWidget;return __exports;});; 9953 9954/* /website/static/src/snippets/s_facebook_page/000.js */ 9955odoo.define('website.s_facebook_page',function(require){'use strict';var publicWidget=require('web.public.widget');var utils=require('web.utils');const{debounce}=require("@web/core/utils/timing");const FacebookPageWidget=publicWidget.Widget.extend({selector:'.o_facebook_page',disabledInEditableMode:false,start:function(){var def=this._super.apply(this,arguments);this.previousWidth=0;this.el.classList.add("o_not_editable");const params=_.pick(this.$el[0].dataset,'href','id','height','tabs','small_header','hide_cover');if(!params.href){return def;} 9956if(params.id){params.href=`https://www.facebook.com/${params.id}`;} 9957delete params.id;this._renderIframe(params);this.resizeObserver=new ResizeObserver(debounce(this._renderIframe.bind(this,params),100));this.resizeObserver.observe(this.el.parentElement);return def;},destroy:function(){this._super.apply(this,arguments);if(this.iframeEl){this._deactivateEditorObserver();this.iframeEl.remove();this._activateEditorObserver();this.resizeObserver.disconnect();}},_renderIframe(params){this._deactivateEditorObserver();params.width=utils.confine(Math.floor(this.$el.width()),180,500);if(this.previousWidth!==params.width){this.previousWidth=params.width;const src=$.param.querystring("https://www.facebook.com/plugins/page.php",params);this.iframeEl=Object.assign(document.createElement("iframe"),{src:src,scrolling:"no",});this.iframeEl.setAttribute("frameborder","0");this.iframeEl.setAttribute("allowTransparency","true");this.iframeEl.setAttribute("style",`width: ${params.width}px; height: ${params.height}px; border: none; overflow: hidden;`);this.el.replaceChildren(this.iframeEl);} 9958this._activateEditorObserver();},_activateEditorObserver(){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();},_deactivateEditorObserver(){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();},});publicWidget.registry.facebookPage=FacebookPageWidget;return FacebookPageWidget;});; 9959 9960/* /website/static/src/snippets/s_image_gallery/000.js */ 9961odoo.define('website.s_image_gallery',function(require){'use strict';var core=require('web.core');var publicWidget=require('web.public.widget');var qweb=core.qweb;const GalleryWidget=publicWidget.Widget.extend({selector:'.s_image_gallery:not(.o_slideshow)',events:{'click img':'_onClickImg',},_onClickImg:function(ev){if(this.$modal||ev.currentTarget.matches("a > img")){return;} 9962var self=this;var $cur=$(ev.currentTarget);var $images=$cur.closest('.s_image_gallery').find('img');var size=0.8;var dimensions={min_width:Math.round(window.innerWidth*size*0.9),min_height:Math.round(window.innerHeight*size),max_width:Math.round(window.innerWidth*size*0.9),max_height:Math.round(window.innerHeight*size),width:Math.round(window.innerWidth*size*0.9),height:Math.round(window.innerHeight*size)};var $img=($cur.is('img')===true)?$cur:$cur.closest('img');const milliseconds=$cur.closest('.s_image_gallery').data('interval')||false;this.$modal=$(qweb.render('website.gallery.slideshow.lightbox',{images:$images.get(),index:$images.index($img),dim:dimensions,interval:milliseconds||0,id:_.uniqueId('slideshow_'),}));this.__onModalKeydown=this._onModalKeydown.bind(this);this.$modal.on('hidden.bs.modal',function(){$(this).hide();$(this).siblings().filter('.modal-backdrop').remove();this.removeEventListener("keydown",self.__onModalKeydown);$(this).remove();self.$modal=undefined;});this.$modal.one('shown.bs.modal',function(){self.trigger_up('widgets_start_request',{editableMode:false,$target:self.$modal.find('.modal
9962-body.o_slideshow'),});this.addEventListener("keydown",self.__onModalKeydown);});this.$modal.appendTo(document.body);const modalBS=new Modal(this.$modal[0],{keyboard:true,backdrop:true});modalBS.show();},_onModalKeydown(ev){if(ev.key==="ArrowLeft"||ev.key==="ArrowRight"){const side=ev.key==="ArrowLeft"?"prev":"next";this.$modal[0].querySelector(`.carousel-control-${side}`).click();} 9963if(ev.key==="Escape"){ev.stopPropagation();}},});const GallerySliderWidget=publicWidget.Widget.extend({selector:'.o_slideshow',disabledInEditableMode:false,start:function(){var self=this;this.$carousel=this.$target.is('.carousel')?this.$target:this.$target.find('.carousel');this.$indicator=this.$carousel.find('.carousel-indicators');this.$prev=this.$indicator.find('li.o_indicators_left').css('visibility','');this.$next=this.$indicator.find('li.o_indicators_right').css('visibility','');var $lis=this.$indicator.find('li[data-bs-slide-to]');let indicatorWidth=this.$indicator.width();if(indicatorWidth===0){const $indicatorParent=this.$indicator.parents().not(':visible').last();if(!$indicatorParent[0].style.display){$indicatorParent[0].style.display='block';indicatorWidth=this.$indicator.width();$indicatorParent[0].style.display='';}} 9964let nbPerPage=Math.floor(indicatorWidth/$lis.first().outerWidth(true))-3;var realNbPerPage=nbPerPage||1;var nbPages=Math.ceil($lis.length/realNbPerPage);var index;var page;update();function hide(){$lis.each(function(i){$(this).toggleClass('d-none',i<page*nbPerPage||i>=(page+1)*nbPerPage);});if(page<=0){self.$prev.detach();}else{self.$prev.removeClass('d-none');self.$prev.prependTo(self.$indicator);} 9965if(page>=nbPages-1){self.$next.detach();}else{self.$next.removeClass('d-none');self.$next.appendTo(self.$indicator);}} 9966function update(){const active=$lis.filter('.active');index=active.length?$lis.index(active):0;page=Math.floor(index/realNbPerPage);hide();} 9967this.$carousel.on('slide.bs.carousel.gallery_slider',function(){setTimeout(function(){var $item=self.$carousel.find('.carousel-inner .carousel-item-prev, .carousel-inner .carousel-item-next');var index=$item.index();$lis.removeClass('active').filter('[data-bs-slide-to="'+index+'"]').addClass('active');},0);});this.$indicator.on('click.gallery_slider','> li:not([data-bs-slide-to])',function(){page+=($(this).hasClass('o_indicators_left')?-1:1);page=Math.max(0,Math.min(nbPages-1,page));self.$carousel.carousel(page*realNbPerPage);if(!self.editableMode){hide();}});this.$carousel.on('slid.bs.carousel.gallery_slider',update);return this._super.apply(this,arguments);},destroy:function(){this._super.apply(this,arguments);if(!this.$indicator){return;} 9968this.$prev.prependTo(this.$indicator);this.$next.appendTo(this.$indicator);this.$carousel.off('.gallery_slider');this.$indicator.off('.gallery_slider');},});publicWidget.registry.gallery=GalleryWidget;publicWidget.registry.gallerySlider=GallerySliderWidget;return{GalleryWidget:GalleryWidget,GallerySliderWidget:GallerySliderWidget,};});; 9969 9970/* /website/static/src/snippets/s_countdown/000.js */ 9971odoo.define('website.s_countdown',function(require){'use strict';const{ColorpickerWidget}=require('web.Colorpicker');const core=require('web.core');const publicWidget=require('web.public.widget');const weUtils=require('web_editor.utils');const qweb=core.qweb;const _t=core._t;const CountdownWidget=publicWidget.Widget.extend({selector:'.s_countdown',disabledInEditableMode:false,start:function(){this.$wrapper=this.$('.s_countdown_canvas_wrapper');this.$wrapper.addClass('d-flex justify-content-center');this.hereBeforeTimerEnds=false;this.endAction=this.el.dataset.endAction;this.endTime=parseInt(this.el.dataset.endTime);this.size=parseInt(this.el.dataset.size);this.display=this.el.dataset.display;if(!this.display&&this.el.dataset.bsDisplay){this.display=this.el.dataset.bsDisplay;delete this.el.dataset.bsDisplay;this.el.dataset.display=this.display;} 9972this.layout=this.el.dataset.layout;this.layoutBackground=this.el.dataset.layoutBackground;this.progressBarStyle=this.el.dataset.progressBarStyle;this.progressBarWeight=this.el.dataset.progressBarWeight;this.textColor=this._ensureCssColor(this.el.dataset.textColor);
9972this.layoutBackgroundColor=this._ensureCssColor(this.el.dataset.layoutBackgroundColor);this.progressBarColor=this._ensureCssColor(this.el.dataset.progressBarColor);this.onlyOneUnit=this.display==='d';this.width=parseInt(this.size);if(this.layout==='boxes'){this.width/=1.75;} 9973this._initTimeDiff();this._render();this.setInterval=setInterval(this._render.bind(this),1000);return this._super(...arguments);},destroy:function(){this.$('.s_countdown_end_redirect_message').remove();this.$('.s_countdown_end_message').addClass('d-none');this.$('.s_countdown_text_wrapper').remove();this.$('.s_countdown_canvas_wrapper').removeClass('d-none');this.$('.s_countdown_canvas_flex').remove();clearInterval(this.setInterval);this._super(...arguments);},_ensureCssColor:function(color){if(ColorpickerWidget.isCSSColor(color)){return color;} 9974return weUtils.getCSSVariableValue(color)||this.defaultColor;},_getDelta:function(){const currentTimestamp=Date.now()/1000;return this.endTime-currentTimestamp;},_handleEndCountdownAction:function(){if(this.endAction==='redirect'){const redirectUrl=this.el.dataset.redirectUrl||'/';if(this.hereBeforeTimerEnds){setTimeout(()=>window.location=redirectUrl,500);}else{if(!this.$('.s_countdown_end_redirect_message').length){const $container=this.$('> .container, > .container-fluid, > .o_container_small');$container.append($(qweb.render('website.s_countdown.end_redirect_message',{redirectUrl:redirectUrl,})));}}}else if(this.endAction==='message'||this.endAction==='message_no_countdown'){this.$('.s_countdown_end_message').removeClass('d-none');}},_initTimeDiff:function(){const delta=this._getDelta();this.diff=[];if(this._isUnitVisible('d')&&!(this.onlyOneUnit&&delta<86400)){this.diff.push({canvas:$('<div class="s_countdown_canvas_flex"><canvas class="w-100"/></div>').appendTo(this.$wrapper)[0],total:15,label:_t("Days"),nbSeconds:86400,});} 9975if(this._isUnitVisible('h')||(this.onlyOneUnit&&delta<86400&&delta>3600)){this.diff.push({canvas:$('<div class="s_countdown_canvas_flex"><canvas class="w-100"/></div>').appendTo(this.$wrapper)[0],total:24,label:_t("Hours"),nbSeconds:3600,});} 9976if(this._isUnitVisible('m')||(this.onlyOneUnit&&delta<3600&&delta>60)){this.diff.push({canvas:$('<div class="s_countdown_canvas_flex"><canvas class="w-100"/></div>').appendTo(this.$wrapper)[0],total:60,label:_t("Minutes"),nbSeconds:60,});} 9977if(this._isUnitVisible('s')||(this.onlyOneUnit&&delta<60)){this.diff.push({canvas:$('<div class="s_countdown_canvas_flex"><canvas class="w-100"/></div>').appendTo(this.$wrapper)[0],total:60,label:_t("Seconds"),nbSeconds:1,});}},_isUnitVisible:function(unit){return this.display.includes(unit);},_render:function(){if(this.onlyOneUnit&&this._getDelta()<this.diff[0].nbSeconds){this.$('.s_countdown_canvas_flex').remove();this._initTimeDiff();} 9978this._updateTimeDiff();const hideCountdown=this.isFinished&&!this.editableMode&&this.$el.hasClass('hide-countdown');if(this.layout==='text'){this.$('.s_countdown_canvas_flex').addClass('d-none');if(!this.$textWrapper){this.$textWrapper=$('<span/>').attr({class:'s_countdown_text_wrapper d-none',});this.$textWrapper.text(_t("Countdown ends in"));this.$textWrapper.append($('<span/>').attr({class:'s_countdown_text ms-1',}));this.$textWrapper.appendTo(this.$wrapper);} 9979this.$textWrapper.toggleClass('d-none',hideCountdown);const countdownText=this.diff.map(e=>e.nb+' '+e.label).join(', ');this.$('.s_countdown_text').text(countdownText.toLowerCase());}else{for(const val of this.diff){const canvas=val.canvas.querySelector('canvas');const ctx=canvas.getContext("2d");ctx.canvas.width=this.width;ctx.canvas.height=this.size;this._clearCanvas(ctx);$(canvas).toggleClass('d-none',hideCountdown);if(hideCountdown){continue;} 9980if(this.layoutBackground!=='none'){this._drawBgShape(ctx,this.layoutBackground==='plain');} 9981this._drawText(canvas,val.nb,val.label,this.layoutBackground==='plain');if(this.progressBarStyle==='surrounded'){this._drawProgressBarBg(ctx,this.progressBarWeight==='thin');} 9982if(this.progressBarStyle!=='none'){this._drawProgressBar(ctx,val.nb,val.total,this.progressBarWeight==='thin');} 9983this.$('.s_countdown_canvas_flex').toggleClass('mx-1',this.layout==='boxes');}} 9984if(this.isFinished){clearInterval(this.setInterval);if(!this.editableMode){this._handleEndCountdownAction();}}},_updateTimeDiff:function(){let delta=this._getDelta();this.isFinished=delta<0;if(this.isFinished){for(const unitData of this.diff){unitData.nb=0;} 9985return;} 9986this.hereBeforeTimerEnds=true;for(const unitData of this.diff){unitData.nb=Math.floor(delta/unitData.nbSeconds);delta-=unitData.nb*unitData.nbSeconds;}},_clearCanvas:function(ctx){ctx.clearRect(0,0,this.size,this.size);},_drawText:function(canvas,textNb,textUnit,full=false){const ctx=canvas.getContext("2d");const nbSize=this.size/4;ctx.font=`${nbSize}px Arial`;ctx.fillStyle=this.textColor;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(textNb,canvas.width/2,canvas.height/2);const unitSize=this.size/12;ctx.font=`${unitSize}px Arial`;ctx.fillText(textUnit,canvas.width/2,canvas.height/2+nbSize/1.5,this.width);
9986if(this.layout==='boxes'&&this.layoutBackground!=='none'&&this.progressBarStyle==='none'){let barWidth=this.size/(this.progressBarWeight==='thin'?31:10);if(full){barWidth=0;} 9987ctx.beginPath();ctx.moveTo(barWidth,this.size/2);ctx.lineTo(this.width-barWidth,this.size/2);ctx.stroke();}},_drawBgShape:function(ctx,full=false){ctx.fillStyle=this.layoutBackgroundColor;ctx.beginPath();if(this.layout==='circle'){let rayon=this.size/2;if(this.progressBarWeight==='thin'){rayon-=full?this.size/29:this.size/15;}else{rayon-=full?0:this.size/10;} 9988ctx.arc(this.size/2,this.size/2,rayon,0,Math.PI*2);ctx.fill();}else if(this.layout==='boxes'){let barWidth=this.size/(this.progressBarWeight==='thin'?31:10);if(full){barWidth=0;} 9989ctx.fillStyle=this.layoutBackgroundColor;ctx.rect(barWidth,barWidth,this.width-barWidth*2,this.size-barWidth*2);ctx.fill();const gradient=ctx.createLinearGradient(0,this.width,0,0);gradient.addColorStop(0,'#ffffff24');gradient.addColorStop(1,this.layoutBackgroundColor);ctx.fillStyle=gradient;ctx.rect(barWidth,barWidth,this.width-barWidth*2,this.size-barWidth*2);ctx.fill();$(ctx.canvas).css({'border-radius':'8px'});}},_drawProgressBar:function(ctx,nbUnit,totalUnit,thinLine){ctx.strokeStyle=this.progressBarColor;ctx.lineWidth=thinLine?this.size/35:this.size/10;if(this.layout==='circle'){ctx.beginPath();ctx.arc(this.size/2,this.size/2,this.size/2-this.size/20,Math.PI/-2,(Math.PI*2)*(nbUnit/totalUnit)+(Math.PI/-2));ctx.stroke();}else if(this.layout==='boxes'){ctx.lineWidth*=2;let pc=nbUnit/totalUnit*100;const linesCoordFuncs=[(linePc)=>[0+ctx.lineWidth/2,0,(this.width-ctx.lineWidth/2)*linePc/25+ctx.lineWidth/2,0],(linePc)=>[this.width,0+ctx.lineWidth/2,this.width,(this.size-ctx.lineWidth/2)*linePc/25+ctx.lineWidth/2],(linePc)=>[this.width-((this.width-ctx.lineWidth/2)*linePc/25)-ctx.lineWidth/2,this.size,this.width-ctx.lineWidth/2,this.size],(linePc)=>[0,this.size-((this.size-ctx.lineWidth/2)*linePc/25)-ctx.lineWidth/2,0,this.size-ctx.lineWidth/2],];while(pc>0&&linesCoordFuncs.length){const linePc=Math.min(pc,25);const lineCoord=(linesCoordFuncs.shift())(linePc);ctx.beginPath();ctx.moveTo(lineCoord[0],lineCoord[1]);ctx.lineTo(lineCoord[2],lineCoord[3]);ctx.stroke();pc-=linePc;}}},_drawProgressBarBg:function(ctx,thinLine){ctx.strokeStyle=this.progressBarColor;ctx.globalAlpha=0.2;ctx.lineWidth=thinLine?this.size/35:this.size/10;if(this.layout==='circle'){ctx.beginPath();ctx.arc(this.size/2,this.size/2,this.size/2-this.size/20,0,Math.PI*2);ctx.stroke();}else if(this.layout==='boxes'){ctx.lineWidth*=2;const points=[[0+ctx.lineWidth/2,0,this.width,0],[this.width,0+ctx.lineWidth/2,this.width,this.size],[0,this.size,this.width-ctx.lineWidth/2,this.size],[0,0,0,this.size-ctx.lineWidth/2],];while(points.length){const point=points.shift();ctx.beginPath();ctx.moveTo(point[0],point[1]);ctx.lineTo(point[2],point[3]);ctx.stroke();}} 9990ctx.globalAlpha=1;},});publicWidget.registry.countdown=CountdownWidget;return CountdownWidget;});; 9991 9992/* /website/static/src/snippets/s_popup/000.js */ 9993odoo.define('website.s_popup',function(require){'use strict';const config=require('web.config');const{_t}=require("@web/core/l10n/translation");const{getTabableElements}=require('@web/core/utils/ui');const dom=require('web.dom');const publicWidget=require('web.public.widget');const{getCookie,setCookie,deleteCookie}=require("web.utils.cookies");const{setUtmsHtmlDataset}=require('@website/js/content/inject_dom');const{cloneContentEls,onceAllImagesLoaded}=require("website.utils");const SharedPopupWidget=publicWidget.Widget.extend({selector:'.s_popup',disabledInEditableMode:false,events:{'show.bs.modal':'_onModalShow','hidden.bs.modal':'_onModalHidden',},destroy(){this._super(...arguments);if(!this._isNormalCase()){return;} 9994if(!this.editableMode){this.el.classList.add('d-none');}},_isNormalCase(){return this.el.children.length===1&&this.el.firstElementChild.classList.contains('modal');},_onModalShow(){if(!this._isNormalCase()){return;} 9995this.el.classList.remove('d-none');},_onModalHidden(){if(!this._isNormalCase()){return;} 9996if(this.el.querySelector('.s_popup_no_backdrop')){$().getScrollingTarget()[0].dispatchEvent(new Event('scroll'));} 9997this.el.classList.add('d-none');},});publicWidget.registry.SharedPopup=SharedPopupWidget;const PopupWidget=publicWidget.Widget.extend({selector:".s_popup:not(#website_cookies_bar)",events:{'click .js_close_popup':'_onCloseClick','hide.bs.modal':'_onHideModal','show.bs.modal':'_onShowModal',},cookieValue:true,start:function(){this._popupAlreadyShown=!!getCookie(this.$el.attr('id'));if(!this._popupAlreadyShown){this._bindPopup();} 9998return this._super(...arguments);},destroy:function(){this._super.apply(this,arguments);$(document).off('mouseleave.open_popup');this.releaseFocus&&this.releaseFocus();this.$target.find('.modal').modal('hide');clearTimeout(this.timeout);},_bindPopup:function(){const $main=this.$target.find('.modal');let display=$main.data('display');let delay=$main.data('showAfter');if(config.device.isMobile){if(display==='mouseExit'){display='afterDelay';delay=5000;}} 9999if(display==='afterDelay'){this.timeout=setTimeout(()=>this._showPopup(),delay);}else{$(document).on('mouseleave.open_popup',()=>this._showPopup());}},_canShowPopup(){return true;},_hidePopup:function(){this.$target.find('.modal').modal('hide');},_showPopup:function(){if(this._popupAlreadyShown||!this._canShowPopup()){return;} 10000this.$target.find('.modal').modal('show');this.releaseFocus=this._trapFocus();},_trapFocus(){let tabableEls=getTabableElements(this.el);const previouslyFocusedEl=document.activeElement||document.body;if(tabableEls.length){tabableEls[0].focus();this.el.querySelector(".modal").scrollTop=0;}else{this.el.focus();} 10001if(this.el.querySelector(".s_popup_no_backdrop")){return()=>previouslyFocusedEl.focus();} 10002const _onKeydown=(ev)=>{if(ev.key!=="Tab"){return;} 10003tabableEls=getTabableElements(this.el);if(!tabableEls.length){ev.preventDefault();return;} 10004if(!ev.shiftKey&&ev.target===tabableEls[tabableEls.length-1]){ev.preventDefault();tabableEls[0].focus();} 10005if(ev.shiftKey&&ev.target===tabableEls[0]){ev.preventDefault();tabableEls[tabableEls.length-1].focus();}};this.el.addEventListener("keydown",_onKeydown);return()=>{this.el.removeEventListener("keydown",_onKeydown);previouslyFocusedEl.focus();};},_onCloseClick:function(){this._hidePopup();},_onHideModal:function(){const nbDays=this.$el.find('.modal').data('consentsDuration');
10005setCookie(this.el.id,this.cookieValue,nbDays*24*60*60,'required');this._popupAlreadyShown=true;this.$target.find('.media_iframe_video iframe').each((i,iframe)=>{iframe.src='';});this.releaseFocus&&this.releaseFocus();this.releaseFocus=null;},_onShowModal(){this.el.querySelectorAll('.media_iframe_video').forEach(media=>{const iframe=media.querySelector('iframe');iframe.src=media.dataset.oeExpression||media.dataset.src;});},});publicWidget.registry.popup=PopupWidget;const noBackdropPopupWidget=publicWidget.Widget.extend({selector:'.s_popup_no_backdrop',disabledInEditableMode:false,events:{'shown.bs.modal':'_onModalNoBackdropShown','hide.bs.modal':'_onModalNoBackdropHide',},start(){this.throttledUpdateScrollbar=_.throttle(()=>this._updateScrollbar(),25);if(this.editableMode&&this.el.classList.contains('show')){this._updateScrollbar();this._addModalNoBackdropEvents();} 10006return this._super(...arguments);},destroy(){this._super(...arguments);this._removeModalNoBackdropEvents();window.dispatchEvent(new Event('resize'));},_updateScrollbar(){const modalContent=this.el.querySelector('.modal-content');const isOverflowing=dom.hasScrollableContent(modalContent);const modalInstance=window.Modal.getInstance(this.el);if(isOverflowing){modalInstance._adjustDialog();}else{modalInstance._resetAdjustments();}},_addModalNoBackdropEvents(){window.addEventListener('resize',this.throttledUpdateScrollbar);this.resizeObserver=new window.ResizeObserver(()=>{this._updateScrollbar();});this.resizeObserver.observe(this.el.querySelector('.modal-content'));},_removeModalNoBackdropEvents(){window.removeEventListener('resize',this.throttledUpdateScrollbar);if(this.resizeObserver){this.resizeObserver.disconnect();delete this.resizeObserver;}},_onModalNoBackdropShown(){this._updateScrollbar();this._addModalNoBackdropEvents();},_onModalNoBackdropHide(){this._removeModalNoBackdropEvents();},});publicWidget.registry.noBackdropPopup=noBackdropPopupWidget;publicWidget.registry.cookies_bar=PopupWidget.extend({selector:'#website_cookies_bar',events:Object.assign({},PopupWidget.prototype.events,{'click #cookies-consent-essential, #cookies-consent-all':'_onAcceptClick',}),destroy(){if(this.toggleEl){this.toggleEl.removeEventListener("click",this._onToggleCookiesBar);this.toggleEl.remove();} 10007this._super(...arguments);},_showPopup(){this._super(...arguments);const policyLinkEl=this.el.querySelector(".o_cookies_bar_text_policy");if(policyLinkEl&&window.location.pathname===new URL(policyLinkEl.href).pathname){this.toggleEl=cloneContentEls(` 10008 <button class="o_cookies_bar_toggle btn btn-info btn-sm rounded-circle d-flex align-items-center position-fixed pe-auto"> 10009 <i class="fa fa-eye" alt="" aria-hidden="true"></i> <span class="o_cookies_bar_toggle_label"></span> 10010 </button> 10011 `).firstElementChild;this.el.insertAdjacentElement("beforebegin",this.toggleEl);this._toggleCookiesBar();this._onToggleCookiesBar=this._toggleCookiesBar.bind(this);this.toggleEl.addEventListener("click",this._onToggleCookiesBar);}},_toggleCookiesBar(){const popupEl=this.el.querySelector(".modal");$(popupEl).modal("toggle");this._popupAlreadyShown=false;deleteCookie(this.el.id);const hidden=!popupEl.classList.contains("show");this.toggleEl.querySelector(".fa").className=`fa ${hidden ? "fa-eye" : "fa-eye-slash"}`;this.toggleEl.querySelector(".o_cookies_bar_toggle_label").innerText=hidden?_t("Show the cookies bar"):_t("Hide the cookies bar");if(hidden||!popupEl.classList.contains("s_popup_bottom")){this.toggleEl.style.removeProperty("--cookies-bar-toggle-inset-block-end");}else{onceAllImagesLoaded($(popupEl)).then(()=>{const popupHeight=popupEl.querySelector(".modal-content").offsetHeight;const toggleMargin=8;const bottom=document.body.offsetHeight>popupHeight+this.toggleEl.offsetHeight+toggleMargin?`calc( 10012 ${getComputedStyle(popupEl.querySelector(".modal-dialog")).paddingBottom} 10013 + ${popupHeight + toggleMargin}px 10014 )`:"";this.toggleEl.style.setProperty("--cookies-bar-toggle-inset-block-end",bottom);});}},_onAcceptClick(ev){const isFullConsent=ev.target.id==="cookies-consent-all";this.cookieValue=`{"required": true, "optional": ${isFullConsent}}`;if(isFullConsent){document.dispatchEvent(new Event("optionalCookiesAccepted"));} 10015this._onHideModal();this.toggleEl&&this.toggleEl.remove();},_onHideModal(){this._super(...arguments);const params=new URLSearchParams(window.location.search);const trackingFields={utm_campaign:"odoo_utm_campaign",utm_source:"odoo_utm_source",utm_medium:"odoo_utm_medium",};for(const[key,value]of params){if(key in trackingFields){setCookie(trackingFields[key],value,31*24*60*60,"optional");}} 10016setUtmsHtmlDataset();}});return PopupWidget;});; 10017 10018/* /website/static/src/snippets/s_table_of_content/000.js */ 10019odoo.define('website.s_table_of_content',function(require){'use strict';const publicWidget=require('web.public.widget');const{extraMenuUpdateCallbacks}=require('website.content.menu');const TableOfContent=publicWidget.Widget.extend({selector:'section .s_table_of_content_navbar_sticky',disabledInEditableMode:false,async start(){this._stripNavbarStyles();await this._super(...arguments);this.$scrollingElement=this.$target.closest(".s_table_of_content").closestScrollable();this.$scrollingTarget=$().getScrollingTarget(this.$scrollingElement);this.previousPosition=-1;this._updateTableOfContentNavbarPosition();this._updateTableOfContentNavbarPositionBound=this._updateTableOfContentNavbarPosition.bind(this);extraMenuUpdateCallbacks.push(this._updateTableOfContentNavbarPositionBound);},destroy(){const indexCallback=extraMenuUpdateCallbacks.indexOf(this._updateTableOfContentNavbarPositionBound);if(indexCallback>=0){extraMenuUpdateCallbacks.splice(indexCallback,1);} 10020this.$target.css('top','');this.$target.find('.s_table_of_content_navbar').css({top:'',maxHeight:''});this._super(...arguments);},_stripNavbarStyles(){for(let el of this.el.querySelectorAll('.s_table_of_content_navbar .table_of_content_link')){const translationEl=el.querySelector('span[data-oe-translation-state]');if(translationEl){el=translationEl;} 10021const text=el.textContent;el.textContent=text;}},_updateTableOfContentNavbarPosition(){if(!this.$target[0].querySelector('a.table_of_content_link')){return;} 10022let position=0;const $fixedElements=$('.o_top_fixed_element');_.each($fixedElements,el=>position+=$(el).outerHeight());const isHorizontalNavbar=this.$target.hasClass('s_table_of_content_horizontal_navbar');this.$target.css('top',isHorizontalNavbar?position:'');this.$target.find('.s_table_of_content_navbar').css('top',isHorizontalNavbar?'':position+20);position+=isHorizontalNavbar?this.$target.outerHeight():0;this.$target.find('.s_table_of_content_navbar').css('maxHeight',isHorizontalNavbar?'':`calc(100vh - ${position + 40}px)`);if(this.previousPosition!==position){const target=this.$scrollingTarget[0];new ScrollSpy(target instanceof Window?target.document.body:target,{target:this.$target.find('.s_table_of_content_navbar'),method:'offset',offset:position+100,alwaysKeepFirstActive:true,});this.previousPosition=position;}},});publicWidget.registry.anchorSlide.include({_computeExtraOffset(){let extraOffset=this._super(...arguments);if(this.$el.hasClass('table_of_content_link')){const tableOfContentNavbarEl=this.$el.closest('.s_table_of_content_navbar_sticky.s_table_of_content_horizontal_navbar');if(tableOfContentNavbarEl.length>0){extraOffset+=$(tableOfContentNavbarEl).outerHeight();}} 10023return extraOffset;},});publicWidget.registry.snippetTableOfContent=TableOfContent;return TableOfContent;});; 10024 10025/* /website/static/src/snippets/s_chart/000.js */ 10026odoo.define('website.s_chart',function(require){'use strict';const publicWidget=require('web.public.widget');const weUtils=require('web_editor.utils');const ChartWidget=publicWidget.Widget.extend({selector:'.s_chart',disabledInEditableMode:false,jsLibs:['/web/static/lib/Chart/Chart.js',],init:function(parent,options){this._super.apply(this,arguments);this.style=window.getComputedStyle(document.documentElement);},start:function(){const data=JSON.parse(this.el.dataset.data);
10026data.datasets.forEach(el=>{if(Array.isArray(el.backgroundColor)){el.backgroundColor=el.backgroundColor.map(el=>this._convertToCssColor(el));el.borderColor=el.borderColor.map(el=>this._convertToCssColor(el));}else{el.backgroundColor=this._convertToCssColor(el.backgroundColor);el.borderColor=this._convertToCssColor(el.borderColor);} 10027el.borderWidth=this.el.dataset.borderWidth;});const chartData={type:this.el.dataset.type,data:data,options:{legend:{display:this.el.dataset.legendPosition!=='none',position:this.el.dataset.legendPosition,},tooltips:{enabled:this.el.dataset.tooltipDisplay==='true',position:'custom',},title:{display:!!this.el.dataset.title,text:this.el.dataset.title,},},};if(this.el.dataset.type==='radar'){chartData.options.scale={ticks:{beginAtZero:true,}};}else if(['pie','doughnut'].includes(this.el.dataset.type)){chartData.options.tooltips.callbacks={label:(tooltipItem,data)=>{const label=data.datasets[tooltipItem.datasetIndex].label;const secondLabel=data.labels[tooltipItem.index];let final=label;if(label){if(secondLabel){final=label+' - '+secondLabel;}}else if(secondLabel){final=secondLabel;} 10028return final+':'+data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];},};}else{const beforeBuildTicks=(scale)=>{scale.min=parseInt(this.el.dataset.ticksMin)||scale.min;scale.max=parseInt(this.el.dataset.ticksMax)||scale.max;};chartData.options.scales={xAxes:[{stacked:this.el.dataset.stacked==='true',ticks:{beginAtZero:true},beforeBuildTicks:beforeBuildTicks,}],yAxes:[{stacked:this.el.dataset.stacked==='true',ticks:{beginAtZero:true},beforeBuildTicks:beforeBuildTicks,}],};} 10029if(this.editableMode){chartData.options.animation={duration:0,};} 10030const canvas=this.el.querySelector('canvas');window.Chart.Tooltip.positioners.custom=(elements,eventPosition)=>eventPosition;this.chart=new window.Chart(canvas,chartData);return this._super.apply(this,arguments);},destroy:function(){if(this.chart){this.chart.destroy();this.el.querySelectorAll('.chartjs-size-monitor').forEach(el=>el.remove());} 10031this._super.apply(this,arguments);},_convertToCssColor:function(color){if(!color){return'transparent';} 10032return weUtils.getCSSVariableValue(color,this.style)||color;},});publicWidget.registry.chart=ChartWidget;return ChartWidget;});; 10033 10034/* /website/static/src/snippets/s_google_map/000.js */ 10035odoo.define('website.s_google_map',function(require){'use strict';const publicWidget=require('web.public.widget');publicWidget.registry.GoogleMap=publicWidget.Widget.extend({selector:'.s_google_map',disabledInEditableMode:false,mapColors:{lightMonoMap:[{"featureType":"administrative.locality","elementType":"all","stylers":[{"hue":"#2c2e33"},{"saturation":7},{"lightness":19},{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":-2},{"visibility":"simplified"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"hue":"#e9ebed"},{"saturation":-90},{"lightness":-8},{"visibility":"simplified"}]},{"featureType":"transit","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":10},{"lightness":69},{"visibility":"on"}]},{"featureType":"water","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":-78},{"lightness":67},{"visibility":"simplified"}]}],lillaMap:[{elementType:"labels",stylers:[{saturation:-20}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:'road.highway',elementType:'labels',stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"poi.government",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"poi.sport_complex",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"poi.attraction",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"poi.business",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"transit",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"transit.station",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"landscape",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"road",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]},{featureType:"water",elementType:"geometry",stylers:[{hue:'#2d313f'},{visibility:"on"},{lightness:5},{saturation:-20}]}],blueMap:[{stylers:[{hue:"#00ffe6"},{saturation:-20}]},{featureType:"road",elementType:"geometry",stylers:[{lightness:100},{visibility:"simplified"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]}],retroMap:[{"featureType":"administrative","elementType":"all","stylers":[{"visibility":"on"},{"lightness":33}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2e5d4"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#c5dac6"}]},{"featureType":"poi.park","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":20}]},{"featureType":"road","elementType":"all","stylers":[{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#c5c6c6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#e4d7c6"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#fbfaf7"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"on"},{"color":"#acbcc9"}]}],flatMap:[{"stylers":[{"visibility":"off"}]},{"featureType":"road","stylers":[{"visibility":"on"},{"color":"#ffffff"}]},{"featureType":"road.arterial","stylers":[{"visibility":"on"},{"color":"#fee379"}]}
10035,{"featureType":"road.highway","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"landscape","stylers":[{"visibility":"on"},{"color":"#f3f4f4"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#7fc8ed"}]},{},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#83cead"}]},{"elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"weight":0.9},{"visibility":"off"}]}],cobaltMap:[{"featureType":"all","elementType":"all","stylers":[{"invert_lightness":true},{"saturation":10},{"lightness":30},{"gamma":0.5},{"hue":"#435158"}]}],cupertinoMap:[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#a2daf2"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"color":"#f7f1df"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#d0e3b4"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#bde6ab"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.medical","elementType":"geometry","stylers":[{"color":"#fbd3da"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffe15f"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#efd151"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"color":"black"}]},{"featureType":"transit.station.airport","elementType":"geometry.fill","stylers":[{"color":"#cfb2db"}]}],carMap:[{"featureType":"administrative","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"simplified"}]},{"featureType":"road","stylers":[{"visibility":"simplified"}]},{"featureType":"water","stylers":[{"visibility":"simplified"}]},{"featureType":"transit","stylers":[{"visibility":"simplified"}]},{"featureType":"landscape","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"visibility":"off"}]},{"featureType":"road.local","stylers":[{"visibility":"on"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"water","stylers":[{"color":"#84afa3"},{"lightness":52}]},{"stylers":[{"saturation":-77}]},{"featureType":"road"}],bwMap:[{stylers:[{hue:"#00ffe6"},{saturation:-100}]},{featureType:"road",elementType:"geometry",stylers:[{lightness:100},{visibility:"simplified"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]}],},async start(){await this._super(...arguments);if(typeof google!=='object'||typeof google.maps!=='object'){await new Promise(resolve=>{this.trigger_up('gmap_api_request',{editableMode:this.editableMode,onSuccess:()=>resolve(),});});return;} 10036const std=[];new google.maps.StyledMapType(std,{name:"Std Map"});const myOptions={zoom:12,center:new google.maps.LatLng(50.854975,4.3753899),mapTypeId:google.maps.MapTypeId.ROADMAP,panControl:false,zoomControl:false,mapTypeControl:false,streetViewControl:false,scrollwheel:false,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,'map_style']}};const mapC=this.$('.map_container');const map=new google.maps.Map(mapC.get(0),myOptions);const p=this.el.dataset.mapGps.substring(1).slice(0,-1).split(',');const gps=new google.maps.LatLng(p[0],p[1]);map.setCenter(gps);window.addEventListener('resize',()=>{map.setCenter(gps);});const markerOptions={map:map,animation:google.maps.Animation.DROP,position:new google.maps.LatLng(p[0],p[1])};if(this.el.dataset.pinStyle==='flat'){markerOptions.icon='/website/static/src/img/snippets_thumbs/s_google_map_marker.png';} 10037new google.maps.Marker(markerOptions);map.setMapTypeId(google.maps.MapTypeId[this.el.dataset.mapType]);map.setZoom(parseInt(this.el.dataset.mapZoom));const mapColorAttr=this.el.dataset.mapColor;if(mapColorAttr){const mapColor=this.mapColors[mapColorAttr];map.mapTypes.set('map_style',new google.maps.StyledMapType(mapColor,{name:"Styled Map"}));map.setMapTypeId('map_style');}},});});; 10038
10039/* /website/static/src/snippets/s_dynamic_snippet/000.js */ 10040odoo.define('website.s_dynamic_snippet',function(require){'use strict';const core=require('web.core');const config=require('web.config');const publicWidget=require('web.public.widget');const{Markup}=require('web.utils');const DEFAULT_NUMBER_OF_ELEMENTS=4;const DEFAULT_NUMBER_OF_ELEMENTS_SM=1;const DynamicSnippet=publicWidget.Widget.extend({selector:'.s_dynamic_snippet',read_events:{'click [data-url]':'_onCallToAction',},disabledInEditableMode:false,init:function(){this._super.apply(this,arguments);this.data=[];this.renderedContent='';this.isDesplayedAsMobile=config.device.isMobile;this.uniqueId=_.uniqueId('s_dynamic_snippet_');this.template_key='website.s_dynamic_snippet.grid';},willStart:function(){return this._super.apply(this,arguments).then(()=>Promise.all([this._fetchData(),]));},start:function(){return this._super.apply(this,arguments).then(()=>{this._setupSizeChangedManagement(true);this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();this._render();this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();});},destroy:function(){this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerUnactive();this._toggleVisibility(false);this._setupSizeChangedManagement(false);this._clearContent();this.options.wysiwyg&&this.options.wysiwyg.odooEditor.observerActive();this._super.apply(this,arguments);},_clearContent:function(){const $templateArea=this.$el.find('.dynamic_snippet_template');this.trigger_up('widgets_stop_request',{$target:$templateArea,});$templateArea.html('');},_isConfigComplete:function(){return this.$el.get(0).dataset.filterId!==undefined&&this.$el.get(0).dataset.templateKey!==undefined;},_getSearchDomain:function(){return[];},_getRpcParameters:function(){return{};},async _fetchData(){if(this._isConfigComplete()){const nodeData=this.el.dataset;const filterFragments=await this._rpc({'route':'/website/snippet/filters','params':Object.assign({'filter_id':parseInt(nodeData.filterId),'template_key':nodeData.templateKey,'limit':parseInt(nodeData.numberOfRecords),'search_domain':this._getSearchDomain(),'with_sample':this.editableMode,'context':{'_bugfix_force_minimum_max_limit_to_16':!!nodeData.forceMinimumMaxLimitTo16,},},this._getRpcParameters()),});this.data=filterFragments.map(Markup);}else{this.data=[];}},_prepareContent:function(){this.renderedContent=core.qweb.render(this.template_key,this._getQWebRenderOptions());},_getQWebRenderOptions:function(){const dataset=this.$target[0].dataset;const numberOfRecords=parseInt(dataset.numberOfRecords);let numberOfElements;if(config.device.isMobile){numberOfElements=parseInt(dataset.numberOfElementsSmallDevices)||DEFAULT_NUMBER_OF_ELEMENTS_SM;}else{numberOfElements=parseInt(dataset.numberOfElements)||DEFAULT_NUMBER_OF_ELEMENTS;} 10041const chunkSize=numberOfRecords<numberOfElements?numberOfRecords:numberOfElements;return{chunkSize:chunkSize,data:this.data,uniqueId:this.uniqueId,extraClasses:dataset.extraClasses||'',};},_render:function(){if(this.data.length>0||this.editableMode){this.$el.removeClass('o_dynamic_empty');this._prepareContent();}else{this.$el.addClass('o_dynamic_empty');this.renderedContent='';} 10042const classList=[...this.$el[0].classList];if(classList.includes('d-none')&&!classList.some(className=>className.match(/^d-(md|lg)-(?!none)/))){this.$el[0].classList.remove('d-none');} 10043this._renderContent();this.trigger_up('widgets_start_request',{$target:this.$el.children(),options:{parent:this},editableMode:this.editableMode,});},_renderContent:function(){const $templateArea=this.$el.find('.dynamic_snippet_template');this.trigger_up('widgets_stop_request',{$target:$templateArea,});$templateArea.html(this.renderedContent);this.trigger_up('widgets_start_request',{$target:$templateArea,editableMode:this.editableMode,});},_setupSizeChangedManagement:function(enable){if(enable===true){config.device.bus.on('size_changed',this,this._onSizeChanged);}else{config.device.bus.off('size_changed',this,this._onSizeChanged);}},_toggleVisibility:function(visible){this.$el.toggleClass('o_dynamic_empty',!visible);},_onCallToAction:function(ev){window.location=$(ev.currentTarget).attr('data-url');},_onSizeChanged:function(size){if(this.isDesplayedAsMobile!==config.device.isMobile){this.isDesplayedAsMobile=config.device.isMobile;this._render();}},});
10043publicWidget.registry.dynamic_snippet=DynamicSnippet;return DynamicSnippet;});; 10044 10045/* /website/static/src/snippets/s_dynamic_snippet_carousel/000.js */ 10046odoo.define('website.s_dynamic_snippet_carousel',function(require){'use strict';const publicWidget=require('web.public.widget');const DynamicSnippet=require('website.s_dynamic_snippet');const config=require('web.config');const DynamicSnippetCarousel=DynamicSnippet.extend({selector:'.s_dynamic_snippet_carousel',init:function(){this._super.apply(this,arguments);this.template_key='website.s_dynamic_snippet.carousel';},_getQWebRenderOptions:function(){return Object.assign(this._super.apply(this,arguments),{interval:parseInt(this.$target[0].dataset.carouselInterval),rowPerSlide:parseInt(config.device.isMobile?1:this.$target[0].dataset.rowPerSlide||1),arrowPosition:this.$target[0].dataset.arrowPosition||'',},);},});publicWidget.registry.dynamic_snippet_carousel=DynamicSnippetCarousel;return DynamicSnippetCarousel;});; 10047 10048/* /website/static/src/snippets/s_website_form/000.js */ 10049odoo.define('website.s_website_form',function(require){'use strict';var core=require('web.core');var time=require('web.time');const{ReCaptcha}=require('google_recaptcha.ReCaptchaV3');const session=require('web.session');var ajax=require('web.ajax');var publicWidget=require('web.public.widget');const dom=require('web.dom');const concurrency=require('web.concurrency');const wUtils=require('website.utils');var _t=core._t;var qweb=core.qweb;publicWidget.registry.EditModeWebsiteForm=publicWidget.Widget.extend({selector:'.s_website_form form, form.s_website_form',disabledInEditableMode:false,start:function(){if(this.editableMode){const dateTimeFormat=time.getLangDatetimeFormat();const dateFormat=time.getLangDateFormat();this.$target[0].querySelectorAll('.s_website_form_input.datetimepicker-input').forEach(el=>{const value=el.getAttribute('value');if(value){const format=el.closest('.s_website_form_field').dataset.type==='date'?dateFormat:dateTimeFormat;el.value=moment.unix(value).format(format);}});} 10050return this._super(...arguments);},_getDataForFields(){if(!this.dataForValues){return[];} 10051return Object.keys(this.dataForValues).map(name=>this.$target[0].querySelector(`[name="${CSS.escape(name)}"]`)).filter(dataForValuesFieldEl=>dataForValuesFieldEl&&dataForValuesFieldEl.name!=="email_to");}});publicWidget.registry.s_website_form=publicWidget.Widget.extend({selector:'.s_website_form form, form.s_website_form',events:{'click .s_website_form_send, .o_website_form_send':'send','submit':'send',},init:function(){this._super(...arguments);this._recaptcha=new ReCaptcha();this.initialValues=new Map();this._visibilityFunctionByFieldName=new Map();this._visibilityFunctionByFieldEl=new Map();this.__started=new Promise(resolve=>this.__startResolve=resolve);},willStart:async function(){const res=this._super(...arguments);if(!this.$target[0].classList.contains('s_website_form_no_recaptcha')){this._recaptchaLoaded=true;this._recaptcha.loadLibs();} 10052this.preFillValues={};if(session.user_id){this.preFillValues=(await this._rpc({model:'res.users',method:'read',args:[session.user_id,this._getUserPreFillFields()],}))[0]||{};} 10053return res;},start:function(){this.$target[0].reset();const visibilityFunctionsByFieldName=new Map();for(const fieldEl of this.$target[0].querySelectorAll('[data-visibility-dependency]')){const inputName=fieldEl.querySelector('.s_website_form_input').name;if(!visibilityFunctionsByFieldName.has(inputName)){visibilityFunctionsByFieldName.set(inputName,[]);} 10054const func=this._buildVisibilityFunction(fieldEl);visibilityFunctionsByFieldName.get(inputName).push(func);this._visibilityFunctionByFieldEl.set(fieldEl,func);} 10055for(const[name,funcs]of visibilityFunctionsByFieldName.entries()){this._visibilityFunctionByFieldName.set(name,()=>funcs.some(func=>func()));} 10056this._onFieldInputDebounced=_.debounce(this._onFieldInput.bind(this),400);this.$el.on('input.s_website_form','.s_website_form_field',this._onFieldInputDebounced);var datepickers_options={minDate:moment({y:1000}),maxDate:moment({y:9999,M:11,d:31}),calendarWeeks:true,icons:{time:'fa fa-clock-o',date:'fa fa-calendar',next:'fa fa-chevron-right',previous:'fa fa-chevron-left',up:'fa fa-chevron-up',down:'fa fa-chevron-down',},locale:moment.locale(),format:time.getLangDatetimeFormat(),extraFormats:['X'],};const $datetimes=this.$target.find('.s_website_form_datetime, .o_website_form_datetime');$datetimes.datetimepicker(datepickers_options);datepickers_options.format=time.getLangDateFormat();const $dates=this.$target.find('.s_website_form_date, .o_website_form_date');$dates.datetimepicker(datepickers_options);this.$allDates=$datetimes.add($dates);this.$allDates.addClass('s_website_form_datepicker_initialized');let dataForValues=wUtils.getParsedDataFor(this.$target[0].id,document);this.editTranslations=!!this._getContext(true).edit_translations;if(!this.editTranslations&&(dataForValues||Object.keys(this.preFillValues).length)){dataForValues=dataForValues||{};const fieldNames=this.$target.serializeArray().map(el=>el.name);for(const name of fieldNames){const fieldEl=this.$target[0].querySelector(`[name="${CSS.escape(name)}"]`);if(name==='email_to'&&fieldEl.value&&fieldEl.value!=='[email protected]'){continue;} 10057let newValue;if(dataForValues&&dataForValues[name]){newValue=dataForValues[name];}
10057else if(this.preFillValues[fieldEl.dataset.fillWith]){newValue=this.preFillValues[fieldEl.dataset.fillWith];} 10058if(newValue){this.initialValues.set(fieldEl,fieldEl.getAttribute('value'));fieldEl.value=newValue;}}} 10059this._updateFieldsVisibility();if(session.geoip_phone_code){this.el.querySelectorAll('input[type="tel"]').forEach(telField=>{if(!telField.value){telField.value='+'+session.geoip_phone_code;}});} 10060this.inputEls=this.$target[0].querySelectorAll('.s_website_form_field.s_website_form_field_hidden_if .s_website_form_input');this._disabledStates=new Map();for(const inputEl of this.inputEls){this._disabledStates[inputEl]=inputEl.disabled;} 10061return this._super(...arguments).then(()=>this.__startResolve());},destroy:function(){this._super.apply(this,arguments);this.$target.find('button').off('click');this.$target[0].reset();const dateTimeFormat=time.getLangDatetimeFormat();const dateFormat=time.getLangDateFormat();this.$target[0].querySelectorAll('input[type="text"], input[type="email"], input[type="number"]').forEach(el=>{let value=el.getAttribute('value');if(value){if(el.classList.contains('datetimepicker-input')){const format=el.closest('.s_website_form_field').dataset.type==='date'?dateFormat:dateTimeFormat;value=moment.unix(value).format(format);} 10062el.value=value;}});this.$target[0].querySelectorAll('textarea').forEach(el=>el.value=el.textContent);this.$target.find('.o_has_error').removeClass('o_has_error').find('.form-control, .form-select').removeClass('is-invalid');this.$target.find('#s_website_form_result, #o_website_form_result').empty();this.$target.removeClass('d-none');this.$target.parent().find('.s_website_form_end_message').addClass('d-none');this.$allDates.removeClass('s_website_form_datepicker_initialized');for(const inputEl of this.inputEls){inputEl.disabled=!!this._disabledStates.get(inputEl);} 10063this.$target[0].querySelectorAll('.s_website_form_field_hidden_if:not(.d-none)').forEach(el=>el.classList.add('d-none'));const dataForValues=wUtils.getParsedDataFor(this.$target[0].id,document)||{};const initialValuesToReset=new Map([...this.initialValues.entries()].filter(([input])=>!dataForValues[input.name]||input.name==="email_to"));for(const[fieldEl,initialValue]of initialValuesToReset.entries()){if(initialValue){fieldEl.setAttribute('value',initialValue);}else{fieldEl.removeAttribute('value');}} 10064this.$el.off('.s_website_form');},send:async function(e){e.preventDefault();const $button=this.$target.find('.s_website_form_send, .o_website_form_send');$button.addClass('disabled').attr('disabled','disabled');this.restoreBtnLoading=dom.addButtonLoadingEffect($button[0]);var self=this;self.$target.find('#s_website_form_result, #o_website_form_result').empty();if(!self.check_error_fields({})){self.update_status('error',_t("Please fill in the form correctly."));return false;} 10065this.form_fields=this.$target.serializeArray();$.each(this.$target.find('input[type=file]:not([disabled])'),(outer_index,input)=>{$.each($(input).prop('files'),function(index,file){self.form_fields.push({name:input.name+'['+outer_index+']['+index+']',value:file});});});var form_values={};_.each(this.form_fields,function(input){if(input.name in form_values){if(Array.isArray(form_values[input.name])){form_values[input.name].push(input.value);}else{form_values[input.name]=[form_values[input.name],input.value];}}else{if(input.value!==''){form_values[input.name]=input.value;}}});this.$target.find('.s_website_form_field:not(.s_website_form_custom)').find('.s_website_form_date, .s_website_form_datetime').each(function(){const inputEl=this.querySelector('input');if(!inputEl.value){return;} 10066var date=$(this).datetimepicker('viewDate').clone().locale('en');var format='YYYY-MM-DD';if($(this).hasClass('s_website_form_datetime')){date=date.utc();format='YYYY-MM-DD HH:mm:ss';} 10067form_values[inputEl.getAttribute('name')]=date.format(format);});if(this._recaptchaLoaded){const tokenObj=await this._recaptcha.getToken('website_form');if(tokenObj.token){form_values['recaptcha_token_response']=tokenObj.token;}else if(tokenObj.error){self.update_status('error',tokenObj.error);return false;}} 10068ajax.post(this.$target.attr('action')+(this.$target.data('force_action')||this.$target.data('model_name')),form_values).then(async function(result_data){self.$target.find('.s_website_form_send, .o_website_form_send').removeAttr('disabled').removeClass('disabled');result_data=JSON.parse(result_data);if(!result_data.id){self.update_status('error',result_data.error?result_data.error:false);
10068if(result_data.error_fields){self.check_error_fields(result_data.error_fields);}}else{let successMode=self.$target[0].dataset.successMode;let successPage=self.$target[0].dataset.successPage;if(!successMode){successPage=self.$target.attr('data-success_page');successMode=successPage?'redirect':'nothing';} 10069switch(successMode){case'redirect':{let hashIndex=successPage.indexOf("#");if(hashIndex>0){let currentUrlPath=window.location.pathname;if(!currentUrlPath.endsWith("/")){currentUrlPath=currentUrlPath+"/";} 10070if(!successPage.includes("/#")){successPage=successPage.replace("#","/#");hashIndex++;} 10071if([successPage,"/"+session.lang_url_code+successPage].some(link=>link.startsWith(currentUrlPath+'#'))){successPage=successPage.substring(hashIndex);}} 10072if(successPage.charAt(0)==="#"){const successAnchorEl=document.getElementById(successPage.substring(1));if(successAnchorEl){await dom.scrollTo(successAnchorEl,{duration:500,extraOffset:0,});} 10073break;} 10074$(window.location).attr('href',successPage);return;} 10075case'message':{await concurrency.delay(dom.DEBOUNCE);self.$target[0].classList.add('d-none');self.$target[0].parentElement.querySelector('.s_website_form_end_message').classList.remove('d-none');break;} 10076default:{await concurrency.delay(dom.DEBOUNCE);self.update_status('success');break;}} 10077self.$target[0].reset();self.restoreBtnLoading();}}).guardedCatch(error=>
10077{this.update_status('error',error.status&&error.status===413?_t("Uploaded file is too large."):"",);});},check_error_fields:function(error_fields){var self=this;var form_valid=true;this.$target.find('.form-field, .s_website_form_field').each(function(k,field){var $field=$(field);var field_name=$field.find('.col-form-label').attr('for');var inputs=$field.find('.s_website_form_input, .o_website_form_input').not('#editable_select');var invalid_inputs=inputs.toArray().filter(function(input,k,inputs){if(input.required&&input.type==='checkbox'){var checkboxes=_.filter(inputs,function(input){return input.required&&input.type==='checkbox';});return!_.any(checkboxes,checkbox=>checkbox.checkValidity());}else if($(input).hasClass('s_website_form_date')||$(input).hasClass('o_website_form_date')){if(!self.is_datetime_valid(input.value,'date')){return true;}}else if($(input).hasClass('s_website_form_datetime')||$(input).hasClass('o_website_form_datetime')){if(!self.is_datetime_valid(input.value,'datetime')){return true;}} 10078return!input.checkValidity();});const $controls=$field.find('.form-control, .form-select, .form-check-input, .form-control-file');$field.removeClass('o_has_error');$controls.removeClass('is-invalid');if(invalid_inputs.length||error_fields[field_name]){$field.addClass('o_has_error');$controls.addClass('is-invalid');if(_.isString(error_fields[field_name])){$field.popover({content:error_fields[field_name],trigger:'hover',container:'body',placement:'top'});const popover=Popover.getInstance($field);popover._config.content=error_fields[field_name];$field.popover('show');} 10079form_valid=false;}});return form_valid;},is_datetime_valid:function(value,type_of_date){if(value===""){return true;}else{try{this.parse_date(value,type_of_date);return true;}catch(_e){return false;}}},parse_date:function(value,type_of_date,value_if_empty){var date_pattern=time.getLangDateFormat(),time_pattern=time.getLangTimeFormat();var date_pattern_wo_zero=date_pattern.replace('MM','M').replace('DD','D'),time_pattern_wo_zero=time_pattern.replace('HH','H').replace('mm','m').replace('ss','s');switch(type_of_date){case'datetime':var datetime=moment(value,[date_pattern+' '+time_pattern,date_pattern_wo_zero+' '+time_pattern_wo_zero],true);if(datetime.isValid()){return time.datetime_to_str(datetime.toDate());} 10080throw new Error(_.str.sprintf(_t("'%s' is not a correct datetime"),value));case'date':var date=moment(value,[date_pattern,date_pattern_wo_zero],true);if(date.isValid()){return time.date_to_str(date.toDate());} 10081throw new Error(_.str.sprintf(_t("'%s' is not a correct date"),value));} 10082return value;},update_status:function(status,message){if(status!=='success'){this.$target.find('.s_website_form_send, .o_website_form_send').removeAttr('disabled').removeClass('disabled');this.restoreBtnLoading();} 10083var $result=this.$('#s_website_form_result, #o_website_form_result');if(status==='error'&&!message){message=_t("An error has occured, the form has not been sent.");} 10084this.__started.then(()=>$result.replaceWith(qweb.render(`website.s_website_form_status_${status}`,{message:message,})));},_getUserPreFillFields(){return['name','phone','email','commercial_company_name'];},_compareTo(comparator,value='',comparable,between){if(value===null){value='';} 10085switch(comparator){case'contains':return value.includes(comparable);case'!contains':return!value.includes(comparable);case'equal':case'selected':return value===comparable;case'!equal':case'!selected':return value!==comparable;case'set':return value;case'!set':return!value;case'greater':return parseFloat(value)>parseFloat(comparable);case'less':return parseFloat(value)<parseFloat(comparable);case'greater or equal':return parseFloat(value)>=parseFloat(comparable);case'less or equal':return parseFloat(value)<=parseFloat(comparable);case'fileSet':return value.name!=='';case'!fileSet':return value.name==='';} 10086if(value.includes(':')){const datetimeFormat=time.getLangDatetimeFormat();value=moment(value,datetimeFormat)._d.getTime()/1000;}else{const dateFormat=time.getLangDateFormat();value=moment(value,dateFormat)._d.getTime()/1000;} 10087comparable=parseInt(comparable);between=parseInt(between)||'';switch(comparator){case'dateEqual':return value===comparable;case'date!equal':return value!==comparable;case'before':return value<comparable;case'after':return value>comparable;case'equal or before':return value<=comparable;case'between':return value>=comparable&&value<=between;case'!between':return!(value>=comparable&&value<=between);case'equal or after':return value>=comparable;}},_buildVisibilityFunction(fieldEl){const visibilityCondition=fieldEl.dataset.visibilityCondition;const dependencyName=fieldEl.dataset.visibilityDependency;const comparator=fieldEl.dataset.visibilityComparator;const between=fieldEl.dataset.visibilityBetween;return()=>{const dependencyVisibilityFunction=this._visibilityFunctionByFieldName.get(dependencyName);const dependencyIsVisible=!dependencyVisibilityFunction||dependencyVisibilityFunction();if(!dependencyIsVisible){return false;} 10088const formData=new FormData(this.$target[0]);const currentValueOfDependency=["contains","!contains"].includes(comparator)?formData.getAll(dependencyName).join():formData.get(dependencyName);return this._compareTo(comparator,currentValueOfDependency,visibilityCondition,between);};},_updateFieldsVisibility(){let anyFieldVisibilityUpdated=false;for(const[fieldEl,visibilityFunction]of this._visibilityFunctionByFieldEl.entries()){const wasVisible=!fieldEl.closest(".s_website_form_field").classList.contains("d-none");const isVisible=!!visibilityFunction();this._updateFieldVisibility(fieldEl,isVisible);anyFieldVisibilityUpdated|=wasVisible!==isVisible;} 10089if(anyFieldVisibilityUpdated){this._updateFieldsVisibility();}},_updateFieldVisibility(fieldEl,haveToBeVisible){const fieldContainerEl=fieldEl.closest('.s_website_form_field');fieldContainerEl.classList.toggle('d-none',!haveToBeVisible);if(!fieldContainerEl.matches(".s_website_form_model_required")){for(const inputEl of fieldContainerEl.querySelectorAll(".s_website_form_input")){inputEl.disabled=!haveToBeVisible;}}},_onFieldInput(){this._updateFieldsVisibility();},});});; 10090 10091/* /website/static/src/snippets/s_searchbar/000.js */ 10092odoo.define('@website/snippets/s_searchbar/000',async function(require){'use strict';let __exports={};const concurrency=require('web.concurrency');const publicWidget=require('web.public.widget');const{qweb}=require('web.core');const{Markup}=require('web.utils');publicWidget.registry.searchBar=publicWidget.Widget.extend({selector:'.o_searchbar_form',events:{'input .search-query':'_onInput','focusout':'_onFocusOut','keydown .search-query, .dropdown-item':'_onKeydown','search .search-query':'_onSearch',},autocompleteMinWidth:300,init:function(){this._super.apply(this,arguments);this._dp=new concurrency.DropPrevious();this._onInput=_.debounce(this._onInput,400);this._onFocusOut=_.debounce(this._onFocusOut,100);}
10092,start:function(){this.$input=this.$('.search-query');this.searchType=this.$input.data('searchType');this.order=this.$('.o_search_order_by').val();this.limit=parseInt(this.$input.data('limit'));this.displayDescription=this.$input.data('displayDescription');this.displayExtraLink=this.$input.data('displayExtraLink');this.displayDetail=this.$input.data('displayDetail');this.displayImage=this.$input.data('displayImage');this.wasEmpty=!this.$input.val();this.allowFuzzy=!this.$input.data('noFuzzy');if(this.limit){this.$input.attr('autocomplete','off');} 10093this.options={'displayImage':this.displayImage,'displayDescription':this.displayDescription,'displayExtraLink':this.displayExtraLink,'displayDetail':this.displayDetail,'allowFuzzy':this.allowFuzzy,};const form=this.$('.o_search_order_by').parents('form');for(const field of form.find("input[type='hidden']")){this.options[field.name]=field.value;} 10094const action=form.attr('action')||window.location.pathname+window.location.search;const[urlPath,urlParams]=action.split('?');if(urlParams){for(const keyValue of urlParams.split('&')){const[key,value]=keyValue.split('=');if(value&&key!=='search'){this.options[decodeURIComponent(key.replace(/\+/g,'%20'))]=decodeURIComponent(value.replace(/\+/g,'%20'));}}} 10095const pathParts=urlPath.split('/');for(const index in pathParts){const value=decodeURIComponent(pathParts[index]);if(index>0&&/-[0-9]+$/.test(value)){this.options[decodeURIComponent(pathParts[index-1])]=value;}} 10096if(this.$input.data('noFuzzy')){$("<input type='hidden' name='noFuzzy' value='true'/>").appendTo(this.$input);} 10097return this._super.apply(this,arguments);},destroy(){this._super(...arguments);this._render(null);},_adaptToScrollingParent(){const bcr=this.el.getBoundingClientRect();this.$menu[0].style.setProperty('position','fixed','important');this.$menu[0].style.setProperty('top',`${bcr.bottom}px`,'important');this.$menu[0].style.setProperty('left',`${bcr.left}px`,'important');this.$menu[0].style.setProperty('max-width',`${bcr.width}px`,'important');this.$menu[0].style.setProperty('max-height',`${document.body.clientHeight - bcr.bottom - 16}px`,'important');},async _fetch(){const res=await this._rpc({route:'/website/snippet/autocomplete',params:{'search_type':this.searchType,'term':this.$input.val(),'order':this.order,'limit':this.limit,'max_nb_chars':Math.round(Math.max(this.autocompleteMinWidth,parseInt(this.$el.width()))*0.22),'options':this.options,},});const fieldNames=['name','description','extra_link','detail','detail_strike','detail_extra',];res.results.forEach(record=>{for(const fieldName of fieldNames){if(record[fieldName]){record[fieldName]=Markup(record[fieldName]);}}});return res;},_render:function(res){if(this._scrollingParentEl){this._scrollingParentEl.removeEventListener('scroll',this._menuScrollAndResizeHandler);window.removeEventListener('resize',this._menuScrollAndResizeHandler);delete this._scrollingParentEl;delete this._menuScrollAndResizeHandler;} 10098let pageScrollHeight=null;const $prevMenu=this.$menu;if(res&&this.limit){const results=res['results'];let template='website.s_searchbar.autocomplete';const candidate=template+'.'+this.searchType;if(qweb.has_template(candidate)){template=candidate;} 10099this.$menu=$(qweb.render(template,{results:results,parts:res['parts'],hasMoreResults:results.length<res['results_count'],search:this.$input.val(),fuzzySearch:res['fuzzy_search'],widget:this,}));this.$menu.css('min-width',this.autocompleteMinWidth);const megaMenuEl=this.el.closest('.o_mega_menu');if(megaMenuEl){const navbarEl=this.el.closest('.navbar');const navbarTogglerEl=navbarEl?navbarEl.querySelector('.navbar-toggler'):null;if(navbarTogglerEl&&navbarTogglerEl.clientWidth<1){this._scrollingParentEl=megaMenuEl;this._menuScrollAndResizeHandler=()=>this._adaptToScrollingParent();this._scrollingParentEl.addEventListener('scroll',this._menuScrollAndResizeHandler);window.addEventListener('resize',this._menuScrollAndResizeHandler);this._adaptToScrollingParent();}} 10100pageScrollHeight=document.querySelector("#wrapwrap").scrollHeight;this.$el.append(this.$menu);this.$el.find('button.extra_link').on('click',function(event){event.preventDefault();window.location.href=event.currentTarget.dataset['target'];});this.$el.find('.s_searchbar_fuzzy_submit').on('click',(event)=>{event.preventDefault();this.$input.val(res['fuzzy_search']);const form=this.$('.o_search_order_by').parents('form');form.submit();});} 10101this.$el.toggleClass('dropdown show',!!res);if($prevMenu){$prevMenu.remove();} 10102if(res&&this.limit){this.el.classList.remove("dropup");delete this.$menu[0].dataset.bsPopper;const wrapwrapEl=document.querySelector("#wrapwrap");if(wrapwrapEl.scrollHeight>pageScrollHeight){this.$menu[0].style.maxHeight="40vh";this.$menu[0].style.overflowY="auto";if(wrapwrapEl.scrollHeight>pageScrollHeight){this.el.classList.add("dropup");this.$menu[0].dataset.bsPopper="";}}}},_onInput:function(){if(!this.limit){return;} 10103if(this.searchType==='all'&&!this.$input.val().trim().length){this._render();}else{this._dp.add(this._fetch()).then(this._render.bind(this));}},_onFocusOut:function(){if(!this.$el.has(document.activeElement).length){this._render();}},_onKeydown:function(ev){switch(ev.which){case $.ui.keyCode.ESCAPE:this._render();break;case $.ui.keyCode.UP:case $.ui.keyCode.DOWN:ev.preventDefault();if(this.$menu){const focusableEls=[this.$input[0],...this.$menu[0].children];const focusedEl=document.activeElement;const currentIndex=focusableEls.indexOf(focusedEl)||0;const delta=ev.which===$.ui.keyCode.UP?focusableEls.length-1:1;const nextIndex=(currentIndex+delta)%focusableEls.length;const nextFocusedEl=focusableEls[nextIndex];nextFocusedEl.focus();} 10104break;case $.ui.keyCode.ENTER:this.limit=0;break;}},_onSearch:function(ev){if(this.$input[0].value){this.limit=0;}else{this._render();ev.preventDefault();if(!this.wasEmpty){this.limit=0;const form=this.$('.o_search_order_by').parents('form');form.submit();}}},});__exports[Symbol.for("default")]={searchBar:publicWidget.registry.searchBar,};return __exports;});; 10105 10106/* /website_mass_mailing/static/src/snippets/s_popup/000.js */ 10107odoo.define('@website_mass_mailing/snippets/s_popup/000',async function(require){'use strict';let __exports={};const PopupWidget=require('website.s_popup');PopupWidget.include({_canShowPopup(){if(this.$el.is('.o_newsletter_popup')&&this.$el.find('input.js_subscribe_value, input.js_subscribe_email').prop('disabled')){return false;} 10108return this._super(...arguments);},});__exports[Symbol.for("default")]=PopupWidget;return __exports;});; 10109 10110/* /website_blog/static/src/snippets/s_blog_posts/000.js */ 10111odoo.define('website_blog.s_blog_posts_frontend',function(require){'use strict';var publicWidget=require('web.public.widget');
10111const DynamicSnippet=require('website.s_dynamic_snippet');const DynamicSnippetBlogPosts=DynamicSnippet.extend({selector:'.s_dynamic_snippet_blog_posts',disabledInEditableMode:false,_getSearchDomain:function(){const searchDomain=this._super.apply(this,arguments);const filterByBlogId=parseInt(this.$el.get(0).dataset.filterByBlogId);if(filterByBlogId>=0){searchDomain.push(['blog_id','=',filterByBlogId]);} 10112return searchDomain;},});publicWidget.registry.blog_posts=DynamicSnippetBlogPosts;return DynamicSnippetBlogPosts;});; 10113 10114/* /website_payment/static/src/snippets/s_donation/000.js */ 10115odoo.define('@website_payment/snippets/s_donation/000',async function(require){'use strict';let __exports={};const{_t}=require('web.core');const publicWidget=require('web.public.widget');const CUSTOM_BUTTON_EXTRA_WIDTH=10;publicWidget.registry.DonationSnippet=publicWidget.Widget.extend({selector:'.s_donation',disabledInEditableMode:false,events:{'click .s_donation_btn':'_onClickPrefilledButton','click .s_donation_donate_btn':'_onClickDonateNowButton','input #s_donation_range_slider':'_onInputRangeSlider',},async start(){await this._super(...arguments);this.$rangeSlider=this.$('#s_donation_range_slider');this.defaultAmount=this.$target[0].dataset.defaultAmount;if(this.$rangeSlider.length){this.$rangeSlider.val(this.defaultAmount);this._setBubble(this.$rangeSlider);} 10116await this._displayCurrencies();const customButtonEl=this.el.querySelector("#s_donation_amount_input");if(customButtonEl){const canvasEl=document.createElement("canvas");const context=canvasEl.getContext("2d");context.font=window.getComputedStyle(customButtonEl).font;const width=context.measureText(customButtonEl.placeholder).width;customButtonEl.style.maxWidth=`${Math.ceil(width) + CUSTOM_BUTTON_EXTRA_WIDTH}px`;}},destroy(){const customButtonEl=this.el.querySelector("#s_donation_amount_input");if(customButtonEl){customButtonEl.style.maxWidth="";} 10117this.$target.find('.s_donation_currency').remove();this._deselectPrefilledButtons();this.$('.alert-danger').remove();this._super(...arguments);},_deselectPrefilledButtons(){this.$('.s_donation_btn').removeClass('active');},_setBubble($range){const $bubble=this.$('.s_range_bubble');const val=$range.val();const min=$range[0].min||0;const max=$range[0].max||100;const newVal=Number(((val-min)*100)/(max-min));const tipOffsetLow=8-(newVal*0.16);$bubble.contents().filter(function(){return this.nodeType===3;}).replaceWith(val);$bubble[0].style.insetInlineStart=`calc(${newVal}% + (${tipOffsetLow}px))`;},_displayCurrencies(){return this._rpc({route:'/website/get_current_currency',}).then((result)=>{this.currency=result;this.$('.s_donation_currency').remove();const $prefilledButtons=this.$('.s_donation_btn, .s_range_bubble');_.each($prefilledButtons,button=>{const before=result.position==="before";const $currencySymbol=document.createElement('span');$currencySymbol.innerText=result.symbol;$currencySymbol.classList.add('s_donation_currency',before?"pe-1":"ps-1");if(before){$(button).prepend($currencySymbol);}else{$(button).append($currencySymbol);}});});},_onClickPrefilledButton(ev){const $button=$(ev.currentTarget);this._deselectPrefilledButtons();$button.addClass('active');if(this.$rangeSlider.length){this.$rangeSlider.val($button[0].dataset.donationValue);this._setBubble(this.$rangeSlider);}},_onClickDonateNowButton(ev){if(this.editableMode){return;};this.$('.alert-danger').remove();const $buttons=this.$('.s_donation_btn');const $selectedButton=$buttons.filter('.active');let amount=$selectedButton.length?$selectedButton[0].dataset.donationValue:0;if(this.$target[0].dataset.displayOptions&&!amount){if(this.$rangeSlider.length){amount=this.$rangeSlider.val();}else if($buttons.length){amount=parseFloat(this.$('#s_donation_amount_input').val());let errorMessage='';const minAmount=this.$target[0].dataset.minimumAmount;if(!amount){errorMessage=_t("Please select or enter an amount");}else if(amount<parseFloat(minAmount)){const before=this.currency.position==="before"?this.currency.symbol:"";const after=this.currency.position==="after"?this.currency.symbol:"";errorMessage=_.str.sprintf(_t("The minimum donation amount is %s%s%s"),before,minAmount,after);} 10118if(errorMessage){$(ev.currentTarget).before($('<p>',{class:'alert alert-danger',text:errorMessage,}));return;}}} 10119if(!amount){amount=this.defaultAmount;} 10120const $form=this.$('.s_donation_form');$('<input>').attr({type:'hidden',name:'amount',value:amount}).appendTo($form);$('<input>').attr({type:'hidden',name:'currency_id',value:this.currency.id}).appendTo($form);$('<input>').attr({type:'hidden',name:'csrf_token',value:odoo.csrf_token}).appendTo($form);$('<input>').attr({type:'hidden',name:'donation_options',value:JSON.stringify(this.el.dataset)}).appendTo($form);$form.submit();},_onInputRangeSlider(ev){this._deselectPrefilledButtons();this._setBubble($(ev.currentTarget));},});__exports[Symbol.for("default")]={DonationSnippet:publicWidget.registry.DonationSnippet,};return __exports;});; 10121
10122/* /website_sale/static/src/snippets/s_dynamic_snippet_products/000.js */ 10123odoo.define('website_sale.s_dynamic_snippet_products',function(require){'use strict';const publicWidget=require('web.public.widget');const DynamicSnippetCarousel=require('website.s_dynamic_snippet_carousel');var wSaleUtils=require('website_sale.utils');const DynamicSnippetProducts=DynamicSnippetCarousel.extend({selector:'.s_dynamic_snippet_products',_getCategorySearchDomain(){const searchDomain=[];let productCategoryId=this.$el.get(0).dataset.productCategoryId;if(productCategoryId&&productCategoryId!=='all'){if(productCategoryId==='current'){productCategoryId=undefined;const productCategoryField=$("#product_details").find(".product_category_id");if(productCategoryField&&productCategoryField.length){productCategoryId=parseInt(productCategoryField[0].value);} 10124if(!productCategoryId){this.trigger_up('main_object_request',{callback:function(value){if(value.model==="product.public.category"){productCategoryId=value.id;}},});} 10125if(!productCategoryId){const productTemplateId=$("#product_details").find(".product_template_id");if(productTemplateId&&productTemplateId.length){searchDomain.push(['public_categ_ids.product_tmpl_ids','=',parseInt(productTemplateId[0].value)]);}}} 10126if(productCategoryId){searchDomain.push(['public_categ_ids','child_of',parseInt(productCategoryId)]);}} 10127return searchDomain;},_getTagSearchDomain(){const searchDomain=[];let productTagIds=this.$el.get(0).dataset.productTagIds;productTagIds=productTagIds?JSON.parse(productTagIds):[];if(productTagIds.length){searchDomain.push(['all_product_tag_ids','in',productTagIds.map(productTag=>productTag.id)]);} 10128return searchDomain;},_getSearchDomain:function(){const searchDomain=this._super.apply(this,arguments);searchDomain.push(...this._getCategorySearchDomain());searchDomain.push(...this._getTagSearchDomain());const productNames=this.$el.get(0).dataset.productNames;if(productNames){const nameDomain=[];for(const productName of productNames.split(',')){if(!productName.length){continue;} 10129if(nameDomain.length){nameDomain.unshift('|');} 10130nameDomain.push(...['|','|',['name','ilike',productName],['default_code','=',productName],['barcode','=',productName],]);} 10131searchDomain.push(...nameDomain);} 10132return searchDomain;},_getRpcParameters:function(){const productTemplateId=$("#product_details").find(".product_template_id");return Object.assign(this._super.apply(this,arguments),{productTemplateId:productTemplateId&&productTemplateId.length?productTemplateId[0].value:undefined,});},});const DynamicSnippetProductsCard=publicWidget.Widget.extend({selector:'.o_carousel_product_card',read_events:{'click .js_add_cart':'_onClickAddToCart','click .js_remove':'_onRemoveFromRecentlyViewed',},init(root,options){const parent=options.parent||root;this._super(parent,options);},start(){this.add2cartRerender=this.el.dataset.add2cartRerender==='True';},async _onClickAddToCart(ev){const $card=$(ev.currentTarget).closest('.card');const data=await this._rpc({route:"/shop/cart/update_json",params:{product_id:$card.find('input[data-product-id]').data('product-id'),add_qty:1},});const $navButton=$('header .o_wsale_my_cart').first();await wSaleUtils.animateClone($navButton,$(ev.currentTarget).parents('.card'),25,40);wSaleUtils.updateCartNavBar(data);if(this.add2cartRerender){this.trigger_up('widgets_start_request',{$target:this.$el.closest('.s_dynamic'),});}},async _onRemoveFromRecentlyViewed(ev){const $card=$(ev.currentTarget).closest('.card');await this._rpc({route:"/shop/products/recently_viewed_delete",params:{product_id:$card.find('input[data-product-id]').data('product-id'),},});this.trigger_up('widgets_start_request',{$target:this.$el.closest('.s_dynamic'),});},});publicWidget.registry.dynamic_snippet_products_cta=DynamicSnippetProductsCard;publicWidget.registry.dynamic_snippet_products=DynamicSnippetProducts;return DynamicSnippetProducts;});; 10133 10134/* /website/static/src/snippets/s_map/000.js */ 10135odoo.define('@website/snippets/s_map/000',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');const{generateGMapLink,generateGMapIframe}=require('website.utils');publicWidget.registry.Map=publicWidget.Widget.extend({selector:'.s_map',start(){if
10135(!this.el.querySelector('.s_map_embedded')){const dataset=this.el.dataset;if(dataset.mapAddress){const iframeEl=generateGMapIframe();iframeEl.setAttribute('src',generateGMapLink(dataset));this.el.querySelector('.s_map_color_filter').before(iframeEl);}} 10136return this._super(...arguments);},});__exports[Symbol.for("default")]=publicWidget.registry.Map;return __exports;});; 10137 10138/* /website_event/static/src/snippets/s_events/000.js */ 10139odoo.define('@website_event/snippets/s_events/000',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');const DynamicSnippet=require('website.s_dynamic_snippet');const DynamicSnippetEvents=DynamicSnippet.extend({selector:'.s_event_upcoming_snippet',disabledInEditableMode:false,_getSearchDomain:function(){const searchDomain=this._super.apply(this,arguments);const filterByTagIds=JSON.parse(this.$el.get(0).dataset.filterByTagIds||'[]');if(filterByTagIds.length>0){searchDomain.concat(Array(filterByTagIds.length-1).fill('&'));for(const tag of filterByTagIds){searchDomain.push(['tag_ids','in',tag]);}} 10140return searchDomain;}});publicWidget.registry.events=DynamicSnippetEvents;return __exports;});; 10141 10142/* /website_sale/static/src/snippets/s_add_to_cart/000.js */ 10143odoo.define('@website_sale/snippets/s_add_to_cart/000',async function(require){'use strict';let __exports={};const publicWidget=require('web.public.widget');const{cartHandlerMixin}=require('website_sale.utils');const{WebsiteSale}=require('website_sale.website_sale');const{_t}=require('web.core');publicWidget.registry.AddToCartSnippet=WebsiteSale.extend(cartHandlerMixin,{selector:'.s_add_to_cart_btn',events:{'click':'_onClickAddToCartButton',},_onClickAddToCartButton:async function(ev){const dataset=ev.currentTarget.dataset;const visitorChoice=dataset.visitorChoice==='true';const action=dataset.action;const productId=parseInt(dataset.productVariantId);if(!productId){return;} 10144if(visitorChoice){this._handleAdd($(ev.currentTarget.closest('div')));}else{const isAddToCartAllowed=await this._rpc({route:`/shop/product/is_add_to_cart_allowed`,params:{product_id:productId,},});if(!isAddToCartAllowed){this.displayNotification({title:'User Error',message:_t('This product does not exist therefore it cannot be added to cart.'),type:'warning'});return;} 10145this.isBuyNow=action==='buy_now';this.stayOnPageOption=!this.isBuyNow;this.addToCart({product_id:productId,add_qty:1});}},});__exports[Symbol.for("default")]=publicWidget.registry.AddToCartSnippet;return __exports;}); 10146 10147 /******************************************* 10148 * Templates * 10149 *******************************************/ 10150 10151 odoo.define('web.assets_frontend_lazy.bundle.xml', function(require){ 10152 'use strict'; 10153 const { loadXML } = require('@web/core/assets'); 10154 const templates = `<?xml version="1.0" encoding="UTF-8"?> 10155<templates xml:space="preserve"> 10156<t t-name="web.DialogWidget"> 10157 <div role="dialog" t-attf-class="modal o_legacy_dialog #{ technical ? ' o_technical_modal' : '' } #{ fullscreen ? ' o_modal_full': '' }" tabindex="-1" data-bs-backdrop="static" t-att-id="_.uniqueId('modal_')" aria-hidden="true"> 10158 <div class="modal-dialog"> 10159 <div class="modal-content"> 10160 <header t-if="renderHeader" class="modal-header"> 10161 <h4 class="modal-title"><t t-out="title"/><span class="o_subtitle text-muted small" t-out="subtitle"/></h4> 10162 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" tabindex="-1"/> 10163 </header> 10164 <main class="modal-body"/> 10165 <footer t-if="renderFooter" class="modal-footer justify-content-around justify-content-md-start flex-wrap gap-1"/> 10166 </div> 10167 </div> 10168 </div> 10169</t> 10170<div t-name="web.LegacyWarningDialog" class="o_dialog_warning" role="alert"> 10171 <p t-esc="widget.message" style="white-space: pre-wrap;"/> 10172</div> 10173 10174<t t-name="web.legacy.sign_svg_text" name="SVG Signature Text"> 10175 <svg t-att-width="width" t-att-height="height"> 10176 <defs> 10177 <style type="text/css"> 10178 @font-face { 10179 font-family: "font"; 10180 src: url(data:font/ttf;base64,<t t-esc="font"/>) format("woff"); 10181 font-weight: normal; 10182 font-style: normal; 10183 } 10184 </style> 10185 </defs> 10186 10187 <text t-esc="text" x="50%" t-att-y="height * 3 / 5" t-att-font-size="height * 3 / 5" t-att-textLength="width * 4 / 5 * (type === 'signature' ? Math.min(1, text.length / 7) : 1)" t
10187-att-lengthAdjust="'spacing' + (type === 'signature' ? 'AndGlyphs' : '')" t-attf-style="font-family:'font'; stroke: none; fill: {{color}};" text-anchor="middle"/> 10188 </svg> 10189 </t> 10190 10191 10192 <t t-name="web.sign_name_and_signature"> 10193 <div class="o_web_sign_name_and_signature"> 10194 <div class="o_web_sign_name_group"> 10195 <label class="col-form-label" t-att-for="'o_web_sign_name_input_' + widget.htmlId">Full Name</label> 10196 <input type="text" name="signer" t-att-id="'o_web_sign_name_input_' + widget.htmlId" class="o_web_sign_name_input form-control" t-att-value="widget.defaultName" placeholder="Type your name to sign" required=""/> 10197 </div> 10198 10199 10200 <div class="o_web_sign_signature_group position-relative mt-3 border" style="overflow: hidden;"> 10201 <div class="card-header"> 10202 <div class="row g-0 flex-nowrap"> 10203 <div class="col-auto"> 10204 <a role="button" href="#" t-attf-class="o_web_sign_auto_button me-2 btn btn-light {{ widget.signMode === 'auto' ? 'active': '' }}"> 10205 Auto 10206 </a> 10207 </div> 10208 <div class="col-auto"> 10209 <a role="button" href="#" t-attf-class="o_web_sign_draw_button me-2 btn btn-light {{ widget.signMode === 'draw' ? 'active': '' }}"> 10210 Draw 10211 </a> 10212 </div> 10213 <div class="col-auto"> 10214 <a role="button" href="#" t-attf-class="o_web_sign_load_button me-2 btn btn-light {{ widget.signMode === 'load' ? 'active': '' }}"> 10215 Load 10216 </a> 10217 </div> 10218 <div class="pushend col-auto ms-auto"/> 10219 <div t-attf-class="o_web_sign_draw_clear col-auto {{ widget.signMode !== 'draw' ? 'd-none' : '' }}"> 10220 <a role="button" href="#" class="btn btn-link fa fa-trash"/> 10221 </div> 10222 <div t-attf-class="o_web_sign_auto_select_style col-auto {{ widget.signMode !== 'auto' ? 'd-none' : '' }}"> 10223 <a role="button" href="#" class="btn btn-link fa fa-font"/> 10224 </div> 10225 <div t-attf-class="o_web_sign_load_file col-auto {{ widget.signMode !== 'load' ? 'd-none' : '' }}"> 10226 <button type="button" id="loadFileXml" onclick="document.getElementById('file').click();" class="btn btn-link fa fa-upload"/> 10227 <input type="file" role="button" id="file" name="files[]" class="d-none"/> 10228 </div> 10229 </div> 10230 </div> 10231 10232 <div class="o_web_sign_signature_container"> 10233 <div class="o_signature_stroke position-absolute"/> 10234 <div class="o_web_sign_signature p-0 bg-transparent position-relative"/> 10235 </div> 10236 10237 <div t-attf-class="o_web_sign_load_invalid card-footer d-none"> 10238 <div class="alert alert-danger mb-0" role="alert"> 10239 This file is invalid. Please select an image. 10240 </div> 10241 </div> 10242 </div> 10243 10244 <div class="o_web_sign_auto_font_selection card d-none h-100 flex-column"> 10245 <div class="card-header">Styles</div> 10246 <div class="o_web_sign_auto_font_list card-body text-center p-3 flex-grow-1"/> 10247 </div> 10248 </div> 10249 </t> 10250 <div t-name="web.signature_dialog"> 10251 <div class="o_web_sign_name_and_signature"/> 10252 10253 <div class="mt16 small">By clicking Adopt & Sign, I agree that the chosen signature/initials will be a valid electronic representation of my hand-written signature/initials for all purposes when it is used on documents, including legally binding contracts.</div> 10254 </div> 10255<t t-name="Colorpicker"> 10256 <div class="o_colorpicker_widget"> 10257 <div class="d-flex justify-content-between align-items-stretch mb-2"> 10258 <div class="o_color_pick_area position-relative w-75" t-att-style="widget.options.noTransparency ? 'width: 89%;' : None"> 10259 <div class="o_picker_pointer rounded-circle p-1 position-absolute" tabindex="-1"/> 10260 </div> 10261 <div class="o_color_slider position-relative"> 10262 <div class="o_slider_pointer" tabindex="-1"/> 10263 </div> 10264 <div class="o_opacity_slider position-relative" t-if="!widget.options.noTransparency"> 10265 <div class="o_opacity_pointer" tabindex="-1"/> 10266 </div> 10267 </div> 10268 <div t-if="widget.options.colorPreview" class="o_color_preview mb-1 w-100 p-2"/> 10269 <div class="o_color_picker_inputs d-flex justify-content-between mb-2"> 10270 <t t-set="input_classes" t-value="'p-0 border-0 text-center font-monospace bg-transparent'"/> 10271 10272 <div class="o_hex_div px-1 d-flex align-items-baseline"> 10273 <input type="text" t-attf-class="o_hex_input {{input_classes}}" data-color-method="hex" size="1"/> 10274 <label class="flex-grow-0 ms-1 mb-0">hex</label> 10275 </div> 10276 <div class="o_rgba_div px-1 d-flex align-items-baseline"> 10277 <input type="text" t-attf-class="o_red_input {{input_classes}}" data-color-method="rgb" size="1"/> 10278 <input type="text" t-attf-class="o_green_input {{input_classes}}" data-color-method="rgb" size="1"/> 10279 <input type="text" t-attf-class="o_blue_input me-0 {{input_classes}}" data-color-method="rgb" size="1"/> 10280 <t t-if="!widget.options.noTransparency"> 10281 <input type="text" t-attf-class="o_opacity_input {{input_classes}}" data-color-method="opacity" size="1"/> 10282 <label class="flex-grow-0 ms-1 mb-0"> 10283 RGBA 10284 </label> 10285 </t> 10286 <label t-else="" class="flex-grow-0 ms-1 mb-0"> 10287 RGB 10288 </label> 10289 </div> 10290 </div> 10291 </div> 10292</t> 10293<div t-name="web.TranslationDialogWidget" class="o_translation_dialog"> 10294 <div class="row" t-foreach="widget.data" t-as="term"> 10295 <div t-attf-class="col-12 #{widget.showSource ? 'col-lg-2' : 'col-lg-3'} #{widget.currentInterfaceLanguage == term.lang ? 'o_language_current' : ''}"> 10296 <t t-esc="term.langName"/> 10297 </div> 10298 <div t-if="widget.showSource" class="col-12 col-lg-3 source"> 10299 <t t-esc="term.source"/> 10300 </div> 10301 <div t-attf-class="col-12 #{widget.showSource ? 'col-lg-7' : 'col-lg-9'} translation"> 10302 <input t-if="!widget.isText" type="text" class="o_field_char o_input" t-att-value="term.value" t-att-data-id="term.id"/> 10303 10304 <textarea t-if="widget.isText" t-esc="term.value" t-att-data-id="term.id" t-att-rows="widget.showSource ? 2 : 5" class="o_field_text o_field_translate o_field_widget o_input"> 10305 </textarea> 10306 </div> 10307 </div> 10308 </div> 10309<t t-name="web.ActionSwiper" owl="1"> 10310 <t t-if="props.onRightSwipe || props.onLeftSwipe"> 10311 <div class="o_actionswiper" t-on-touchend="_onTouchEndSwipe" t-on-touchmove="_onTouchMoveSwipe" t-on-touchstart="_onTouchStartSwipe" t-ref="root"> 10312 <div class="o_actionswiper_overflow_container position-relative overflow-hidden"> 10313 <div class="o_actionswiper_target_container" t-ref="targetContainer" t-att-style="state.containerStyle" t-att-class="{ o_actionswiper_swiping: state.isSwiping }"> 10314 <t t-slot="default"/> 10315 <t t-if="localizedProps.onRightSwipe and (localizedProps.onRightSwipe.icon or localizedProps.onRightSwipe.bgColor)"> 10316 <div t-att-style="'max-width: ' + swipedDistance + 'px;'" class="o_actionswiper_right_swipe_area position-absolute overflow-hidden w-100 h-100 d-flex align-items-center justify-content-center rounded-end" t-att-class="localizedProps.onRightSwipe.bgColor">
10317 <span><i class="fa fa-2x" t-att-class="localizedProps.onRightSwipe.icon"/></span> 10318 </div> 10319 </t> 10320 <t t-if="localizedProps.onLeftSwipe and (localizedProps.onLeftSwipe.icon or localizedProps.onLeftSwipe.bgColor)"> 10321 <div t-att-style="'max-width: ' + -swipedDistance + 'px;'" class="o_actionswiper_left_swipe_area position-absolute overflow-hidden w-100 h-100 d-flex align-items-center justify-content-center rounded-start" t-att-class="localizedProps.onLeftSwipe.bgColor"> 10322 <span><i class="fa fa-2x" t-att-class="localizedProps.onLeftSwipe.icon"/></span> 10323 </div> 10324 </t> 10325 </div> 10326 </div> 10327 </div> 10328 </t> 10329 <t t-else=""> 10330 <t t-slot="default"/> 10331 </t> 10332 </t> 10333<t t-name="web.AutoComplete" owl="1"> 10334 <div class="o-autocomplete dropdown" t-ref="root"> 10335 <input type="text" t-att-id="props.id" class="o-autocomplete--input o_input" autocomplete="off" t-att-placeholder="props.placeholder" role="combobox" t-att-aria-activedescendant="activeSourceOptionId" t-att-aria-expanded="(isOpened and hasOptions) ? 'true' : 'false'" aria-autocomplete="list" aria-haspopup="listbox" t-model="state.value" t-on-blur="onInputBlur" t-on-click="onInputClick" t-on-change="onInputChange" t-on-input="onInput" t-on-keydown="onInputKeydown" t-ref="input"/> 10336 <t t-if="isOpened and hasOptions"> 10337 <ul role="listbox" class="o-autocomplete--dropdown-menu dropdown-menu ui-widget ui-autocomplete show" t-ref="sourcesList"> 10338 <t t-foreach="sources" t-as="source" t-key="source.id"> 10339 <t t-if="source.isLoading"> 10340 <li class="o-autocomplete--dropdown-item ui-menu-item"> 10341 <a t-attf-id="{{props.id or 'autocomplete'}}_{{source_index}}_loading" role="option" href="#" class="dropdown-item ui-menu-item-wrapper" aria-selected="true"> 10342 <i class="fa fa-spin fa-circle-o-notch"/>
10342 <t t-esc="source.placeholder"/> 10343 </a> 10344 </li> 10345 </t> 10346 <t t-else=""> 10347 <t t-foreach="source.options" t-as="option" t-key="option.id"> 10348 <li class="o-autocomplete--dropdown-item ui-menu-item" t-att-class="option.classList" t-on-mouseenter="() => this.onOptionMouseEnter([source_index, option_index])" t-on-mouseleave="() => this.onOptionMouseLeave([source_index, option_index])" t-on-click="() => this.onOptionClick(option)" t-on-pointerdown="() => this.ignoreBlur = true"> 10349 <a t-attf-id="{{props.id or 'autocomplete'}}_{{source_index}}_{{option_index}}" role="option" href="#" class="dropdown-item ui-menu-item-wrapper text-truncate" t-att-class="{ 'ui-state-active': isActiveSourceOption([source_index, option_index]) }" t-att-aria-selected="isActiveSourceOption([source_index, option_index]) ? 'true' : 'false'"> 10350 <t t-if="source.optionTemplate"> 10351 <t t-call="{{ source.optionTemplate }}"/> 10352 </t> 10353 <t t-else=""> 10354 <t t-esc="option.label"/> 10355 </t> 10356 </a> 10357 </li> 10358 </t> 10359 </t> 10360 </t> 10361 </ul> 10362 </t> 10363 </div> 10364 </t> 10365 10366<t t-name="web.CheckBox" owl="1"> 10367 <div class="o-checkbox form-check" t-attf-class="{{ props.slots ? 'form-check' : '' }}" t-att-class="props.className" t-on-click="onClick" t-ref="root"> 10368 <input t-att-id="props.id or id" type="checkbox" class="form-check-input" t-att-disabled="props.disabled" t-att-checked="props.value" t-att-name="props.name" t-on-change="onChange"/> 10369 <label t-att-for="props.id or id" class="form-check-label"> 10370 <t t-slot="default"/> 10371 </label> 10372 </div> 10373</t> 10374 10375<t t-name="web.ColorList" owl="1"> 10376 <div class="o_colorlist d-flex flex-wrap align-items-center mw-100 gap-2" aria-atomic="true" t-ref="colorlist"> 10377 <t t-if="!props.forceExpanded and !state.isExpanded"> 10378 <button t-on-click="onToggle" role="menuitem" t-att-title="colors[props.selectedColor]" t-att-data-color="props.selectedColor" t-att-aria-label="colors[props.selectedColor]" t-attf-class="btn p-0 o_colorlist_toggler o_colorlist_item_color_{{ props.selectedColor }}"/> 10379 </t> 10380 <t t-else="" t-foreach="props.colors" t-as="colorId" t-key="colorId"> 10381 <button t-on-click.prevent.stop="() => this.onColorSelected(colorId)" role="menuitem" t-att-title="colors[colorId]" t-att-data-color="colorId" t-att-aria-label="colors[colorId]" t-attf-class="btn p-0 o_colorlist_item_color_{{ colorId }} {{ colorId === props.selectedColor ? 'o_colorlist_selected' : '' }}"/> 10382 </t> 10383 </div> 10384 </t> 10385 10386<t t-name="web.ConfirmationDialog" owl="1"> 10387 <Dialog size="'md'" title="props.title" modalRef="modalRef"> 10388 <p t-out="props.body" style="white-space: pre-wrap;"/> 10389 <t t-set-slot="footer" owl="1"> 10390 <button class="btn btn-primary" t-on-click="_confirm" t-esc="props.confirmLabel"/> 10391 <button t-if="props.cancel" class="btn btn-secondary" t-on-click="_cancel" t-esc="props.cancelLabel"/> 10392 </t> 10393 </Dialog> 10394 </t> 10395 10396 <t t-name="web.AlertDialog" owl="1"> 10397 <Dialog size="'sm'" title="props.title" contentClass="props.contentClass"> 10398 <p t-out="props.body" style="white-space: pre-wrap;"/> 10399 <t t-set-slot="footer" owl="1"> 10400 <button class="btn btn-primary" t-on-click="_confirm" t-esc="props.confirmLabel"/> 10401 <button t-if="props.cancel" class="btn btn-secondary" t-on-click="_cancel" t-esc="props.cancelLabel"/> 10402 </t> 10403 </Dialog> 10404 </t> 10405 10406<t t-name="web.DatePicker" owl="1"> 10407 <div class="o_datepicker" aria-atomic="true" t-att-data-target-input="'#' + datePickerId" t-ref="root"> 10408 <input type="text" t-ref="input" t-att-id="props.inputId" class="o_datepicker_input o_input datetimepicker-input" t-att-name="props.name" t-att-placeholder="props.placeholder" t-att-readonly="props.readonly" autocomplete="off" t-on-change="onInputChange" t-on-input="onInputInput" t-on-keydown="onInputKeydown"/> 10409 <input type="hidden" t-ref="hiddenInput" t-att-id="datePickerId"/>
10410 <span t-if="props.warn_future and state.warning" class="fa fa-exclamation-triangle text-danger o_tz_warning o_datepicker_warning" data-tooltip="This date is on the future. Make sure it is what you expected."/> 10411 <span class="o_datepicker_button"/> 10412 </div> 10413 </t> 10414 10415<t t-name="web.DebugMenu" owl="1"> 10416 <Dropdown class="'o_debug_manager'" beforeOpen="getElements" position="'bottom-end'" togglerClass="\`o-dropdown--narrow \${env.inDialog?'btn btn-link':''}\`"> 10417 <t t-set-slot="toggler"> 10418 <i class="fa fa-bug" role="img" aria-label="Open developer tools"/> 10419 </t> 10420 <t t-foreach="elements" t-as="element" t-key="element_index"> 10421 <DropdownItem t-if="element.type == 'item'" onSelected="element.callback" href="element.href"> 10422 <t t-esc="element.description"/> 10423 </DropdownItem> 10424 <div t-if="element.type == 'separator'" role="separator" class="dropdown-divider"/> 10425 <t t-if="element.type == 'component'" t-component="element.Component" t-props="element.props"/> 10426 </t> 10427 </Dropdown> 10428 </t> 10429 10430<t t-name="web.DebugMenu.SetDefaultDialog" owl="1"> 10431 <Dialog title="title"> 10432 <table style="width: 100%"> 10433 <tr> 10434 <td> 10435 <label for="formview_default_fields" class="oe_label oe_align_right"> 10436 Default: 10437 </label> 10438 </td> 10439 <td class="oe_form_required"> 10440 <select id="formview_default_fields" class="o_input" t-model="state.fieldToSet"> 10441 <option value=""/> 10442 <option t-foreach="defaultFields" t-as="field" t-att-value="field.name" t-key="field.name"> 10443 <t t-esc="field.string"/> = <t t-esc="field.displayed"/> 10444 </option> 10445 </select> 10446 </td> 10447 </tr> 10448 <tr t-if="conditions.length"> 10449 <td> 10450 <label for="formview_default_conditions" class="oe_label oe_align_right"> 10451 Condition: 10452 </label> 10453 </td> 10454 <td> 10455 <select id="formview_default_conditions" class="o_input" t-model="state.condition"> 10456 <option value=""/> 10457 <option t-foreach="conditions" t-as="cond" t-att-value="cond.name + '=' + cond.value" t-key="cond.name"> 10458 <t t-esc="cond.string"/>=<t t-esc="cond.displayed"/> 10459 </option> 10460 </select> 10461 </td> 10462 </tr> 10463 <tr> 10464 <td colspan="2"> 10465 <input type="radio" id="formview_default_self" value="self" name="scope" t-model="state.scope"/> 10466 <label for="formview_default_self" class="oe_label" style="display: inline;"> 10467 Only you 10468 </label> 10469 <br/> 10470 <input type="radio" id="formview_default_all" value="all" name="scope" t-model="state.scope"/> 10471 <label for="formview_default_all" class="oe_label" style="display: inline;"> 10472 All users 10473 </label> 10474 </td> 10475 </tr> 10476 </table> 10477 <t t-set-slot="footer"> 10478 <button class="btn btn-secondary" t-on-click="props.close">Close</button> 10479 <button class="btn btn-secondary" t-on-click="saveDefault">Save default</button> 10480 </t> 10481 </Dialog> 10482 </t> 10483 10484 <t t-name="web.DebugMenu.GetMetadataDialog" owl="1"> 10485 <Dialog title="title"> 10486 <table class="table table-sm table-striped"> 10487 <tr> 10488 <th>ID:</th> 10489 <td><t t-esc="state.id"/></td> 10490 </tr> 10491 <tr> 10492 <th>XML ID:</th> 10493 <td> 10494 <t t-if="state.xmlids.length > 1"> 10495 <t t-foreach="state.xmlids" t-as="imd" t-key="imd['xmlid']"> 10496 <div t-att-class=""p-0 " + (imd["xmlid"] === state.xmlid ? "fw-bolder " : "") + (imd["noupdate"] === true ? "fst-italic " : "")" t-esc="imd['xmlid']"/> 10497 </t> 10498 </t> 10499 <t t-elif="state.xmlid" t-esc="state.xmlid"/> 10500 <t t-else=""> 10501 / <a t-on-click="onClickCreateXmlid"> (create)</a> 10502 </t> 10503 </td> 10504 </tr> 10505 <tr> 10506 <th>No Update:</th> 10507 <td> 10508 <t t-esc="state.noupdate"/> 10509 <t t-if="state.xmlid"> 10510 <a t-on-click="toggleNoupdate"> (change)</a> 10511 </t> 10512 </td> 10513 </tr> 10514 <tr> 10515 <th>Creation User:</th> 10516 <td><t t-esc="state.creator"/></td> 10517 </tr> 10518 <tr> 10519 <th>Creation Date:</th> 10520 <td><t t-esc="state.createDate"/></td> 10521 </tr> 10522 <tr> 10523 <th>Latest Modification by:</th> 10524 <td><t t-esc="state.lastModifiedBy"/></td> 10525 </tr> 10526 <tr> 10527 <th>Latest Modification Date:</th> 10528 <td><t t-esc="state.writeDate"/></td> 10529 </tr> 10530 </table> 10531 </Dialog> 10532 </t> 10533<t t-name="web.DebugMenu.ProfilingItem" owl="1"> 10534 <DropdownItem class="o_debug_profiling_item_wrapper"> 10535 <div class="o_debug_profiling_item d-flex justify-content-between"> 10536 <div class="align-self-center"> 10537 <div t-if="profiling.state.isEnabled" class="alert alert-info py-2 me-3">Recording...</div>
10538 <span class="o_profiling_switch"> 10539 <span class="form-check form-switch" t-on-click.stop.prevent="() => this.profiling.toggleProfiling()"> 10540 <input type="checkbox" class="form-check-input" id="enable_profiling" t-att-checked="profiling.state.isEnabled"/> 10541 <label class="form-check-label">Enable profiling</label> 10542 </span> 10543 </span> 10544 <t t-if="profiling.state.isEnabled"> 10545 <span class="o_profiling_switch form-check form-switch mt-2" t-on-click.stop.prevent="() => this.profiling.toggleCollector('sql')"> 10546 <input type="checkbox" class="form-check-input" id="profile_sql" t-att-checked="profiling.isCollectorEnabled('sql')"/> 10547 <label class="form-check-label" for="profile_sql">Record sql</label> 10548 </span> 10549 <span class="o_profiling_switch form-check form-switch mt-2" t-on-click.stop.prevent="() => this.profiling.toggleCollector('traces_async')"> 10550 <input type="checkbox" class="form-check-input" id="profile_traces_async" t-att-checked="profiling.isCollectorEnabled('traces_async')"/> 10551 <label class="form-check-label" for="profile_traces_async">Record traces</label> 10552 </span> 10553 <div t-if="profiling.isCollectorEnabled('traces_async')" class="input-group input-group-sm mt-2" t-on-click.stop.prevent=""> 10554 <div class="input-group-text">Interval</div> 10555 <select class="profile_param form-select" t-on-change="(ev) => this.changeParam('traces_async_interval', ev)"> 10556 <t t-set="interval" t-value="profiling.state.params.traces_async_interval"/> 10557 <option value="">Default</option> 10558 <option value="0.001" t-att-selected="interval === '0.001'">0.001</option> 10559 <option value="0.01" t-att-selected="interval === '0.01'">0.01</option> 10560 <option value="0.1" t-att-selected="interval === '0.1'">0.1</option> 10561 <option value="1" t-att-selected="interval === '1'">1</option> 10562 </select> 10563 </div> 10564 <div class="input-group input-group-sm mt-2"> 10565 <div class="input-group-text">Entry Count</div> 10566 <input type="number" class="form-control" t-on-click.stop.prevent="" t-on-change="(ev) => this.changeParam('entry_count_limit', ev)" t-att-value="profiling.state.params.entry_count_limit || '0'" placeholder="None"/> 10567 </div> 10568 <span t-if="profiling.isCollectorEnabled('sql') || profiling.isCollectorEnabled('traces_async')" class="o_profiling_switch form-check form-switch mt-2" t-on-click.stop.prevent="(ev) => this.toggleParam('execution_context_qweb', ev)"> 10569 <input type="checkbox" class="form-check-input" id="profile_execution_context_qweb" t-att-checked="!!profiling.state.params.execution_context_qweb"/> 10570 <label class="form-check-label" for="profile_execution_context_qweb">Add qweb directive context</label> 10571 </span> 10572 <span class="o_profiling_switch form-check form-switch mt-2" t-on-click.stop.prevent="() => this.profiling.toggleCollector('qweb')"> 10573 <input type="checkbox" class="form-check-input" id="profile_qweb" t-att-checked="profiling.isCollectorEnabled('qweb')"/> 10574 <label class="form-check-label" for="profile_qweb">Record qweb</label> 10575 </span> 10576 </t> 10577 </div> 10578 <a href="#" t-on-click.prevent="openProfiles" t-attf-class="btn btn-light align-self-baseline {{profiling.state.isEnabled ? 'py-2' : ''}}"> 10579 <i class="o_open_profiling oi oi-launch"/> 10580 </a> 10581 </div> 10582 </DropdownItem> 10583 </t> 10584 10585<t t-name="web.ProfilingQwebView" owl="1"> 10586 <div class="oe_form_field o_ace_view_editor oe_ace_open o_profiling_qweb_view"> 10587 <div class="o_select_view_profiling" t-ref="selector"> 10588 <a role="button" class="dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#"><MenuItem view="state.view" t-if="state.view"/></a> 10589 <div class="dropdown-menu" role="menu"> 10590 <t t-foreach="viewObjects" t-as="view" t-key="view_index"> 10591 <a role="menuitem" href="#" t-att-data-id="view.id" t-on-click.prevent="_onSelectView"> 10592 <MenuItem view="view"/> 10593 </a> 10594 </t> 10595 </div> 10596 </div> 10597 <div class="ace-view-editor" t-ref="ace"/>
10597 10598 <small class="text-muted"> 10599 It is possible that the "t-call" time does not correspond to the overall time of the 10600 template. Because the global time (in the drop down) does not take into account the 10601 duration which is not in the rendering (look for the template, read, inheritance, 10602 compilation...). During rendering, the global time also takes part of the time to make 10603 the profile as well as some part not logged in the function generated by the qweb. 10604 </small> 10605 </div> 10606</t> 10607<t t-name="web.ProfilingQwebView.menuitem" owl="1"> 10608 <div class="o_delay"><t t-if="props.view.delay" t-esc="props.view.delay"/> ms</div> 10609 <div class="o_query"><t t-if="props.view.delay" t-esc="props.view.query"/> query</div> 10610 <t t-esc="props.view.display_name"/> 10611 <div class="o_key text-muted">(<t t-esc="props.view.id"/>, <t t-esc="props.view.key"/>)</div> 10612</t> 10613<t t-name="web.ProfilingQwebView.hover" owl="1"> 10614 <div class="o_info o_detail"> 10615 <div class="o_delay"><t t-esc="delay"/> <span>ms</span></div> 10616 <div class="o_query"><t t-esc="query"/> <span>query</span></div> 10617 </div> 10618</t> 10619<t t-name="web.ProfilingQwebView.info" owl="1"> 10620 <div class="o_info"> 10621 <div t-if="displayDetail" class="o_more"> 10622 <span>*</span> 10623 <table class="o_detail"> 10624 <thead> 10625 <tr><th/><th>ms</th><th>query</th></tr> 10626 </thead> 10627 <tbody> 10628 <tr t-foreach="groups" t-as="directive" t-key="directive_index"> 10629 <td><t t-esc="directive"/></td> 10630 <td><t t-esc="groups[directive].delays.join(' ')"/></td> 10631 <td><t t-esc="groups[directive].querys.join(' ')"/></td> 10632 </tr> 10633 </tbody> 10634 </table> 10635 </div> 10636 <div class="o_delay"><t t-esc="delay"/></div> 10637 <div class="o_query"><t t-esc="query"/></div> 10638 </div> 10639</t> 10640 10641<t t-name="web.ProfilingSystrayItem" owl="1"> 10642 <div class="d-flex align-items-center"> 10643 <i class="fa fa-circle text-danger o_debug_recording"/> 10644 </div> 10645 </t> 10646 10647<t t-name="web.Dialog" owl="1"> 10648 <div class="o_dialog" t-att-id="id" t-att-class="{ o_inactive_modal: !data.isActive }"> 10649 <div role="dialog" class="modal d-block" tabindex="-1" t-att-class="{ o_technical_modal: props.technical, o_modal_full: isFullscreen }" t-ref="modalRef"> 10650 <div class="modal-dialog" t-attf-class="modal-{{props.size}}"> 10651 <div class="modal-content" t-att-class="props.contentClass"> 10652 <header t-if="props.header" class="modal-header"> 10653 <t t-slot="header" close="data.close" isFullscreen="isFullscreen"> 10654 <t t-call="web.Dialog.header"> 10655 <t t-set="close" t-value="data.close"/> 10656 <t t-set="fullscreen" t-value="isFullscreen"/> 10657 </t> 10658 </t> 10659 </header> 10660 10661 <footer t-if="props.footer" class="modal-footer justify-content-around justify-content-md-start flex-wrap gap-1" style="order:2"> 10662 <t t-slot="footer" close="data.close"> 10663 <button class="btn btn-primary o-default-button" t-on-click="data.close"> 10664 <t>Ok</t> 10665 </button> 10666 </t> 10667 </footer> 10668 <main class="modal-body" t-attf-class="{{ props.bodyClass }} {{ !props.withBodyPadding ? 'p-0': '' }}"> 10669 <t t-slot="default" close="data.close"/> 10670 </main> 10671 </div> 10672 </div> 10673 </div> 10674 </div> 10675 </t> 10676 10677 <t t-name="web.Dialog.header" owl="1"> 10678 <t t-if="fullscreen"> 10679 <button class="btn fa fa-arrow-left" data-bs-dismiss="modal" aria-label="Close" t-on-click="close"/> 10680 </t> 10681 <h4 class="modal-title text-break" t-att-class="{ 'me-auto': fullscreen }"> 10682 <t t-esc="props.title"/> 10683 </h4> 10684 <t t-if="!fullscreen"> 10685 <button type="button" class="btn-close" aria-label="Close" tabindex="-1" t-on-click="close"/> 10686 </t> 10687 </t> 10688<t t-name="web._DomainSelector" owl="1"> 10689 <t t-set="tree" t-value="buildTree()"/> 10690 <t t-if="tree"> 10691 <DomainSelectorRootNode value="props.value" node="tree" readonly="props.readonly" resModel="props.resModel" isDebugMode="props.isDebugMode" debugValue="props.debugValue" className="props.className"/> 10692 </t> 10693 <t t-else=""> 10694 <div t-att-class="props.className"> 10695 This domain is not supported. 10696 <t t-if="!props.readonly"> 10697 <button class="btn btn-sm btn-primary ms-2" t-on-click="() => this.resetDomain()">Reset domain</button> 10698 </t> 10699 </div> 10700 </t> 10701 </t> 10702 10703<t t-name="web.DomainSelectorBranchNode" owl="1"> 10704 <div class="o_domain_node o_domain_tree" t-ref="root"> 10705 <div class="o_domain_tree_header o_domain_selector_row"> 10706 <t t-if="!props.readonly"> 10707 <DomainSelectorControlPanel node="props.node" onHoverDeleteNodeBtn.bind="onHoverDeleteNodeBtn" onHoverInsertLeafNodeBtn.bind="onHoverInsertLeafNodeBtn" onHoverInsertBranchNodeBtn.bind="onHoverInsertBranchNodeBtn"/> 10708 </t> 10709 <DomainSelectorBranchOperator node="props.node" readonly="props.readonly"/>
10710 <span class="ml4">of:</span> 10711 </div> 10712 <div class="o_domain_node_children_container"> 10713 <t t-foreach="props.node.operands" t-as="subNode" t-key="subNode.id"> 10714 <t t-if="subNode.type === 'branch'"> 10715 <DomainSelectorBranchNode t-props="{ ...props, node: subNode }"/> 10716 </t> 10717 <t t-elif="subNode.type === 'leaf'"> 10718 <DomainSelectorLeafNode t-props="{ ...props, node: subNode }"/> 10719 </t> 10720 </t> 10721 </div> 10722 </div> 10723 </t> 10724 10725<t t-name="web.DomainSelectorBranchOperator" owl="1"> 10726 <t t-if="!props.readonly"> 10727 <div class="d-inline-flex o_domain_tree_operator_selector" aria-atomic="true"> 10728 <Dropdown togglerClass="'btn btn-link btn-sm btn-primary py-0 px-1 o_domain_tree_operator_caret'" showCaret="props.showCaret"> 10729 <t t-set-slot="toggler"> 10730 <t t-if="props.node.operator === '&'">all</t> 10731 <t t-elif="props.node.operator === '|'">any</t> 10732 <t t-elif="props.node.operator === '!'">none</t> 10733 </t> 10734 <DropdownItem onSelected="() => this.onOperatorSelected('&')">all</DropdownItem> 10735 <DropdownItem onSelected="() => this.onOperatorSelected('|')">any</DropdownItem> 10736 </Dropdown> 10737 </div> 10738 </t> 10739 <t t-else=""> 10740 <strong> 10741 <t t-if="props.node.operator === '&'">all</t> 10742 <t t-elif="props.node.operator === '|'">any</t> 10743 <t t-elif="props.node.operator === '!'">none</t> 10744 </strong> 10745 </t> 10746 </t> 10747 10748<t t-name="web.DomainSelectorControlPanel" owl="1"> 10749 <div class="o_domain_node_control_panel" role="toolbar" aria-label="Domain node"> 10750 <button class="btn btn-link text-danger o_domain_delete_node_button" title="Delete node" aria-label="Delete node" t-on-click="deleteNode" t-on-mouseenter="onEnterDeleteNodeBtn" t-on-mouseleave="onLeaveDeleteNodeBtn"> 10751 <i class="fa fa-times"/> 10752 </button> 10753 <button class="btn o_domain_add_node_button" title="Add node" aria-label="Add node" t-on-click="() => this.insertNode('leaf')" t-on-mouseenter="onEnterInsertLeafNodeBtn" t-on-mouseleave="onLeaveInsertLeafNodeBtn"> 10754 <i class="fa fa-plus-circle"/> 10755 </button> 10756 <button class="btn o_domain_add_node_button" title="Add branch" aria-label="Add branch" data-branch="1" t-on-click="() => this.insertNode('branch')" t-on-mouseenter="onEnterInsertBranchNodeBtn" t-on-mouseleave="onLeaveInsertBranchNodeBtn"> 10757 <i class="fa fa-ellipsis-h"/> 10758 </button> 10759 </div> 10760 </t> 10761 10762<t t-name="web.DomainSelectorLeafNode" owl="1"> 10763 <div class="o_domain_node o_domain_leaf o_domain_selector_row" t-ref="root"> 10764 <t t-if="props.readonly"> 10765 <div class="o_domain_leaf_info">
10766 <ModelFieldSelector fieldName="props.node.operands[0].toString()" resModel="props.resModel" readonly="props.readonly" isDebugMode="props.isDebugMode"/> 10767 <t t-if="typeof props.node.operands[1] === 'string'"> 10768 <span class="o_domain_leaf_operator"> <t t-esc="displayedOperator"/></span> 10769 <span class="o_domain_leaf_value text-primary"> "<t t-esc="props.node.operands[1]"/>"</span> 10770 </t> 10771 <t t-elif="typeof props.node.operands[1] === 'number'"> 10772 <span class="o_domain_leaf_operator"> <t t-esc="displayedOperator"/></span> 10773 <span class="o_domain_leaf_value text-primary"> <t t-esc="props.node.operands[1]"/></span> 10774 </t> 10775 <t t-elif="typeof props.node.operands[1] === 'boolean'"> 10776 is 10777 <t t-if="(props.node.operator === '=' and props.node.operands[1] === false) or (props.node.operator === '!=' and props.node.operands[1] === true)"> 10778 not 10779 </t> 10780 set 10781 </t> 10782 <t t-elif="Array.isArray(props.node.operands[1])"> 10783 <span class="o_domain_leaf_operator"> <t t-esc="displayedOperator"/></span> 10784 <t t-foreach="props.node.operands[1]" t-as="value" t-key="value_index"> 10785 <span class="o_domain_leaf_value text-primary"> "<t t-esc="value"/>"</span> 10786 <t t-if="!value_last"> or </t> 10787 </t> 10788 </t> 10789 </div> 10790 </t> 10791 <t t-else=""> 10792 <DomainSelectorControlPanel node="props.node" onHoverDeleteNodeBtn.bind="onHoverDeleteNodeBtn" onHoverInsertLeafNodeBtn.bind="onHoverInsertLeafNodeBtn" onHoverInsertBranchNodeBtn.bind="onHoverInsertBranchNodeBtn"/> 10793 <div class="o_domain_leaf_edition">
10794 <ModelFieldSelector fieldName="props.node.operands[0].toString()" resModel="props.resModel" readonly="props.readonly" update="(name) => this.onFieldChange(name)" isDebugMode="props.isDebugMode"/> 10795 <t t-set="field" t-value="getFieldComponent(fieldInfo.type)"/> 10796 <t t-if="field"> 10797 <div> 10798 <select class="o_domain_leaf_operator_select o_input text-truncate pe-1" t-on-change="onOperatorChange"> 10799 <t t-foreach="getOperators(field)" t-as="operator" t-key="operator.value"> 10800 <option t-att-value="operator_index" t-att-selected="operator.matches({ fieldInfo, operator: props.node.operator, value: props.node.operands[1] })" t-esc="operator.label"/> 10801 </t> 10802 </select> 10803 </div> 10804 <t t-if="!isValueHidden"> 10805 <t t-component="field" t-key="fieldInfo.type" field="fieldInfo" operator="getOperatorInfo(props.node.operator)" value="props.node.operands[1]" update="(changes) => props.node.update(changes)"/> 10806 </t> 10807 </t> 10808 </div> 10809 </t> 10810 </div> 10811 </t> 10812 10813<t t-name="web.DomainSelectorRootNode" owl="1"> 10814 <div class="o_domain_node o_domain_tree o_domain_selector" aria-atomic="true" t-attf-class="{{ props.className }} {{ props.readonly ? 'o_read_mode' : 'o_edit_mode'}}"> 10815 <t t-if="!hasNode"> 10816 <span>Match <strong>all records</strong></span> 10817 <t t-if="!props.readonly"> 10818 <button class="btn btn-sm btn-primary o_domain_add_first_node_button ms-1" t-on-click="() => this.insertNode('leaf')"> 10819 <i class="fa fa-plus"/> Add filter 10820 </button> 10821 </t> 10822 </t> 10823 <t t-else=""> 10824 <t t-if="node.type === 'leaf'"> 10825 Match records with the following rule: 10826 <div class="o_domain_node_children_container"> 10827 <DomainSelectorLeafNode t-props="{ ...props, node }"/> 10828 </div> 10829 </t> 10830 <t t-else=""> 10831 <span>Match records with </span> 10832 <DomainSelectorBranchOperator node="node" readonly="props.readonly" showCaret="true"/> 10833 <span> of the following rules:</span> 10834 <div class="o_domain_node_children_container"> 10835 <t t-foreach="node.operands" t-as="subNode" t-key="subNode.id"> 10836 <t t-if="subNode.type === 'branch'"> 10837 <DomainSelectorBranchNode t-props="{ ...props, node: subNode }"/> 10838 </t> 10839 <t t-elif="subNode.type === 'leaf'"> 10840 <DomainSelectorLeafNode t-props="{ ...props, node: subNode }"/> 10841 </t> 10842 </t> 10843 </div> 10844 </t> 10845 </t> 10846 <t t-if="props.isDebugMode and !props.readonly"> 10847 <label class="o_domain_debug_container"> 10848 <span class="small"># Code editor</span> 10849 <textarea type="text" class="o_domain_debug_input" t-att-value="props.debugValue or props.value" t-on-change="onChange"/> 10850 </label> 10851 </t> 10852 </div> 10853 </t> 10854 10855<t t-name="web.DomainSelectorBooleanField" owl="1"> 10856 <div class="o_ds_value_cell"> 10857 <select class="o_input" t-on-change="onChange"> 10858 <option value="1" t-att-selected="props.value">set (true)</option> 10859 <option value="0" t-att-selected="!props.value">not set (false)</option> 10860 </select> 10861 </div> 10862 </t> 10863 10864<t t-name="web.DomainSelectorDateTimeField" owl="1"> 10865 <div class="o_ds_value_cell"> 10866 <t t-component="component" date="deserializedValue" onDateTimeChanged.bind="onChange"/> 10867 </div> 10868 </t> 10869 10870<t t-name="web.DomainSelectorDefaultField" owl="1"> 10871 <div class="o_ds_value_cell"> 10872 <DomainSelectorFieldInput t-props="props"/> 10873 </div> 10874 </t> 10875 10876<t t-name="web.DomainSelectorFieldInput" owl="1"> 10877 <input type="text" class="o_input o_domain_leaf_value_input" t-att-value="props.value" t-on-change="onChange"/> 10878 </t> 10879 10880<t t-name="web.DomainSelectorFieldInputWithTags" owl="1"> 10881 <div class="o_ds_value_cell"> 10882 <div class="o_domain_leaf_value_input"> 10883 <t t-foreach="props.value" t-as="tag" t-key="tag_index">
10884 <span class="badge rounded-pill"> 10885 <t t-esc="tag"/> <i class="o_domain_leaf_value_remove_tag_button fa fa-times" role="img" aria-label="Remove tag" title="Remove tag" t-on-click="() => this.removeTag(tag_index)"/> 10886 </span> 10887 </t> 10888 </div> 10889 <div class="o_domain_leaf_value_tags"> 10890 <input type="text" class="o_input" placeholder="Add new value" t-ref="input"/> 10891 <button class="btn btn-sm btn-primary fa fa-plus o_domain_leaf_value_add_tag_button" aria-label="Add tag" title="Add tag" t-on-click="onBtnClick"/> 10892 </div> 10893 </div> 10894 </t> 10895 10896<t t-name="web.DomainSelectorNumberField" owl="1"> 10897 <div class="o_ds_value_cell"> 10898 <DomainSelectorFieldInput t-props="props"/> 10899 </div> 10900 </t> 10901 10902<t t-name="web.DomainSelectorRelationField" owl="1"> 10903 <div class="o_ds_value_cell"> 10904 <DomainSelectorFieldInput t-props="props"/> 10905 </div> 10906 </t> 10907 10908<t t-name="web.DomainSelectorSelectionField" owl="1"> 10909 <div class="o_ds_value_cell"> 10910 <t t-if="props.operator.category === 'in'"> 10911 <input type="text" class="o_input o_domain_leaf_value_input" t-att-value="formattedValue" t-on-change="onChangeMulti"/> 10912 </t> 10913 <t t-else=""> 10914 <select class="o_input o_domain_leaf_value_input" t-on-change="onChange"> 10915 <t t-foreach="props.field.selection" t-as="option" t-key="option[0]"> 10916 <option t-att-value="option[0]" t-att-selected="option[0] === props.value" t-esc="option[1]"/> 10917 </t> 10918 </select> 10919 </t> 10920 </div> 10921 </t> 10922 10923<t t-name="web.DomainSelectorTextField" owl="1"> 10924 <t t-if="props.operator.category === 'in'"> 10925 <DomainSelectorFieldInputWithTags t-props="props"/> 10926 </t> 10927 <t t-else=""> 10928 <div class="o_ds_value_cell"> 10929 <DomainSelectorFieldInput t-props="props"/> 10930 </div> 10931 </t> 10932 </t> 10933 10934<t t-name="web.DomainSelectorDialog" owl="1"> 10935 <Dialog title="dialogTitle"> 10936 <DomainSelector t-props="domainSelectorProps"/> 10937 <t t-set-slot="footer"> 10938 <t t-if="props.readonly"> 10939 <button class="btn btn-secondary" t-on-click="() => props.close()">Close</button> 10940 </t> 10941 <t t-else=""> 10942 <button class="btn btn-primary" t-on-click="onSave">Save</button> 10943 <button class="btn btn-secondary" t-on-click="onDiscard">Discard</button> 10944 </t> 10945 </t> 10946 </Dialog> 10947 </t> 10948 10949<t t-name="web.Dropdown" owl="1"> 10950 <div class="o-dropdown dropdown" t-att-class="props.class" t-attf-class=" {{ directionCaretClass || ''}} {{ state.open ? 'show' : ''}} {{ !showCaret ? 'o-dropdown--no-caret' : '' }} " t-ref="root"> 10951 <button t-if="props.toggler !== 'parent'" class="dropdown-toggle" t-attf-class=" {{props.togglerClass || ''}} {{parentDropdown ? 'dropdown-item' : ''}} " t-on-click.stop="onTogglerClick" t-on-mouseenter="onTogglerMouseEnter" t-att-title="props.title" t-att-data-hotkey="props.hotkey" t-att-data-tooltip="props.tooltip" t-att-tabindex="props.skipTogglerTabbing ? -1 : 0" t-att-aria-expanded="state.open ? 'true' : 'false'" t-ref="togglerRef"> 10952 <t t-slot="toggler"/> 10953 </button> 10954 <div t-if="state.open" class="o-dropdown--menu dropdown-menu d-block" t-att-class="props.menuClass" role="menu" t-ref="menuRef"> 10955 <t t-slot="default"/> 10956 </div> 10957 </div> 10958 </t> 10959 10960<t t-name="web.DropdownItem" owl="1"> 10961 <t t-tag="props.href ? 'a' : 'span'" t-att-href="props.href" class="dropdown-item" t-att-class="props.class" role="menuitem" t-on-click.stop="onClick" t-att-title="props.title" t-att-data-hotkey="props.hotkey" t-att="dataAttributes" tabindex="0"> 10962 <t t-slot="default"/> 10963 </t> 10964 </t> 10965 10966<t t-name="web.RainbowMan" owl="1"> 10967 <div class="o_reward position-absolute top-0 bottom-0 start-0 end-0 w-100 h-100" t-att-class="{ o_reward_fading: state.isFading }" t-on-animationend="onAnimationEnd"> 10968 <svg class="o_reward_rainbow_man position-absolute top-0 bottom-0 start-0 end-0 m-auto overflow-visible" viewBox="0 0 400 400"> 10969 <defs> 10970 <radialGradient id="o_reward_gradient_bg" cx="200" cy="200" r="200" gradientUnits="userSpaceOnUse"> 10971 <stop offset="0.3" stop-color="#edeff4"/> 10972 <stop offset="1" stop-color="#edeff4" stop-opacity="0"/> 10973 </radialGradient> 10974 <symbol id="o_reward_star"> 10975 <path d="M33 15.9C26.3558 13.6951 21.1575 8.4597 19 1.8 19 1.2477 18.5523.8 18 .8 17.4477.8 17 1.2477 17 1.8 14.6431 8.6938 9.0262 13.9736 2 15.9 1.3649 15.9.85 16.4149.85 17.05.85 17.6851 1.3649 18.2 2 18.2 8.6215 20.3845 13.8155 25.5785 16 32.2 16 32.7523 16.4477 33.2 17 33.2 17.5523 33.2 18 32.7523 18 32.2 20.3569 25.3062 25.9738 20.0264 33 18.1 33.6351 18.1 34.15 17.5851 34.15 16.95 34.15 16.3149 33.6351 15.8 33 15.8" fill="#FFFFFF"/> 10976 </symbol> 10977 <symbol id="o_reward_thumb"> 10978 <path d="M10 52C6 51 3 48 3 44 2 42 3 39 5 38 3 36 2 34 2 32 2 29 3 27 5 26 3 24 2 21 2 19 2 15 7 12 10 12L23 12C23 11 23 11 23 11L23 10C23 8 24 6 25 4 27 2 29 2 31 2 33 2 35 2 36 4 38 5 39 7 39 10L39 38C39 41 37 45 35 47 32 50 28 51 25 52L10 52 10 52Z" fill="#FBFBFC"/> 10979 <polygon fill="#ECF1FF" points="25 11 25 51 5 52 5 12"/> 10980 <path d="M31 0C28 0 26 1 24 3 22 5 21 7 21 10L10 10C8 10 6 11 4 12 2 14 1 16 1 19 1 21 1 24 2 26 1 27 1 29 1 32 1 34 1 36 2 38 1 40 0 42 1 45 1 50 5 53 10 54L25 54C29 54 33 52 36 49 39 46 41 42 41 38L41 10C41 4 36 0 31 0M31 4C34 4 37 6 37 10L37 38C37 41 35 44 33 46 31 48 28 49 25 50L10 50C7 49 5 47 5 44 4 41 6 38 9 37L9 37C6 37 5 35 5 32 5 28 6 26 9 26L9 26C6 26 5 22 5 19 5 16 8 14 11 14L23 14C24 14 25 12 25 11L25 10C25 7 28 4 31 4" fill="#A1ACBA"/> 10981 </symbol> 10982 </defs> 10983 <rect width="400" height="400" fill="url(#o_reward_gradient_bg)"/> 10984 <g transform="translate(47 45) scale(0.9)" class="o_reward_rainbow"> 10985 <path d="M270,170a100,100,0,0,0-200,0" class="o_reward_rainbow_line" stroke="#FF9E80" stroke-linecap="round" stroke-width="21" fill="none" stroke-dasharray="600 600" stroke-dashoffset="-600"/> 10986 <path d="M290,170a120,120,0,0,0-240,0" class="o_reward_rainbow_line" stroke="#FFE57F" stroke-linecap="round" stroke-width="21" fill="none" stroke-dasharray="600 600" stroke-dashoffset="-600"/> 10987 <path d="M310,170a140,140,0,0,0-280,0" class="o_reward_rainbow_line" stroke="#80D8FF" stroke-linecap="round" stroke-width="21" fill="none" stroke-dasharray="600 600" stroke-dashoffset="-600"/> 10988 <path d="M330,170a160,160,0,0,0-320,0" class="o_reward_rainbow_line" stroke="#C794BA" stroke-linecap="round" stroke-width="21" fill="none" stroke-dasharray="600 600" stroke-dashoffset="-600"/> 10989 </g> 10990 <g transform="translate(80 125)"> 10991 <use href="#o_reward_star" transform-origin="center" class="o_reward_box o_reward_star_01"/> 10992 </g> 10993 <g transform="translate(140 75)"> 10994 <use href="#o_reward_star" transform-origin="center" class="o_reward_box o_reward_star_02"/> 10995 </g> 10996 <g transform="translate(230 90)"> 10997 <use href="#o_reward_star" transform-origin="center" class="o_reward_box o_reward_star_03"/> 10998 </g> 10999 <g transform="translate(275 120)"> 11000 <use href="#o_reward_star" transform-origin="center" class="o_reward_box o_reward_star_04"/> 11001 </g> 11002 <g class="o_reward_face_group o_reward_box" transform-origin="center top"> 11003 <g class="o_reward_shadow_container o_reward_box"> 11004 <ellipse class="o_reward_shadow o_reward_box" cx="200" cy="105%" rx="100" ry="6" fill="#000" opacity="0.25" transform-origin="center"/> 11005 </g> 11006 <g class="o_reward_face_wrap o_reward_box" transform-origin="center"> 11007 <image class="o_reward_face" x="132" y="125" width="136" height="136" t-attf-href="{{props.imgUrl}}"/> 11008 </g> 11009 <g transform="translate(258 174)"> 11010 <use href="#o_reward_thumb" class="o_reward_box o_reward_thumbup" transform-origin="center"/> 11011 </g> 11012 </g> 11013 </svg> 11014 <div class="o_reward_rainbow_man o_reward_msg_container position-absolute top-0 bottom-0 start-0 end-0 m-auto"> 11015 <div class="o_reward_face_group h-100 w-75 mx-auto"> 11016 <svg viewBox="0 0 42 60" preserveAspectRatio="xMinYMax meet" width="37" height="65%" class="overflow-visible position-relative ms-5"> 11017 <g class="o_reward_box"> 11018 <use href="#o_reward_thumb" x="-60%" y="0" transform="rotate(-90) scale(1 -1)" transform-origin="center"/> 11019 </g> 11020 </svg> 11021 <div class="o_reward_msg mx-4"> 11022 <div class="o_reward_msg_card"> 11023 <div class="o_reward_msg_content text-muted px-3 py-4 bg-white d-inline-block border border-light border-top-0"> 11024 <t t-if="!props.Component"> 11025 <t t-out="props.message"/> 11026 </t> 11027 <t t-else="" t-component="props.Component" t-props="props.props"/> 11028 </div> 11029 </div> 11030 </div> 11031 </div> 11032 </div> 11033 </div> 11034 </t> 11035<t t-name="web.WarningDialog" owl="1"> 11036 <Dialog title="title"> 11037 <div role="alert" class="o_dialog_warning"> 11038 <p t-esc="message" style="white-space: pre-wrap;"/> 11039 </div> 11040 </Dialog> 11041 </t> 11042 11043 <t t-name="web.RedirectWarningDialog" owl="1"> 11044 <Dialog title="title"> 11045 <div role="alert"> 11046 <p t-esc="message" style="white-space: pre-wrap;"/> 11047 </div> 11048 <t t-set-slot="footer"> 11049 <button class="btn btn-primary" t-on-click="onClick" t-esc="buttonText"/> 11050 <button class="btn btn-secondary" t-on-click="props.close">Cancel</button> 11051 </t> 11052 </Dialog> 11053 </t> 11054 11055 <t t-name="web.Error504Dialog" owl="1"> 11056 <Dialog title="this.constructor.title"> 11057 <div role="alert"> 11058 <p style="white-space: pre-wrap;"> 11059 The operation was interrupted. This usually means that the current operation is taking too much time. 11060 </p> 11061 </div> 11062 </Dialog> 11063 </t> 11064 11065 <t t-name="web.SessionExpiredDialog" owl="1"> 11066 <Dialog title="this.constructor.title"> 11067 <div role="alert"> 11068 <p style="white-space: pre-wrap;"> 11069 Your Odoo session expired. The current page is about to be refreshed. 11070 </p> 11071 </div> 11072 <t t-set-slot="footer"> 11073 <button class="btn btn-primary" t-on-click="onClick">Ok</button> 11074 </t> 11075 </Dialog> 11076 </t> 11077 11078 <t t-name="web.ErrorDialog" owl="1"> 11079 <Dialog contentClass="'o_dialog_error'" title="this.constructor.title"> 11080 <div class="alert alert-warning clearfix" role="alert"> 11081 <div class="float-end ml8 btn-group-vertical"> 11082 <button class="btn btn-primary" t-on-click="onClickClipboard"> 11083 <i class="fa fa-clipboard mr8"/><t>Copy the full error to clipboard</t> 11084 </button> 11085 </div> 11086 <p><b>An error occurred</b></p> 11087 <p>Please use the copy button to report the error to your support service.</p> 11088 </div> 11089 11090 11091 <button class="btn btn-link" t-on-click="() => { state.showTraceback = !state.showTraceback }">See details</button> 11092 <div t-if="state.showTraceback and (props.name or props.message)" class="alert alert-info bg-100 clearfix" role="alert"> 11093 <code t-if="props.name" t-esc="props.name"/> 11094 <p t-if="props.message" t-esc="props.message"/> 11095 </div> 11096 <div t-if="state.showTraceback" class="alert alert-danger o_error_detail" role="alert"> 11097 <pre t-esc="traceback or props.traceback"/> 11098 </div> 11099 </Dialog> 11100 </t> 11101 11102<t t-name="web.FileInput" owl="1">
11103 <span class="o_file_input" t-att-class="{ 'd-none': props.hidden }" aria-atomic="true"> 11104 <span t-if="!props.hidden" class="o_file_input_trigger" t-on-click.prevent="onTriggerClicked"> 11105 <t t-slot="default"> 11106 <button class="btn btn-primary">Choose File</button> 11107 </t> 11108 </span> 11109 <input type="file" name="ufile" class="o_input_file d-none" t-att-multiple="props.multiUpload" t-att-accept="props.acceptedFileExtensions" t-ref="file-input" t-on-change="onFileInputChange"/> 11110 </span> 11111 </t> 11112 11113<t t-name="web.FileUploadProgressBar" owl="1"> 11114 <div class="position-absolute top-0 start-0 h-100 w-100"> 11115 <div class="o-file-upload-progress-bar-value h-100" t-ref="bar" t-att-style="'width: ' + (this.props.fileUpload.progress * 100) + '%;'"/> 11116 <span class="position-absolute top-0 end-0 cursor-pointer o-file-upload-progress-bar-abort fa fa-times-circle" title="Cancel Upload" aria-label="Cancel Upload" t-on-click.stop.prevent="onCancel"/> 11117 </div> 11118 </t> 11119<t t-name="web.FileUploadProgressContainer" owl="1"> 11120 <t t-foreach="Object.values(props.fileUploads)" t-as="fileUpload" t-key="fileUpload.id"> 11121 <t t-if="!props.shouldDisplay || props.shouldDisplay(fileUpload)" t-component="props.Component" fileUpload="fileUpload" selector="props.selector"/> 11122 </t> 11123 </t> 11124<t t-name="web.FileUploadProgressKanbanRecord" owl="1"> 11125 <t t-set="progressTexts" t-value="getProgressTexts()"/> 11126 <div class="o_kanban_record d-flex flex-grow-1 flex-md-shrink-1 flex-shrink-0"> 11127 <div class="o_kanban_progress_card o_kanban_attachment position-relative p-0 cursor-pointer"> 11128 <div class="o_kanban_image"> 11129 <div class="o_kanban_image_wrapper"> 11130 <div class="o_image o_image_thumbnail" t-att-data-mimetype="props.fileUpload.type"/> 11131 </div> 11132 </div> 11133 <div class="o_kanban_details"> 11134 <div class="o_kanban_details_wrapper"> 11135 <div t-att-title="props.fileUpload.title" t-att-aria-label="props.fileUpload.title" class="o_kanban_record_t
11135itle"> 11136 <span t-esc="props.fileUpload.title"/> 11137 </div> 11138 <div class="o_kanban_record_body"/> 11139 <div class="o_kanban_record_bottom"> 11140 <div class="oe_kanban_bottom_left"> 11141 <div class="o_file_upload_progress_text_left" t-esc="progressTexts.left"/> 11142 </div> 11143 <div class="oe_kanban_bottom_right"> 11144 <span class="o_file_upload_progress_text_right" t-esc="progressTexts.right"/> 11145 </div> 11146 </div> 11147 </div> 11148 </div> 11149 <FileUploadProgressBar fileUpload="props.fileUpload"/> 11150 </div> 11151 </div> 11152 </t> 11153 11154 <t t-name="web.FileUploadProgressDataRow" owl="1"> 11155 <t t-set="progressTexts" t-value="getProgressTexts()"/> 11156 <div class="o_data_row o_list_progress_card position-relative align-middle p-0"> 11157 <span class="o_file_upload_upload_title" t-esc="props.fileUpload.title"/> 11158 <span class="o_file_upload_progress_text_left" t-esc="progressTexts.left"/> 11159 <span class="o_file_upload_progress_text_right" t-esc="progressTexts.right"/> 11160 <FileUploadProgressBar fileUpload="props.fileUpload"/> 11161 </div> 11162 </t> 11163 11164<t t-name="web._ModelFieldSelector" owl="1"> 11165 <div class="o_field_selector" aria-atomic="true" t-att-class="props.readonly ? 'o_read_mode' : 'o_edit_mode o_input'" t-on-click="onFieldSelectorClick"> 11166 <div class="o_field_selector_value" tabindex="0"> 11167 <t t-foreach="chain" t-as="node" t-key="node_index"> 11168 <t t-if="node.field"> 11169 <t t-if="!node_first"> 11170 <i class="fa fa-chevron-right" role="img" aria-label="Followed by" title="Followed-by"/> 11171 </t> 11172 <span class="o_field_selector_chain_part"> 11173 <t t-esc="node.field.string"/> 11174 </span> 11175 </t> 11176 </t> 11177 </div> 11178 <t t-if="!fieldNameChain.length"> 11179 <div class="o_field_selector_controls" tabindex="0"> 11180 <i role="alert" class="fa fa-exclamation-triangle o_field_selector_warning" title="Invalid field chain" aria-label="Invalid field chain"/> 11181 </div> 11182 </t> 11183 </div> 11184 </t> 11185 11186<t t-name="web.ModelFieldSelectorPopover" owl="1"> 11187 <div class="o_field_selector_popover" t-on-keydown="onInputKeydown" tabindex="0"> 11188 <div class="o_field_selector_popover_header text-center"> 11189 <t t-if="chain.length > 1"> 11190 <i class="fa fa-arrow-left o_field_selector_popover_option o_field_selector_prev_page" title="Previous" role="img" aria-label="Previous" t-on-click="onPreviousBtnClick"/> 11191 </t> 11192 <t t-if="isDefaultValueVisible"> 11193 <div class="o_field_selector_title">Default value</div> 11194 </t> 11195 <t t-else=""> 11196 <div class="o_field_selector_title" t-out="currentFieldName"/> 11197 </t> 11198 <i class="fa fa-times o_field_selector_popover_option o_field_selector_close" title="Close" role="img" aria-label="Close" t-on-click="props.close"/> 11199 <t t-if="props.showSearchInput && !isDefaultValueVisible"> 11200 <div class="o_field_selector_search mt-2"> 11201 <input type="text" placeholder="Search..." class="o_input" t-att-value="searchValue" t-on-input="onSearch" t-ref="autofocus"/> 11202 </div> 11203 </t> 11204 <t t-if="isDefaultValueVisible"> 11205 <div class="o_field_selector_default_value_input mt-2"> 11206 <input type="text" placeholder="Type a default text or press ENTER" class="o_input" t-att-value="defaultValue" t-on-input="onDefaultValue" t-ref="autofocusDefaultValue"/> 11207 </div> 11208 </t> 11209 </div> 11210 <div class="o_field_selector_popover_body"> 11211 <ul class="o_field_selector_page" t-if="!isDefaultValueVisible"> 11212 <t t-foreach="fieldKeys" t-as="fieldKey" t-key="fieldKey"> 11213 <t t-set="field" t-value="fields[fieldKey]"/> 11214 <t t-if="field.searchable and props.filter(field)"> 11215 <li t-on-click="() => this.onFieldSelected({ ...field, name: fieldKey })" t-att-data-name="fieldKey" t-attf-class="o_field_selector_item #{fieldKey === currentActiveField and ' active' or ''}"> 11216 <t t-out="field.string"/> 11217 <div t-if="props.isDebugMode" class="text-muted o_field_selector_item_title"><t t-out="fieldKey"/> (<t t-out="field.type"/>)</div> 11218 <t t-if="field.relation and props.followRelations"> 11219 <i class="fa fa-chevron-right o_field_selector_relation_icon" role="img" aria-label="Relation to follow" title="Relation to follow"/> 11220 </t> 11221 </li> 11222 </t> 11223 </t> 11224 </ul> 11225 <ul class="o_field_selector_page" t-if="isDefaultValueVisible"> 11226 <li class="o_field_selector_item" t-on-click="() => this.selectDefaultValue(defaultValue !== '')"> 11227 <t t-if="defaultValue === ''"> 11228 <div class="text-muted o_field_selector_item_title">Default text is used when no values are set</div> 11229 </t> 11230 <t t-else=""> 11231 <div class="text-muted o_field_selector_item_title">As a default text when no value are set</div> 11232 </t> 11233 </li> 11234 </ul> 11235 </div> 11236 <t t-if="props.isDebugMode"> 11237 <div class="o_field_selector_popover_footer"> 11238 <input type="text" class="o_input o_field_selector_debug" t-att-value="fullFieldName" t-on-change="onFieldNameChange"/> 11239 </div> 11240 </t> 11241 </div> 11242 </t> 11243 11244<t t-name="web.ModelSelector" owl="1"> 11245 <div class="o_sp_input_dropdown" t-ref="autocomplete_container"> 11246 <input t-if="env.isSmall" type="text" class="o_input" readonly="" t-att-id="props.id" t-att-value="props.value"/> 11247 <AutoComplete t-else="" id="props.id" value="props.value || ''" sources="sources" placeholder="placeholder" autoSelect="props.autoSelect" onSelect.bind="onSelect"/> 11248 <a role="button" class="o_dropdown_button" draggable="false"/> 11249 </div> 11250 </t> 11251<t t-name="web.Notebook" owl="1"> 11252 <div t-attf-class="o_notebook d-flex w-100 {{ props.orientation === 'horizontal' ? 'horizontal flex-column' : 'vertical flex-row' }} {{ props.className }}" t-if="state.currentPage">
11253 <div class="o_notebook_headers" t-att-class="{ 'm-0': props.orientation === 'vertical' }"> 11254 <ul t-attf-class="nav nav-tabs {{ props.orientation === 'horizontal' ? 'flex-row flex-nowrap' : 'flex-column p-0' }}"> 11255 <li t-foreach="navItems" t-as="navItem" t-key="navItem[0]" class="nav-item flex-nowrap cursor-pointer" t-if="navItem[1].isVisible"> 11256 <a class="nav-link" t-attf-class="{{ navItem[0] === state.currentPage ? 'active' : '' }} {{ props.orientation === 'vertical' ? 'p-3 rounded-0' : '' }} {{ navItem[1].className }}" t-att-name="navItem[1].name" t-on-click.prevent="() => this.activatePage(navItem[0])" href="#" role="tab" tabindex="0" t-esc="navItem[1].title"/> 11257 </li> 11258 </ul> 11259 </div> 11260 <div class="o_notebook_content tab-content"> 11261 <div class="tab-pane active" t-ref="activePane"> 11262 <t t-if="page" t-component="page.Component" t-key="state.currentPage" t-props="page.props"/> 11263 <t t-else="" t-slot="{{ state.currentPage }}"/> 11264 </div> 11265 </div> 11266 </div> 11267 </t> 11268 11269<t t-name="web.NotificationWowl" owl="1"> 11270 <div t-attf-class="o_notification {{props.className}} border border-{{props.type}} bg-white mb-2 position-relative" role="alert" aria-live="assertive" aria-atomic="true"> 11271 <strong t-if="props.title" t-attf-class="o_notification_title d-block text-{{props.type}} py-2 ps-3 pe-5" t-out="props.title"/> 11272 <button type="button" class="o_notification_close btn" aria-label="Close" t-on-click="props.close"> 11273 <i class="oi oi-close"/> 11274 </button> 11275 <div t-attf-class="o_notification_body ps-3 pe-5 py-2"> 11276 <div t-if="props.message" class="me-auto o_notification_content" t-out="props.message"/> 11277 <div t-if="props.buttons.length" class="mt-2 o_notification_buttons"> 11278 <button t-foreach="props.buttons" t-as="button" type="button" t-key="button_index" t-attf-class="btn {{button.primary ? 'btn-primary' : 'btn-link'}}" t-on-click="button.onClick"> 11279 <t t-if="button.icon"> 11280 <i t-if="button.icon.indexOf('fa-') === 0" role="img" t-att-aria-label="button.name" t-att-title="button.name" t-attf-class="fa fa-fw o_button_icon {{button.icon}}"/> 11281 <img t-else="" t-att-src="button.icon" t-att-alt="button.name"/> 11282 </t> 11283 <span t-esc="button.name"/> 11284 </button> 11285 </div> 11286 </div> 11287 </div> 11288 </t> 11289 11290<t t-name="web.Pager" owl="1"> 11291 <nav class="o_pager align-items-center d-flex gap-2" aria-label="Pager"> 11292 <span class="o_pager_counter" t-on-click.stop=""> 11293 <t t-if="state.isEditing"> 11294 <input type="text" class="o_pager_value o_input d-inline-block w-auto text-end mb-n1" size="7" t-ref="autofocus" t-att-value="value" t-on-blur="onInputBlur" t-on-change="onInputChange" t-on-keydown.stop="onInputKeydown"/> 11295 </t> 11296 <t t-else=""> 11297 <span class="o_pager_value d-inline-block border-bottom border-transparent mb-n1" t-esc="value" t-on-click="onValueClick"/> 11298 </t> 11299 <span> / </span> 11300 <t t-if="props.updateTotal"> 11301 <span class="o_pager_limit o_pager_limit_fetch" t-att-class="{ 'disabled': state.isDisabled }" t-on-click.stop="updateTotal"><t t-esc="props.total"/>+</span> 11302 </t> 11303 <t t-else=""> 11304 <span class="o_pager_limit" t-esc="props.total"/> 11305 </t> 11306 </span> 11307 <span class="btn-group" aria-atomic="true"> 11308 11309 <button type="button" class="fa fa-chevron-left btn btn-secondary o_pager_previous px-2 rounded-start" aria-label="Previous" data-tooltip="Previous" tabindex="-1" t-att-data-hotkey="props.withAccessKey ? 'p' : false" t-att-disabled="state.isDisabled or isSinglePage" t-on-click.stop="() => this.navigate(-1)"/> 11310 <button type="button" class="fa fa-chevron-right btn btn-secondary o_pager_next px-2 rounded-end" aria-label="Next" data-tooltip="Next" tabindex="-1" t-att-data-hotkey="props.withAccessKey ? 'n' : false" t-att-disabled="state.isDisabled or isSinglePage" t-on-click.stop="() => this.navigate(1)"/> 11311 </span> 11312 </nav> 11313 </t> 11314 11315<t t-name="web.PopoverWowl" owl="1"> 11316 <div role="tooltip" class="o_popover popover mw-100 shadow-sm" t-att-class="props.popoverClass" t-ref="popper" t-att-popover-id="props.id"> 11317 <div class="popover-arrow"/> 11318 <t t-slot="default"/> 11319 </div> 11320 </t> 11321 11322<t t-name="web.sign_svg_text" name="SVG Signature Text" owl="1"> 11323 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" t-att-width="width" t-att-height="height"> 11324 <defs> 11325 <style type="text/css"> 11326 @font-face { 11327 font-family: "font"; 11328 src: url(data:font/ttf;base64,<t t-esc="font"/>) format("woff"); 11329 font-weight: normal; 11330 font-style: normal; 11331 } 11332 </style> 11333 </defs> 11334 11335 <text t-esc="text" x="50%" t-att-y="height * 4 / 5" t-att-font-size="height * 4 / 5" t-att-textLength="width * 4 / 5 * (type === 'signature' ? Math.min(1, text.length / 7) : 1)" t
11335-att-lengthAdjust="'spacing' + (type === 'signature' ? 'AndGlyphs' : '')" t-attf-style="font-family:'font'; stroke: none; fill: {{color}};" text-anchor="middle"/> 11336 </svg> 11337 </t> 11338 11339 11340 <t t-name="web.NameAndSignature" owl="1"> 11341 <div class="o_web_sign_name_and_signature"> 11342 <div t-if="!props.noInputName" class="o_web_sign_name_group"> 11343 <label class="col-form-label" t-att-for="'o_web_sign_name_input_' + htmlId">Full Name</label> 11344 <input type="text" name="signer" t-att-id="'o_web_sign_name_input_' + htmlId" class="o_web_sign_name_input form-control" t-on-input="onInputSignName" t-att-value="props.signature.name" t-ref="signNameInput" placeholder="Type your name to sign" required=""/> 11345 </div> 11346 11347 11348 <div t-if="state.showSignatureArea" class="o_web_sign_signature_group bg-white card mt-3" style="overflow: hidden;"> 11349 <div class="card-header"> 11350 <div class="row g-0"> 11351 <div t-if="!props.noInputName or defaultName" class="col-auto"> 11352 <a role="button" href="#" t-on-click.prevent="() => this.setMode('auto')" t-attf-class="o_web_sign_auto_button me-2 btn btn-light {{ state.signMode === 'auto' ? 'active': '' }}"> 11353 Auto 11354 </a> 11355 </div> 11356 <div class="col-auto"> 11357 <a role="button" href="#" t-on-click.prevent="() => this.setMode('draw')" t-attf-class="o_web_sign_draw_button me-2 btn btn-light {{ state.signMode === 'draw' ? 'active': '' }}"> 11358 Draw 11359 </a> 11360 </div> 11361 <div class="col-auto"> 11362 <a role="button" href="#" t-on-click.prevent="() => this.setMode('load')" t-attf-class="o_web_sign_load_button me-2 btn btn-light {{ state.signMode === 'load' ? 'active': '' }}"> 11363 Load 11364 </a> 11365 </div> 11366 <div t-if="state.signMode === 'draw'" t-attf-class="o_web_sign_draw_clear col-auto ms-auto"> 11367 <a role="button" href="#" t-on-click.prevent="onClickSignDrawClear" class="btn btn-link"> 11368 Clear 11369 </a> 11370 </div> 11371 11372 <Dropdown t-if="state.signMode === 'auto'" class="'o_web_sign_auto_select_style col-auto ms-auto'" togglerClass="'btn btn-link'"> 11373 <t t-set-slot="toggler"> 11374 Style 11375 </t> 11376 <t t-foreach="fonts" t-as="font" t-key="font_index"> 11377 <DropdownItem onSelected="() => this.onSelectFont(font_index)"> 11378 <img class="img-fluid" t-att-src="getSVGTextFont(font)"/> 11379 </DropdownItem> 11380 </t> 11381 </Dropdown> 11382 11383 <div t-if="state.signMode === 'load'" class="o_web_sign_load_file col-auto"> 11384 <input t-ref="signInputLoad" type="file" role="button" name="files[]" class="btn btn-link py-0" t-on-change="onChangeSignLoadInput"/> 11385 </div> 11386 </div> 11387 </div> 11388 11389 <div class="o_signature_stroke position-absolute"/> 11390 11391 <div t-if="state.showSignatureArea" t-ref="signature" t-att-style="signatureStyle" class="o_web_sign_signature p-0 bg-transparent position-relative"/> 11392 11393 <div t-if="loadIsInvalid" t-attf-class="o_web_sign_load_invalid card-footer d-none"> 11394 <div class="alert alert-danger mb-0" role="alert"> 11395 This file is invalid. Please select an image. 11396 </div> 11397 </div> 11398 </div> 11399 </div> 11400 </t> 11401<t t-name="web.SignatureDialog" owl="1"> 11402 <Dialog title="title"> 11403 <div> 11404 <NameAndSignature t-props="nameAndSignatureProps"/> 11405 <div class="mt16 small">By clicking Adopt & Sign, I agree that the chosen signature/initials will be a valid electronic representation of my hand-written signature/initials for all purposes when it is used on documents, including legally binding contracts.</div> 11406 </div> 11407 <t t-set-slot="footer"> 11408 <button class="btn btn-primary" t-att-disabled="signature.isSignatureEmpty" t-on-click="onClickConfirm">Adopt & Sign</button> 11409 <button class="btn btn-secondary" t-on-click="props.close">Cancel</button> 11410 </t> 11411 </Dialog> 11412 </t> 11413 11414<t t-name="web.Tooltip" owl="1"> 11415 <div class="o-tooltip px-2 py-1"> 11416 <t t-if="props.template" t-call="{{props.template}}" t-call-context="{ env, ...props.info }"/> 11417 <small t-else="" t-esc="props.tooltip"/> 11418 </div> 11419 </t> 11420 11421<div t-name="Tip" t-attf-class="o_tooltip #{widget.info.position} #{widget.is_anchor_fixed_position ? 'o_tooltip_fixed' : ''}"> 11422 <div class="o_tooltip_overlay"/> 11423 <div class="o_tooltip_content"> 11424 <t t-out="widget.info.content"/> 11425 </div> 11426 </div> 11427<t t-name="web_editor.DocumentAttachment" owl="1">
11428 <div class="o_existing_attachment_cell o_we_attachment_highlight card col-2 position-relative mb-2 p-2 opacity-trigger-hover cursor-pointer" t-att-class="{ o_we_attachment_selected: props.selected }" t-on-click="props.selectAttachment"> 11429 <RemoveButton remove="() => this.remove()"/> 11430 <div t-att-data-url="props.url" role="img" t-att-aria-label="props.name" t-att-title="props.name" t-att-data-mimetype="props.mimetype" class="o_image d-flex align-items-center justify-content-center"/> 11431 <small class="o_file_name d-block text-truncate" t-esc="props.name"/> 11432 </div> 11433</t> 11434 11435<t t-name="web_editor.DocumentsListTemplate" owl="1"> 11436 <div class="o_we_existing_attachments o_we_documents"> 11437 <div t-if="!hasContent" class="o_nocontent_help"> 11438 <p class="o_empty_folder_image">No documents found.</p> 11439 <p class="o_empty_folder_subtitle">You can upload documents with the button located in the top left of the screen.</p> 11440 </div> 11441 <div t-else="" class="d-flex flex-wrap gap-2"> 11442 <t t-foreach="state.attachments" t-as="attachment" t-key="attachment.id"> 11443 <DocumentAttachment url="attachment.url" name="attachment.name" mimetype="attachment.mimetype" id="attachment.id" onRemoved="(attachmentId) => this.onRemoved(attachmentId)" selected="this.selectedAttachmentIds.includes(attachment.id)" selectAttachment="() => this.onClickDocument(attachment)"/> 11444 </t> 11445 </div> 11446 </div> 11447</t> 11448<t t-name="web_editor.FileSelectorControlPanel" owl="1"> 11449 <div class="d-flex flex-wrap gap-2 mt-4 mb-2 align-items-end"> 11450 <SearchMedia searchPlaceholder="props.searchPlaceholder" needle="props.needle" search="props.search"/> 11451 <div class="d-flex gap-3 justify-content-start align-items-center"> 11452 <div t-if="props.showOptimizedOption" class="flex-shrink-0 form-check form-switch align-items-center" t-on-change="props.changeShowOptimized"> 11453 <input class="o_we_show_optimized form-check-input" type="checkbox" t-att-checked="props.showOptimized" id="o_we_show_optimized_switch"/> 11454 <label class="form-check-label" for="o_we_show_optimized_switch"> 11455 Show optimized images 11456 </label> 11457 </div> 11458 <select t-if="showSearchServiceSelect" class="o_input o_we_search_select form-select" t-on-change="ev => props.changeSearchService(ev.target.value)"> 11459 <option t-att-selected="props.searchService === 'all'" value="all">All</option> 11460 <option t-att-selected="props.searchService === 'database'" value="database">My Images</option> 11461 <option t-if="props.useMediaLibrary" t-att-selected="props.searchService === 'media-library'" value="media-library">Illustrations</option> 11462 <option t-if="props.useUnsplash" t-att-selected="props.searchService === 'unsplash'" value="unsplash">Photos (via Unsplash)</option> 11463 </select> 11464 </div> 11465 <div class="col justify-content-end flex-nowrap input-group has-validation"> 11466 <input type="text" class="form-control o_input o_we_url_input o_we_transition_ease flex-grow-0" t-att-class="{ o_we_horizontal_collapse: !state.showUrlInput, 'w-auto': state.showUrlInput }" name="url" t-att-placeholder="props.urlPlaceholder" t-model="state.urlInput" t-on-input="onUrlInput" t-if="state.showUrlInput"/> 11467 <button type="button" class="btn o_upload_media_url_button text-nowrap" t-att-class="{ 'btn-primary': state.urlInput, 'btn-secondary': !state.urlInput}" t-on-click="onUrlUploadClick" t-att-disabled="!enableUrlUploadClick"> 11468 <t t-esc="props.addText"/> 11469 </button> 11470 <div class="d-flex align-items-center"> 11471 <span t-if="state.urlInput and state.isValidUrl and state.isValidFileFormat" class="o_we_url_success text-success mx-2 fa fa-lg fa-check" title="The URL seems valid."/> 11472 <span t-if="state.urlInput and !state.isValidUrl" class="o_we_url_error text-danger mx-2 fa fa-lg fa-times" title="The URL does not seem to work."/>
11473 <span t-if="props.urlWarningTitle and state.urlInput and state.isValidUrl and !state.isValidFileFormat" class="o_we_url_warning text-warning mx-2 fa fa-lg fa-warning" t-att-title="props.urlWarningTitle"/> 11474 </div> 11475 </div> 11476 <input type="file" class="d-none o_file_input" t-on-change="onChangeFileInput" t-ref="file-input" t-att-accept="props.accept" t-att-multiple="props.multiSelect and 'multiple'"/> 11477 <div class="col-auto btn-group"> 11478 <button type="button" class="btn btn-primary o_upload_media_button" t-on-click="onClickUpload"> 11479 <t t-esc="props.uploadText"/> 11480 </button> 11481 </div> 11482 </div> 11483</t> 11484 11485<t t-name="web_editor.FileSelector" owl="1"> 11486 <div> 11487 <FileSelectorControlPanel uploadText="uploadText" accept="fileMimetypes" urlPlaceholder="urlPlaceholder" addText="addText" searchPlaceholder="searchPlaceholder" urlWarningTitle="urlWarningTitle" uploadUrl="(url) => this.uploadUrl(url)" uploadFiles="(files) => this.uploadFiles(files)" showOptimizedOption="showOptimizedOption" showOptimized="state.showOptimized" changeShowOptimized="showOptimized => this.state.showOptimized = !this.state.showOptimized" changeSearchService="service => this.state.searchService = service" searchService="state.searchService" needle="state.needle" search="(needle) => this.handleSearch(needle)" useMediaLibrary="props.useMediaLibrary" validateUrl="validateUrl" multiSelect="props.multiSelect" useUnsplash="state.useUnsplash"/> 11488 <t t-call="{{ constructor.attachmentsListTemplate }}"/> 11489 <div name="load_more_attachments" class="mt-4 text-center mx-auto o_we_load_more" t-ref="load-more-button"> 11490 <button t-if="canLoadMore" class="btn btn-odoo o_load_more" type="button" t-on-click="handleLoadMore">Load more...</button> 11491 <div t-if="hasContent and !canLoadMore" class="mt-4 o_load_done_msg"> 11492 <span><i t-esc="allLoadedText"/></span> 11493 </div> 11494 </div> 11495 <div t-if="state.unsplashError" class="d-flex mt-2 unsplash_error"> 11496 <UnsplashError title="errorTitle" subtitle="errorSubtitle" showCredentials="['key_not_found', 401].includes(state.unsplashError)" submitCredentials="(key, appId) => this.submitCredentials(key, appId)" hasCredentialsError="state.unsplashError === 401"/> 11497 </div> 11498 </div> 11499</t> 11500<t t-name="web_editor.IconSelector" owl="1"> 11501 <div> 11502 <div class="d-flex gap-2 align-items-center py-4"> 11503 <SearchMedia searchPlaceholder="searchPlaceholder" search.bind="this.search" needle="state.needle"/> 11504 </div> 11505 <div class="font-icons-icons"> 11506 <t t-foreach="state.fonts" t-as="font" t-key="font.base"> 11507 <div t-if="!font.icons.length" class="o_nocontent_help"> 11508 <p class="o_empty_folder_image">No pictograms found.</p> 11509 <p class="o_empty_folder_subtitle">Try searching with other keywords.</p> 11510 </div> 11511 <span t-foreach="font.icons" t-as="icon" t-key="icon.id" t-att-title="icon.names[0]" t-att-aria-label="icon.names[0]" role="img" class="font-icons-icon m-2 fs-2 p-3 cursor-pointer text-center" t-att-class="{ o_we_attachment_selected: this.selectedMediaIds.includes(icon.id) }" t-attf-class="{{ font.base }} {{ icon.names[0] }}" t-on-click="() => this.onClickIcon(font, icon)"/> 11512 </t> 11513 </div> 11514 </div> 11515</t> 11516<t t-name="web_editor.AutoResizeImage" owl="1"> 11517 <div t-ref="auto-resize-image-container" class="o_existing_attachment_cell o_we_image align-items-center justify-content-center me-1 mb-1 opacity-trigger-hover opacity-0 cursor-pointer" t-att-class="{ o_we_attachment_optimized: props.isOptimized, 'o_loaded position-relative opacity-100': state.loaded, o_we_attachment_selected: props.selected, 'position-fixed': !state.loaded }" t-on-click="props.onImageClick"> 11518 <RemoveButton t-if="props.isRemovable" model="props.model" remove="() => this.remove()"/> 11519 <div class="o_we_media_dialog_img_wrapper"> 11520 <img t-ref="auto-resize-image" class="o_we_attachment_highlight img img-fluid w-100" t-att-src="props.src" t-att-alt="props.altDescription" t-att-title="props.title" loading="lazy"/> 11521 <a t-if="props.author" class="o_we_media_author position-absolute start-0 bottom-0 end-0 text-truncate text-center text-primary fs-6 bg-white-50" t-att-href="props.authorLink" target="_blank" t-esc="props.author"/> 11522 </div>
11523 <span t-if="props.isOptimized" class="badge position-absolute bottom-0 end-0 m-1 text-bg-success">Optimized</span> 11524 </div> 11525</t> 11526 11527<t t-name="web_editor.ImagesListTemplate" owl="1"> 11528 <div class="o_we_existing_attachments o_we_images d-flex flex-wrap my-0"> 11529 <t t-if="!hasContent and !isFetching"> 11530 <div t-if="state.needle" class="o_nocontent_help"> 11531 <p class="o_empty_folder_image">No images found.</p> 11532 <p class="o_empty_folder_subtitle">You can upload images with the button located in the top left of the screen.</p> 11533 </div> 11534 <div t-else="" class="o_we_search_prompt"> 11535 <h2>Get the perfect image by searching in our library of copyright free photos and illustrations.</h2> 11536 </div> 11537 </t> 11538 <t t-else=""> 11539 <t t-if="['all', 'database'].includes(state.searchService)"> 11540 <t t-foreach="state.attachments" t-as="attachment" t-key="attachment.id"> 11541 <AutoResizeImage t-if="!attachment.original_id or state.showOptimized" id="attachment.id" isOptimized="!!attachment.original_id" isRemovable="true" onRemoved="(attachmentId) => this.onRemoved(attachmentId)" selected="this.selectedAttachmentIds.includes(attachment.id)" src="attachment.thumbnail_src or attachment.image_src" name="attachment.name" title="attachment.name" altDescription="attachment.altDescription" model="attachment.res_model" minRowHeight="MIN_ROW_HEIGHT" onImageClick="() => this.onClickAttachment(attachment)" onLoaded="(imgEl) => this.onImageLoaded(imgEl, attachment)"/> 11542 </t> 11543 </t> 11544 <t id="o_we_media_library_images" t-if="['all', 'media-library'].includes(state.searchService)"> 11545 <t t-foreach="state.libraryMedia" t-as="media" t-key="media.id"> 11546 <AutoResizeImage author="media.author" src="media.thumbnail_url" authorLink="media.author_link" title="media.tooltip" altDescription="media.tooltip" minRowHeight="MIN_ROW_HEIGHT" selected="this.selectedMediaIds.includes(media.id)" onImageClick="() => this.onClickMedia(media)" onLoaded="(imgEl) => this.onImageLoaded(imgEl, media)"/> 11547 </t> 11548 </t> 11549 <t t-if="['all', 'unsplash'].includes(state.searchService)"> 11550 <t t-foreach="state.unsplashRecords" t-as="record" t-key="record.id"> 11551 <AutoResizeImage src="record.url" author="record.user.n
11551ame" authorLink="record.user.links.html" name="record.user.name" title="record.user.name" altDescription="record.alt_description" selected="this.selectedRecordIds.includes(record.id)" onImageClick="() => this.onClickRecord(record)" minRowHeight="MIN_ROW_HEIGHT" onLoaded="(imgEl) => this.onImageLoaded(imgEl, record)"/> 11552 </t> 11553 </t> 11554 11555 <t t-foreach="[...Array(20).keys()]" t-as="i" t-key="i"> 11556 <div class="o_we_attachment_placeholder"/> 11557 </t> 11558 </t> 11559 </div> 11560</t> 11561<t t-name="web_editor.MediaDialog" owl="1"> 11562 <Dialog contentClass="contentClass" size="size" title="title"> 11563 <Notebook pages="tabs" onPageUpdate.bind="onTabChange" defaultPage="state.activeTab"/> 11564 <t t-set-slot="footer"> 11565 <button class="btn btn-primary" t-on-click="() => this.save()">Add</button> 11566 <button class="btn btn-secondary" t-on-click="() => this.props.close()">Discard</button> 11567 </t> 11568 </Dialog> 11569</t> 11570<div t-name="web_editor.videoWrapper" t-att-data-oe-expression="src"> 11571 <div class="css_editable_mode_display"/> 11572 <div class="media_iframe_video_size" contenteditable="false"/> 11573 <iframe t-att-src="src" frameborder="0" contenteditable="false" allowfullscreen="allowfullscreen"/> 11574</div> 11575 11576<t t-name="web_editor.VideoOption" owl="1"> 11577 <div class="mb-1"> 11578 <label class="o_switch" t-on-change="props.onChangeOption"> 11579 <input type="checkbox" t-att-checked="props.value"/><span/> 11580 <span t-esc="props.label"/> 11581 <span t-if="props.description" class="small text-muted ms-auto" t-esc="props.description"/> 11582 </label> 11583 </div> 11584</t> 11585 11586<t t-name="web_editor.VideoSelector" owl="1"> 11587 <div class="row"> 11588 <div class="col mt-4 o_video_dialog_form"> 11589 <div class="mb-2"> 11590 <label class="col-form-label" for="o_video_text"> 11591 <b>Video code </b>(URL or Embed) 11592 </label> 11593 <div class="text-start"> 11594 <small class="text-muted">Accepts <b><i>Youtube</i></b>, <b><i>Vimeo</i></b>, <b><i>Dailymotion</i></b> and <b><i>Youku</i></b> videos</small> 11595 </div> 11596 <textarea t-model="state.urlInput" class="form-control" id="o_video_text" placeholder="Copy-paste your URL or embed code here" t-on-input="onChangeUrl" t-att-class="{ 'is-valid': state.urlInput and !this.state.errorMessage, 'is-invalid': state.urlInput and this.state.errorMessage }"/> 11597 </div> 11598 <div t-if="shownOptions.length" class="o_video_dialog_options mt-4"> 11599 <VideoOption t-foreach="shownOptions" t-as="option" t-key="option.id" value="option.value" onChangeOption="() => this.onChangeOption(option.id)" label="option.label" description="option.description"/> 11600 </div> 11601 <t t-if="state.vimeoPreviews.length"> 11602 <span class="fw-bold">Suggestions</span> 11603 <div id="video-suggestion" class="mt-4 d-flex flex-wrap mh-75 overflow-auto"> 11604 <t t-foreach="state.vimeoPreviews" t-as="vimeoPreview" t-key="vimeoPreview.id"> 11605 <div class="o_sample_video w-25 mh-100 cursor-pointer" t-on-click="() => this.onClickSuggestion(vimeoPreview.src)"> 11606 <img class="mw-100 mh-100 p-1" t-att-src="vimeoPreview.thumbnailSrc"/> 11607 </div> 11608 </t> 11609 </div> 11610 </t> 11611 </div> 11612 <div class="col-md-6"> 11613 <div class="o_video_preview position-relative border-0 p-3"> 11614 <div t-if="this.state.src and !this.state.errorMessage" class="o_video_dialog_preview_text mb-2">Preview</div> 11615 <div class="media_iframe_video"> 11616 <div class="media_iframe_video_size"/> 11617 <iframe t-if="this.state.src and !this.state.errorMessage" height="720" width="1280" class="o_video_dialog_iframe mw-100 mh-100 overflow-hidden shadow" allowfullscreen="allowfullscreen" frameborder="0" t-att-src="this.state.src"/> 11618 <div t-if="this.state.errorMessage" class="alert alert-warning o_video_dialog_iframe mw-100 mh-100 mb-2 mt-2" t-esc="this.state.errorMessage"/> 11619 </div> 11620 </div> 11621 </div> 11622 </div> 11623</t> 11624<t t-name="web_editor.ProgressBar" owl="1"> 11625 <small class="text-info d-flex align-items-center me-2">
11626 <span t-if="!props.hasError and !props.uploaded"><i class="fa fa-circle-o-notch fa-spin me-2"/></span> 11627 <span class="fst-italic fw-bold text-truncate flex-grow-1 me-2" t-esc="props.name"/> 11628 <span class="fw-bold text-nowrap" t-esc="props.size"/> 11629 </small> 11630 <small t-if="props.uploaded or props.hasError" class="d-flex align-items-center mt-1"> 11631 <span t-if="props.uploaded" class="text-success"><i class="fa fa-check my-1 me-1"/> File has been uploaded</span> 11632 <span t-else="" class="text-danger"><i class="fa fa-times float-start my-1 me-1"/> <span class="o_we_error_text" t-esc="props.errorMessage ? props.errorMessage : 'File could not be saved'"/></span> 11633 </small> 11634 <div t-else="" class="progress"> 11635 <div class="progress-bar bg-info progress-bar-striped progress-bar-animated" role="progressbar" t-attf-style="width: {{this.progress}}%;"><span t-esc="this.progress + '%'"/></div> 11636 </div> 11637 <hr/> 11638</t> 11639 11640<t t-name="web_editor.UploadProgressToast" owl="1"> 11641 <div class="o_notification_manager o_upload_progress_toast"> 11642 <div t-if="state.isVisible" class="o_notification position-relative show fade mb-2 border border-info bg-white" role="alert" aria-live="assertive" aria-atomic="true"> 11643 <button type="button" class="btn btn-close o_notification_close p-2" aria-label="Close" t-on-click="props.close"/> 11644 <div class="o_notification_body ps-2 pe-4 py-2"> 11645 <div class="me-auto o_notification_content"> 11646 <div t-foreach="state.files" t-as="file" t-key="file" class="o_we_progressbar"> 11647 <ProgressBar progress="file_value.progress" errorMessage="file_value.errorMessage" hasError="file_value.hasError" name="file_value.name" uploaded="file_value.uploaded" size="file_value.size" id="file_value.id"/> 11648 </div> 11649 </div> 11650 </div> 11651 </div> 11652 </div> 11653</t> 11654<t t-name="web_editor.ace_view_editor"> 11655 <div class="o_ace_view_editor"> 11656 <div class="o_ace_view_editor_title"> 11657 <div class="btn-group o_ace_type_switcher"> 11658 <button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">XML (HTML)</button> 11659 <div class="dropdown-menu" role="menu"> 11660 <a role="menuitem" href="#" class="dropdown-item o_ace_type_switcher_choice" data-type="xml">XML (HTML)</a> 11661 <a role="menuitem" href="#" class="dropdown-item o_ace_type_switcher_choice" data-type="scss">SCSS (CSS)</a> 11662 <a role="menuitem" href="#" class="dropdown-item o_ace_type_switcher_choice" data-type="js">JS</a> 11663 </div> 11664 </div> 11665 <select id="ace-view-list" class="o_res_list"/> 11666 <select id="ace-scss-list" class="o_res_list d-none"/> 11667 <select id="ace-js-list" class="o_res_list d-none"/> 11668 <label class="o_include_option oe_include_bundles"> 11669 <div class="dropdown"> 11670 <button class="btn btn-primary dropdown-toggle" type="button" id="o_dropdown_filter_views" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 11671 Filter 11672 </button> 11673 <div class="dropdown-menu" aria-labelledby="o_dropdown_filter_views"> 11674 <a class="dropdown-item o_ace_filter active" data-type="xml" data-value="default" href="#">Only Views</a> 11675 <a class="dropdown-item o_ace_filter" data-type="xml" data-value="all" href="#">Views and Assets bundles</a> 11676 </div> 11677 </div> 11678 </label> 11679 <label class="o_include_option o_include_all_scss d-none"> 11680 <div class="dropdown"> 11681 <button class="btn btn-primary dropdown-toggle" type="button" id="o_dropdown_filter_assets" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 11682 Filter 11683 </button> 11684 <div class="dropdown-menu" aria-labelledby="o_dropdown_filter_assets"> 11685 <a class="dropdown-item o_ace_filter active" data-type="scss" data-value="custom" href="#">Only Custom SCSS Files</a> 11686 <a class="dropdown-item o_ace_filter" data-type="scss" data-value="restricted" href="#">Only Page SCSS Files</a> 11687 <a class="dropdown-item o_ace_filter" data-type="scss" data-value="all" href="#">All SCSS Files</a> 11688 </div> 11689 </div> 11690 </label> 11691 <div class="o_button_section"> 11692 <button data-action="save" type="submit" class="btn btn-primary">Save</button> 11693 <button data-action="close" type="button" class="btn btn-secondary">Close</button> 11694 </div> 11695 </div> 11696 <div id="ace-view-id"> 11697 <div class="float-end mb-2"> 11698 <button data-action="reset" type="button" class="btn btn-sm btn-danger d-none"><i class="fa fa-undo"/> Reset</button> 11699 <button data-action="format" type="button" class="btn btn-sm btn-link">Format</button> 11700 </div>
11701 <span class="o_ace_editor_resource_info"/> 11702 <div class="alert alert-warning alert-dismissible mt-2 mb-0" role="alert"> 11703 Editing a built-in file through this editor is not advised, as it will prevent it from being updated during future App upgrades. 11704 <button type="button" class="btn-close" aria-label="Close"/> 11705 </div> 11706 </div> 11707 <div id="ace-view-editor"/> 11708 </div> 11709</t> 11710 11711<t t-name="web_unsplash.UnsplashError" owl="1"> 11712 <div class="alert alert-info w-100"> 11713 <h4><t t-esc="props.title"/></h4> 11714 <p><t t-esc="props.subtitle"/></p> 11715 <UnsplashCredentials t-if="props.showCredentials" submitCredentials="props.submitCredentials" hasCredentialsError="props.hasCredentialsError"/> 11716 </div> 11717</t> 11718 11719<t t-name="web_unsplash.UnsplashCredentials" owl="1"> 11720 <div class="d-flex align-items-center flex-wrap"> 11721 <a href="https://www.odoo.com/documentation/16.0/applications/websites/website/optimize/unsplash.html#generate-an-unsplash-access-key" class="mx-2" target="_blank">Get an Access key</a> 11722 and paste it here: 11723 <input type="text" class="o_input form-control w-auto mx-2" id="accessKeyInput" placeholder="Paste your access key here" t-model="state.key" t-on-input="() => this.state.hasKeyError = false" t-att-class="{ 'is-invalid': state.hasKeyError }"/> 11724 and paste 11725 <a href="https://www.odoo.com/documentation/16.0/applications/websites/website/optimize/unsplash.html#generate-an-unsplash-application-id" class="mx-2" target="_blank">Application ID</a> 11726 here: 11727 <div class="input-group d-flex justify-content-end align-items-center w-auto mx-2"> 11728 <input type="text" class="o_input form-control w-auto" placeholder="Paste your application ID here" t-model="state.appId" t-on-input="() => this.state.hasAppIdError = false" t-att-class="{ 'is-invalid': state.hasAppIdError }"/> 11729 <button type="button" class="btn btn-primary btn-block w-auto p-auto save_unsplash" t-on-click="() => this.submitCredentials()">Apply</button> 11730 </div> 11731 </div> 11732</t> 11733 11734<t t-name="portal.chatter_message_count"> 11735 <t t-set="count" t-value="widget.get('message_count')"/> 11736 <div class="o_message_counter"> 11737 <t t-if="count"> 11738 <span class="fa fa-comments"/> 11739 <span class="o_message_count"> <t t-esc="count"/></span> 11740 <t t-if="count == 1">comment</t> 11741 <t t-else="">comments</t> 11742 </t> 11743 <t t-else=""> 11744 There are no comments for now. 11745 </t> 11746 </div> 11747 </t> 11748 11749 11750 <t t-name="portal.Composer"> 11751 <div class="o_portal_chatter_composer" t-if="widget.options['allow_composer']"> 11752 <t t-set="discussion_url" t-value="window.encodeURI(window.location.href.split('#')[0] + '#discussion')"/> 11753 <t t-if="!widget.options['display_composer']"> 11754 <h4>Leave a comment</h4> 11755 <p>You must be <a t-attf-href="/web/login?redirect=#{discussion_url}">logged in</a> to post a comment.</p> 11756 </t> 11757 <t t-if="widget.options['display_composer']"> 11758 <div class="alert alert-danger mb8 d-none o_portal_chatter_composer_error" role="alert"> 11759 Oops! Something went wrong. Try to reload the page and log in. 11760 </div> 11761 <div class="d-flex"> 11762 <img alt="Avatar" class="o_portal_chatter_avatar o_object_fit_cover align-self-start" t-attf-src="/web/image/res.partner/#{widget.options['partner_id']}/avatar_128" t-if="!widget.options['is_user_public'] or !widget.options['token']"/> 11763 <div class="flex-grow-1"> 11764 <div class="o_portal_chatter_composer_input"> 11765 <div class="o_portal_chatter_composer_body mb32"> 11766 <textarea rows="4" name="message" class="form-control" placeholder="Write a message..."/> 11767 <div class="o_portal_chatter_attachments mt-3"/> 11768 <div class="mt8"> 11769 <button t-attf-data-action="/mail/chatter_post" class="o_portal_chatter_composer_btn btn btn-primary" type="submit">Send</button> 11770 <button class="o_portal_chatter_attachment_bt
11770n btn btn-secondary" type="button" title="Add attachment"> 11771 <i class="fa fa-paperclip"/> 11772 </button> 11773 </div> 11774 </div> 11775 </div> 11776 <div class="d-none"> 11777 <input type="file" class="o_portal_chatter_file_input" multiple="multiple"/> 11778 </div> 11779 </div> 11780 </div> 11781 </t> 11782 </div> 11783 </t> 11784 11785 <t t-name="portal.Chatter.Attachments"> 11786 <div t-if="attachments.length" class="row"> 11787 <div t-foreach="attachments" t-as="attachment" class="col-lg-2 col-md-3 col-sm-6"> 11788 <div class="o_portal_chatter_attachment mb-2 position-relative text-center" t-att-data-id="attachment.id"> 11789 <button t-if="showDelete and attachment.state == 'pending'" class="o_portal_chatter_attachment_delete btn btn-sm btn-outline-danger" title="Delete"> 11790 <i class="fa fa-times"/> 11791 </button> 11792 <a t-attf-href="/web/content/#{attachment.id}?download=true&access_token=#{attachment.access_token}" target="_blank"> 11793 <div class="oe_attachment_embedded o_image" t-att-title="attachment.name" t-att-data-mimetype="attachment.mimetype"/> 11794 <div class="o_portal_chatter_attachment_name"><t t-esc="attachment.name"/></div> 11795 </a> 11796 </div> 11797 </div> 11798 </div> 11799 </t> 11800 11801 11802 11803 <t t-name="portal.chatter_messages"> 11804 <div class="o_portal_chatter_messages"> 11805 <t t-foreach="widget.get('messages') || []" t-as="message"> 11806 <div class="d-flex o_portal_chatter_message" t-att-id="'message-' + message.id"> 11807 <img class="o_portal_chatter_avatar" t-att-src="message.author_avatar_url" alt="avatar"/> 11808 <div class="flex-grow-1"> 11809 <t t-call="portal.chatter_internal_toggle" t-if="widget.options['is_user_employee']"/> 11810 11811 <div class="o_portal_chatter_message_title"> 11812 <h5 class="mb-1"><t t-esc="message.author_id[1]"/></h5> 11813 <p class="o_portal_chatter_puslished_date"><t t-esc="message.published_date_str"/></p> 11814 </div> 11815 <t t-out="message.body"/> 11816 11817 <div class="o_portal_chatter_attachments"> 11818 <t t-call="portal.Chatter.Attachments"> 11819 <t t-set="attachments" t-value="message.attachment_ids"/> 11820 </t> 11821 </div> 11822 </div> 11823 </div> 11824 </t> 11825 </div> 11826 </t> 11827 11828 11829 <t t-name="portal.chatter_internal_toggle"> 11830 <div t-if="message.is_message_subtype_note" class="float-end"> 11831 <button class="btn btn-secondary" title="Internal notes are only displayed to internal users." disabled="true">Internal Note</button> 11832 </div> 11833 <div t-else="" t-attf-class="float-end o_portal_chatter_js_is_internal #{message.is_internal and 'o_portal_message_internal_on' or 'o_portal_message_internal_off'}" t-att-data-message-id="message.id" t-att-data-is-internal="message.is_internal"> 11834 <button class="btn btn-danger" title="Currently restricted to internal employees, click to make it available to everyone viewing this document.">Employees Only</button> 11835 <button class="btn btn-success" title="Currently available to everyone viewing this document, click to restrict to internal employees.">Visible</button> 11836 </div> 11837 </t> 11838 11839 <t t-name="portal.pager"> 11840 <div class="o_portal_chatter_pager"> 11841 <t t-if="!_.isEmpty(widget.get('pager'))"> 11842 <ul class="pagination" t-if="widget.get('pager')['pages'].length > 1"> 11843 <li t-if="widget.get('pager')['page'] != widget.get('pager')['page_previous']" t-att-data-page="widget.get('pager')['page_previous']" class="page-item o_portal_chatter_pager_btn"> 11844 <a href="#" class="page-link"><i class="fa fa-chevron-left" role="img" aria-label="Previous" title="Previous"/></a> 11845 </li> 11846 <t t-foreach="widget.get('pager')['pages']" t-as="page"> 11847 <li t-att-data-page="page" t-attf-class="page-item #{page == widget.get('pager')['page'] ? 'o_portal_chatter_pager_btn active' : 'o_portal_chatter_pager_btn'}"> 11848 <a href="#" class="page-link"><t t-esc="page"/></a> 11849 </li> 11850 </t> 11851 <li t-if="widget.get('pager')['page'] != widget.get('pager')['page_next']" t-att-data-page="widget.get('pager')['page_next']" class="page-item o_portal_chatter_pager_btn"> 11852 <a href="#" class="page-link"><i class="fa fa-chevron-right" role="img" aria-label="Next" title="Next"/></a> 11853 </li> 11854 </ul> 11855 </t> 11856 </div> 11857 </t> 11858 11859 <t t-name="portal.Chatter"> 11860 <t t-set="two_columns" t-value="widget.options['two_columns']"/> 11861 <div t-attf-class="o_portal_chatter p-0 #{two_columns and 'row' or ''}"> 11862 <div t-attf-class="#{two_columns and 'col-lg-5' or ''}"> 11863 <div class="o_portal_chatter_header"> 11864 <t t-call="portal.chatter_message_count"/> 11865 </div> 11866 <hr t-if="widget.options['allow_composer']"/> 11867 <div class="o_portal_chatter_composer"/> 11868 </div> 11869 <hr t-if="!two_columns"/> 11870 <div t-attf-class="#{two_columns and 'offset-lg-1 col-lg-6' or ''}"> 11871 <t t-call="portal.chatter_messages"/> 11872 <div class="o_portal_chatter_footer"> 11873 <t t-call="portal.pager"/> 11874 </div> 11875 </div> 11876 </div> 11877 </t> 11878 11879<t t-name="portal.portal_signature"> 11880 <form method="POST"> 11881 <input type="hidden" name="csrf_token" t-att-value="widget.csrf_token"/> 11882 <div class="o_web_sign_name_and_signature"/> 11883 <div class="o_portal_sign_controls my-3"> 11884 <div class="text-end my-3"> 11885 <button type="submit" class="o_portal_sign_submit btn btn-primary" disabled="disabled"> 11886 <i class="fa fa-check"/> 11887 <t t-esc="widget.sendLabel"/> 11888 </button> 11889 </div> 11890 </div> 11891 </form> 11892 </t> 11893 11894 <t t-name="portal.portal_signature_success"> 11895 <div class="alert alert-success" role="status">
11896 <span t-if="widget.message" t-esc="widget.message"/> 11897 <span t-else="">Thank You!</span> 11898 <a t-if="widget.redirect_url" t-att-href="widget.redirect_url"> 11899 <t t-if="widget.redirect_message" t-esc="widget.redirect_message"/> 11900 <t t-else="">Click here to see your document.</t> 11901 </a> 11902 </div> 11903 </t> 11904 11905 <t t-name="portal.portal_signature_error"> 11906 <div class="o_portal_sign_error_msg alert alert-danger" role="status"> 11907 <t t-esc="widget.error"/> 11908 </div> 11909 </t> 11910<t t-name="portal.identitycheck"> 11911 <form string="Security Control"> 11912 <h3><strong>Please enter your password to confirm you own this account</strong></h3> 11913 <br/> 11914 <div> 11915 <input class="form-control col-10 col-md-6" autocomplete="current-password" name="password" type="password" required="required"/> 11916 </div> 11917 <a href="/web/reset_password/" class="btn btn-link" role="button">Forgot password?</a> 11918 </form> 11919 </t> 11920 <t t-name="portal.keydescription"> 11921 <form string="Key Description"> 11922 <h3><strong>Name your key</strong></h3> 11923 <p>Enter a description of and purpose for the key.</p> 11924 <input type="text" class="form-control col-10 col-md-6" placeholder="What's this key for?" name="description" required="required"/> 11925 <p> 11926 It is very important that this description be clear 11927 and complete, <strong>it will be the only way to 11928 identify the key once created</strong>. 11929 </p> 11930 </form> 11931 </t> 11932 <t t-name="portal.keyshow"> 11933 <div> 11934 <h3><strong>Write down your key</strong></h3> 11935 <p> 11936 Here is your new API key, use it instead of a password for RPC access. 11937 Your login is still necessary for interactive usage. 11938 </p> 11939 <p><code><span t-out="key"/></code></p> 11940 <p class="alert alert-warning" role="alert"> 11941 <strong>Important:</strong> 11942 The key cannot be retrieved later and provides <b>full access</b> 11943 to your user account, it is very important to store it securely. 11944 </p> 11945 </div> 11946 </t> 11947<t t-name="payment.display_tx_list"> 11948 <div> 11949 11950 <div t-if="tx_error.length > 0"> 11951 <h1>Failed operations</h1> 11952 <ul class="list-group"> 11953 <t t-foreach="tx_error" t-as="tx"> 11954 <a t-att-href="tx['landing_route']" class="list-group-item"> 11955 <h4 class="list-group-item-heading mb5"> 11956 <t t-esc="tx['reference']"/> 11957 <span class="badge text-bg-light float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span> 11958 </h4> 11959 <small class="list-group-item-text"> 11960 An error occurred during the processing of this payment.<br/> 11961 <strong>Reason:</strong> <t t-esc="tx['state_message']"/> 11962 </small> 11963 </a> 11964 </t> 11965 </ul> 11966 </div> 11967 11968 <div t-if="tx_done.length > 0 || tx_authorized.length > 0 || tx_pending.length > 0"> 11969 <h1>Operations in progress</h1> 11970 <div class="list-group"> 11971 11972 <t t-foreach="tx_done" t-as="tx"> 11973 <a t-att-href="tx['landing_route']" class="list-group-item"> 11974 <h4 class="list-group-item-heading mb5"> 11975 <t t-esc="tx['reference']"/> 11976 <span class="badge text-bg-light float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span> 11977 </h4> 11978 <small class="list-group-item-text"> 11979 <t t-if="!tx['is_post_processed']"> 11980 <t t-if="tx['operation'] != 'validation'"> 11981 Your payment is being processed, please wait... <i class="fa fa-cog fa-spin"/> 11982 </t> 11983 <t t-else=""> 11984 Saving your payment method, please wait... <i class="fa fa-cog fa-spin"/> 11985 </t> 11986 </t> 11987 <t t-else=""> 11988 <t t-if="tx['operation'] != 'validation'"> 11989 Your payment has been processed.<br/> 11990 Click here to be redirected to the confirmation page. 11991 </t> 11992 <t t-else=""> 11993 Your payment method has been saved.<br/> 11994 Click here to be redirected to the confirmation page. 11995 </t> 11996 </t> 11997 </small> 11998 </a> 11999 </t> 12000 12001 <t t-foreach="tx_pending" t-as="tx"> 12002 <a t-att-href="tx['landing_route']" class="list-group-item"> 12003 <h4 class="list-group-item-heading mb5"> 12004 <t t-esc="tx['reference']"/>
12005 <span class="badge text-bg-light float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span> 12006 </h4> 12007 <small class="list-group-item-text"> 12008 <t t-if="tx['display_message']"> 12009 12010 <t t-out="tx['display_message']"/> 12011 </t> 12012 <t t-else=""> 12013 Your payment is in pending state.<br/> 12014 You will be notified when the payment is fully confirmed.<br/> 12015 Click here to be redirected to the confirmation page. 12016 </t> 12017 </small> 12018 </a> 12019 </t> 12020 12021 <t t-foreach="tx_authorized" t-as="tx"> 12022 <a t-att-href="tx['landing_route']" class="list-group-item"> 12023 <h4 class="list-group-item-heading mb5"> 12024 <t t-esc="tx['reference']"/> 12025 <span class="badge text-bg-light float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span> 12026 </h4> 12027 <small class="list-group-item-text"> 12028 <t t-if="tx['display_message']"> 12029 12030 <t t-out="tx['display_message']"/> 12031 </t> 12032 <t t-else=""> 12033 Your payment has been received but need to be confirmed manually.<br/> 12034 You will be notified when the payment is confirmed. 12035 </t> 12036 </small> 12037 </a> 12038 </t> 12039 </div> 12040 </div> 12041 12042 <div t-if="tx_draft.length > 0"> 12043 <h1>Waiting for operations to process</h1> 12044 <ul class="list-group"> 12045 <t t-foreach="tx_draft" t-as="tx"> 12046 <a t-att-href="tx['landing_route']" class="list-group-item"> 12047 <h4 class="list-group-item-heading mb5"> 12048 <t t-esc="tx['reference']"/> 12049 <span class="badge text-bg-light float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span> 12050 </h4> 12051 <small class="list-group-item-text"> 12052 <t t-if="tx['display_message']"> 12053 12054 <t t-out="tx['display_message']"/> 12055 </t> 12056 <t t-else=""> 12057 We are waiting for the payment provider to confirm the payment. 12058 </t> 12059 </small> 12060 </a> 12061 </t> 12062 </ul> 12063 </div> 12064 12065 <div t-if="tx_cancel.length > 0"> 12066 <h1>Canceled operations</h1> 12067 <ul class="list-group"> 12068 <t t-foreach="tx_cancel" t-as="tx"> 12069 <a t-att-href="tx['landing_route']" class="list-group-item"> 12070 <h4 class="list-group-item-heading mb5"> 12071 <t t-esc="tx['reference']"/> 12072 <span class="badge text-bg-light float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span> 12073 </h4> 12074 <small class="list-group-item-text"> 12075 This payment has been canceled.<br/> 12076 No payment has been processed.<br/> 12077 <t t-if="tx['state_message']"> 12078 <strong>Reason:</strong> <t t-esc="tx['state_message']"/> 12079 </t> 12080 </small> 12081 </a> 12082 </t> 12083 </ul> 12084 </div> 12085 </div> 12086 </t> 12087
12088 <t t-name="payment.no_tx_found"> 12089 <div class="text-center"> 12090 <p>We are not able to find your payment, but don't worry.</p> 12091 <p>You should receive an email confirming your payment in a few minutes.</p> 12092 <p>If the payment hasn't been confirmed you can contact us.</p> 12093 </div> 12094 </t> 12095 12096 <t t-name="payment.rpc_error"> 12097 <div class="text-center"> 12098 <p><strong>Server error:</strong> Unable to contact the Odoo server.</p> 12099 <p>Please wait ... <i class="fa fa-refresh fa-spin"/></p> 12100 </div> 12101 </t> 12102 12103 <t t-name="payment.exception"> 12104 <div class="text-center"> 12105 <h2>Internal server error</h2> 12106 <pre><t t-esc="exception_msg"/></pre> 12107 </div> 12108 </t> 12109 12110<t t-name="google_recaptcha.recaptcha_legal_terms"> 12111 <small class="o_recaptcha_legal_terms"> 12112 Protected by reCAPTCHA, 12113 <a href="https://policies.google.com/privacy" target="_blank">Privacy Policy</a> 12114 & 12115 <a href="https://policies.google.com/terms" target="_blank">Terms of Service</a> 12116 apply. 12117 </small> 12118</t> 12119 12120<t t-name="website.prompt"> 12121 <div role="dialog" class="modal o_technical_modal" tabindex="-1"> 12122 <div class="modal-dialog"> 12123 <div class="modal-content"> 12124 <header class="modal-header" t-if="window_title"> 12125 <h3 class="modal-title"><t t-esc="window_title"/></h3> 12126 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"/> 12127 </header> 12128 <main class="modal-body"> 12129 <form role="form" t-att-id="id"> 12130 <div class="row mb0"> 12131 <label for="page-name" class="col-md-3 col-form-label"> 12132 <t t-esc="field_name"/> 12133 </label> 12134 <div class="col-md-9"> 12135 <input t-if="field_type == 'input'" type="text" class="form-control" required="required"/> 12136 <textarea t-if="field_type == 'textarea'" class="form-control" required="required" rows="5"/> 12137 <select t-if="field_type == 'select'" class="form-select"/> 12138 </div> 12139 </div> 12140 </form> 12141 </main> 12142 <footer class="modal-footer"> 12143 <button type="button" class="btn btn-primary btn-continue"><t t-esc="btn_primary_title"/></button> 12144 <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Cancel"><t t-esc="btn_secondary_title"/></button> 12145 </footer> 12146 </div> 12147 </div> 12148 </div> 12149 </t> 12150<t t-name="website.background.video"> 12151 <div class="o_bg_video_container"> 12152 <div class="o_bg_video_loading d-flex justify-content-center align-items-center text-primary"> 12153 <div class="spinner-border" style="width: 4em; height: 4em;" role="status"> 12154 <span class="visually-hidden">Loading...</span> 12155 </div> 12156 </div> 12157 <iframe t-att-id="iframeID" class="o_bg_video_iframe fade" frameBorder="0" t-att-src="videoSrc"/> 12158 </div> 12159 </t> 12160<t t-name="website.social_hover"> 12161 <div class="text-nowrap css_editable_mode_hidden"> 12162 <t t-foreach="medias" t-as="media"> 12163 <a href="#" t-attf-class="fa fa-3x fa-#{media}-square text-#{media} oe_social_#{media}" t-att-title="media" t-att-aria-label="media"/> 12164 </t> 12165 </div> 12166 </t> 12167<t t-name="website.gallery.slideshow"> 12168 <div t-attf-id="#{id}" class="carousel slide" data-bs-ride="carousel" t-attf-data-bs-interval="#{interval}" style="margin: 0 12px;"> 12169 <div class="carousel-inner" style="padding: 0;"> 12170 <t t-foreach="images" t-as="image"> 12171 <div t-attf-class="carousel-item #{image_index == index and 'active' or None}"> 12172 <img t-attf-class="#{attrClass || 'img img-fluid d-block'}
12172" t-att-src="image.src" t-att-style="attrStyle" t-att-alt="image.alt" data-name="Image" data-o-main-image="true"/> 12173 </div> 12174 </t> 12175 </div> 12176 12177 <ul class="carousel-indicators"> 12178 <li class="o_indicators_left text-center d-none" aria-label="Previous" title="Previous"> 12179 <i class="fa fa-chevron-left"/> 12180 </li> 12181 <t t-foreach="images" t-as="image"> 12182 <li t-attf-data-bs-target="##{id}" t-att-data-bs-slide-to="image_index" t-att-class="image_index == index and 'active' or None" t-attf-style="background-image: url(#{image.src})"/> 12183 </t> 12184 <li class="o_indicators_right text-center d-none" aria-label="Next" title="Next"> 12185 <i class="fa fa-chevron-right"/> 12186 </li> 12187 </ul> 12188 12189 <a class="carousel-control-prev o_we_no_overlay o_not_editable" t-attf-href="##{id}" data-bs-slide="prev" aria-label="Previous" title="Previous"> 12190 <span class="fa fa-chevron-left fa-2x text-white"/> 12191 <span class="visually-hidden">Previous</span> 12192 </a> 12193 <a class="carousel-control-next o_we_no_overlay o_not_editable" t-attf-href="##{id}" data-bs-slide="next" aria-label="Next" title="Next"> 12194 <span class="fa fa-chevron-right fa-2x text-white"/> 12195 <span class="visually-hidden">Next</span> 12196 </a> 12197 </div> 12198 </t> 12199 12200 12201 <t t-name="website.gallery.slideshow.lightbox"> 12202 <div role="dialog" class="modal o_technical_modal fade s_gallery_lightbox p-0" aria-label="Image Gallery Dialog" tabindex="-1"> 12203 <div class="modal-dialog m-0" role="Picture Gallery" t-attf-style=""> 12204 <div class="modal-content bg-transparent modal-fullscreen"> 12205 <main class="modal-body o_slideshow bg-transparent"> 12206 <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close" style="position: absolute; right: 10px; top: 10px;"/> 12207 <t t-call="website.gallery.slideshow"/> 12208 </main> 12209 </div> 12210 </div> 12211 </div> 12212 </t> 12213<t t-name="website.s_countdown.end_redirect_message"> 12214 <p class="text-center s_countdown_end_redirect_message">Time's up! You can now visit <a class="s_countdown_end_redirect_url" t-attf-href="#{redirectUrl}">this page</a>.</p> 12215 </t> 12216<t t-name="website.s_dynamic_snippet.grid"> 12217 12218 <t t-set="colClass" t-value="'d-flex flex-grow-0 flex-shrink-0 col-' + Math.trunc(12 / chunkSize).toString()"/> 12219 <t t-set="rowIndexGenerator" t-value="Array.from(Array(Math.ceil(data.length/chunkSize)).keys())"/> 12220 <t t-set="colIndexGenerator" t-value="Array.from(Array(chunkSize).keys())"/> 12221 <t t-foreach="rowIndexGenerator" t-as="rowIndex"> 12222 <div t-attf-class="row my-4 #{extraClasses}"> 12223 <t t-foreach="colIndexGenerator" t-as="colIndex"> 12224 <t t-if="(rowIndex * chunkSize + colIndex) < data.length"> 12225 <div t-attf-class="#{colClass}"> 12226 <t t-out="data[rowIndex * chunkSize + colIndex]"/> 12227 </div> 12228 </t> 12229 </t> 12230 </div> 12231 </t> 12232 </t> 12233<t t-name="website.s_dynamic_snippet.carousel.arrows"> 12234 <a t-attf-href="##{uniqueId}" class="carousel-control-prev" data-bs-slide="prev" role="button" aria-label="Previous" title="Previous"> 12235 <span class="fa fa-chevron-circle-left fa-2x"/> 12236 <span class="visually-hidden">Previous</span> 12237 </a> 12238 <a t-attf-href="##{uniqueId}" class="carousel-control-next" data-bs-slide="next" role="button" aria-label="Next" title="Next"> 12239 <span class="fa fa-chevron-circle-right fa-2x"/> 12240 <span class="visually-hidden">Next</span> 12241 </a> 12242 </t> 12243 <t t-name="website.s_dynamic_snippet.carousel"> 12244 <div t-att-id="uniqueId" class="carousel slide" t-att-data-bs-interval="interval" data-bs-ride="carousel"> 12245 12246 <t t-set="rowSize" t-value="chunkSize"/> 12247 <t t-set="slideSize" t-value="rowSize * rowPerSlide"/> 12248 <t t-set="colClass" t-value="'d-flex flex-grow-0 flex-shrink-0 col-' + Math.trunc(12 / rowSize).toString()"/> 12249 <t t-set="slideIndexGenerator" t-value="Array.from(Array(Math.ceil(data.length/slideSize)).keys())"/> 12250 <t t-set="rowIndexGenerator" t-value="Array.from(Array(rowPerSlide).keys())"/> 12251 <t t-set="colIndexGenerator" t-value="Array.from(Array(rowSize).keys())"/> 12252 <div class="carousel-inner row w-100 mx-auto" role="listbox"> 12253 <t t-foreach="slideIndexGenerator" t-as="slideIndex"> 12254 <t t-set="slideOffset" t-value="slideIndex * slideSize"/> 12255 <div t-attf-class="carousel-item #{extraClasse
12255s} #{slideIndex_first ? 'active' : ''}"> 12256 <t t-foreach="rowIndexGenerator" t-as="rowIndex"> 12257 <t t-set="rowOffset" t-value="slideOffset + (rowIndex * rowSize)"/> 12258 <t t-if="rowOffset < data.length"> 12259 <div class="row"> 12260 <t t-foreach="colIndexGenerator" t-as="colIndex"> 12261 <t t-set="itemIndex" t-value="rowOffset + colIndex"/> 12262 <t t-if="itemIndex < data.length"> 12263 <div t-attf-class="#{colClass}"> 12264 <t t-out="data[itemIndex]"/> 12265 </div> 12266 </t> 12267 </t> 12268 </div> 12269 </t> 12270 </t> 12271 </div> 12272 </t> 12273 </div> 12274 12275 <t t-if="slideIndexGenerator.length > 1"> 12276 <t t-if="arrowPosition === 'bottom'"> 12277 <div class="s_dynamic_snippet_arrow_bottom pt-2 d-flex justify-content-center"> 12278 <t t-call="website.s_dynamic_snippet.carousel.arrows"> 12279 <t t-set="uniqueId" t-value="uniqueId"/> 12280 </t> 12281 </div> 12282 </t> 12283 <t t-else=""> 12284 <t t-call="website.s_dynamic_snippet.carousel.arrows"> 12285 <t t-set="uniqueId" t-value="uniqueId"/> 12286 </t> 12287 </t> 12288 </t> 12289 </div> 12290 </t> 12291<t t-name="website.s_website_form_status_success"> 12292 <span id="s_website_form_result" class="text-success ml8"> 12293 <i class="fa fa-check mr4" role="img" aria-label="Success" title="Success"/>The form has been sent successfully. 12294 </span> 12295 </t> 12296 12297 12298 <t t-name="website.s_website_form_status_error"> 12299 <span id="s_website_form_result" class="text-danger ml8"> 12300 <i class="fa fa-close mr4" role="img" aria-label="Error" title="Error"/> 12301 <t t-esc="message"/> 12302 </span> 12303 </t> 12304<div t-name="website.s_searchbar.autocomplete" class="o_dropdown_menu show w-100"> 12305 <t t-if="fuzzySearch and results.length"> 12306 <span class="dropdown-item-text"> 12307 <span class="text-muted">No results found for '<t t-esc="search"/>'. Showing results for '<a href="#" class="s_searchbar_fuzzy_submit" t-esc="fuzzySearch"/>'.</span> 12308 </span> 12309 </t> 12310 <t t-elif="!results.length"> 12311 <span class="dropdown-item-text"> 12312 <span class="text-muted">No results found. Please try another search.</span> 12313 </span> 12314 </t> 12315 <a t-foreach="results" t-as="result" t-att-href="result['website_url']" class="dropdown-item p-2 text-wrap"> 12316 <div class="d-flex align-items-center flex-wrap o_search_result_item">
12317 <t t-if="widget.displayImage"> 12318 <img t-if="result['image_url']" t-att-src="result['image_url']" class="flex-shrink-0 o_image_64_contain"/> 12319 <i t-else="" t-attf-class="o_image_64_contain text-center pt16 fa #{result['_fa']}" style="font-size: 34px;"/> 12320 </t> 12321 <div class="o_search_result_item_detail px-3"> 12322 <t t-set="description" t-value="parts['description'] and widget.displayDescription and result['description']"/> 12323 <t t-set="extra_link" t-value="parts['extra_link'] and widget.displayExtraLink and result['extra_link_url'] and result['extra_link']"/> 12324 <t t-set="extra_link_html" t-value="parts['extra_link'] and widget.displayExtraLink and !result['extra_link_url'] and result['extra_link']"/> 12325 <div t-attf-class="h6 fw-bold #{description ? '' : 'mb-0'}" t-out="result['name']"/> 12326 <p t-if="description" class="mb-0" t-out="description"/> 12327 <button t-if="extra_link" class="extra_link btn btn-link btn-sm" t-att-data-target="result['extra_link_url']" t-out="extra_link"/> 12328 <t t-if="extra_link_html" t-out="extra_link_html"/> 12329 </div> 12330 <div t-if="parts['detail'] and widget.displayDetail" class="flex-shrink-0 ms-auto"> 12331 <t t-if="result['detail_strike']"> 12332 <span class="text-danger text-nowrap" style="text-decoration: line-through;"> 12333 <t t-out="result['detail_strike']"/> 12334 </span> 12335 <br/> 12336 </t> 12337 <b t-if="result['detail']" class="text-nowrap"> 12338 <t t-out="result['detail']"/> 12339 </b> 12340 <t t-if="result['detail_extra']"> 12341 <br/> 12342 <span class="text-nowrap" t-out="result['detail_extra']"/> 12343 </t> 12344 </div> 12345 </div> 12346 </a> 12347 <t t-if="hasMoreResults"> 12348 <button type="submit" class="dropdown-item text-center text-primary">All results</button> 12349 </t> 12350</div> 12351 12352<t t-extend="portal.Composer"> 12353 <t t-jquery="textarea" t-operation="inner"><t t-esc="widget.options['default_message'] ? _.str.trim(widget.options['default_message']) : ''"/></t> 12354 <t t-jquery="button.o_portal_chatter_composer_btn" t-operation="attributes"> 12355 <attribute name="t-attf-data-action">#{widget.options['force_submit_url'] || '/mail/chatter_post'}</attribute> 12356 </t> 12357 <t t-jquery=".o_portal_chatter_composer_input div.o_portal_chatter_composer_body" t-operation="before"> 12358 <t t-call="portal_rating.rating_star_input"> 12359 <t t-set="default_rating" t-value="widget.options['default_rating_value']"/> 12360 </t> 12361 </t> 12362 </t> 12363 12364 <t t-extend="portal.chatter_messages"> 12365 <t t-jquery="t[t-out='message.body']" t-operation="before"> 12366 <t t-if="message['rating_value']"> 12367 <t t-call="portal_rating.rating_stars_static"> 12368 <t t-set="val" t-value="message.rating_value"/> 12369 </t> 12370 </t> 12371 </t> 12372 <t t-jquery=".o_portal_chatter_attachments" t-operation="after"> 12373 12374 <t t-if="message.rating and message.rating.id" t-call="portal_rating.chatter_rating_publisher"> 12375 <t t-set="is_publisher" t-value="widget.options['is_user_publisher']"/> 12376 <t t-set="rating" t-value="message.rating"/> 12377 </t> 12378 </t> 12379 </t> 12380 12381 <t t-extend="portal.Chatter"> 12382 <t t-jquery="t[t-call='portal.chatter_message_count']" t-operation="replace"> 12383 <t t-if="widget.options['display_rating']"> 12384 <t t-call="portal_rating.rating_card"/> 12385 </t> 12386 <t t-if="!widget.options['display_rating']"> 12387 <t t-call="portal.chatter_message_count"/> 12388 </t> 12389 </t> 12390 <t t-jquery="t[t-call='portal.chatter_messages']" t-operation="before"> 12391 <div class="o_portal_chatter_messages_loading d-none"> 12392 <div class="d-flex justify-content-center"> 12393 <div class="spinner-border text-primary" role="status">
12394 <span class="visually-hidden">Loading...</span> 12395 </div> 12396 </div> 12397 </div> 12398 </t> 12399 </t> 12400 12401 12402 <t t-name="portal_rating.chatter_rating_publisher"> 12403 <div class="o_wrating_publisher_container"> 12404 <button t-if="is_publisher" t-attf-class="btn px-2 mb-2 btn-sm border o_wrating_js_publisher_comment_btn {{ rating.publisher_comment !== '' ? 'd-none' : '' }}" t-att-data-mes_index="rating.mes_index"> 12405 <i class="fa fa-comment text-muted me-1"/>Comment 12406 </button> 12407 <div class="o_wrating_publisher_comment mt-2 mb-2"> 12408 <t t-if="rating.publisher_comment" t-call="portal_rating.chatter_rating_publisher_comment"/> 12409 </div> 12410 </div> 12411 </t> 12412 12413 <t t-name="portal_rating.chatter_rating_publisher_comment"> 12414 <div class="d-flex o_portal_chatter_message"> 12415 <img class="o_portal_chatter_avatar" t-att-src="rating.publisher_avatar" alt="avatar"/> 12416 <div class="flex-grow-1"> 12417 <div class="o_portal_chatter_message_title"> 12418 <div class="d-inline-block"> 12419 <h5 class="mb-1"><t t-esc="rating.publisher_name"/></h5> 12420 </div> 12421 <div t-if="is_publisher" class="dropdown d-inline-block"> 12422 <button class="btn py-0" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 12423 <i class="fa fa-ellipsis-v"/> 12424 </button> 12425 <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> 12426 <button class="dropdown-item o_wrating_js_publisher_comment_edit" t-att-data-mes_index="rating.mes_index"> 12427 <i class="fa fa-fw fa-pencil me-1"/>Edit 12428 </button> 12429 <button class="dropdown-item o_wrating_js_publisher_comment_delete" t-att-data-mes_index="rating.mes_index"> 12430 <i class="fa fa-fw fa-trash-o me-1"/>Delete 12431 </button> 12432 </div> 12433 </div> 12434 <p>Published on <t t-esc="rating.publisher_datetime"/></p> 12435 </div> 12436 <t t-out="rating.publisher_comment"/> 12437 </div> 12438 </div> 12439 </t> 12440 <t t-name="portal_rating.chatter_rating_publisher_form"> 12441 <div t-if="is_publisher" class="d-flex o_portal_chatter_message shadow bg-white rounded px-3 py-3 my-1"> 12442 <img class="o_portal_chatter_avatar" t-att-src="rating.publisher_avatar" alt="avatar"/> 12443 <div class="flex-grow-1"> 12444 <div class="o_portal_chatter_message_title"> 12445 <h5 class="mb-1"><t t-esc="rating.publisher_name"/></h5> 12446 </div> 12447 <textarea rows="3" class="form-control o_portal_rating_comment_input"><t t-esc="rating.publisher_comment"/></textarea> 12448 <div> 12449 <button class="btn btn-primary mt-2 o_wrating_js_publisher_comment_submit" t-att-data-mes_index="rating.mes_index"> 12450 <t t-if="rating.publisher_comment === ''"> 12451 Post comment 12452 </t><t t-else=""> 12453 Update comment 12454 </t> 12455 </button> 12456 <button class="border btn btn-light mt-2 bg-white o_wrating_js_publisher_comment_cancel" t-att-data-mes_index="rating.mes_index"> 12457 Cancel 12458 </button> 12459 </div> 12460 </div> 12461 </div> 12462 </t> 12463<t t-name="portal_rating.PopupComposer"> 12464 <div t-if="widget.options['display_composer']" class="modal fade" id="ratingpopupcomposer" tabindex="-1" role="dialog" aria-labelledby="ratingpopupcomposerlabel" aria-hidden="true"> 12465 <div class="modal-dialog" role="document"> 12466 <div class="modal-content bg-white"> 12467 <div class="modal-header"> 12468 <h5 class="modal-title o_rating_popup_composer_label" id="ratingpopupcomposerlabel"> 12469 <t t-if="widget.options['default_message_id']"> 12470 Modify your review 12471 </t> 12472 <t t-else=""> 12473 Write a review 12474 </t> 12475 </h5> 12476 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"/> 12477 </div> 12478 <div class="modal-body"> 12479 <div class="o_portal_chatter_composer"/> 12480 </div> 12481 </div> 12482 </div> 12483 </div> 12484 </t> 12485<t t-name="portal_rating.rating_stars_static"> 12486 <t t-set="val_integer" t-value="Math.floor(val)"/> 12487 <t t-set="val_decimal" t-value="val - val_integer"/>
12487 12488 <t t-set="empty_star" t-value="5 - (val_integer+Math.ceil(val_decimal))"/> 12489 <div class="o_website_rating_static" t-att-style="inline_mode ? 'display:inline' : ''" t-attf-aria-label="#{Math.round(val * 100) / 100} stars on 5" t-attf-title="#{Math.round(val * 100) / 100} stars on 5"> 12490 <t t-foreach="_.range(0, val_integer)" t-as="num"> 12491 <i class="fa fa-star" role="img"/> 12492 </t> 12493 <t t-if="val_decimal"> 12494 <i class="fa fa-star-half-o" role="img"/> 12495 </t> 12496 <t t-foreach="_.range(0, empty_star)" t-as="num"> 12497 <i class="fa fa-star text-black-25" role="img"/> 12498 </t> 12499 </div> 12500 </t> 12501 12502 <t t-name="portal_rating.rating_card"> 12503 <t t-set="two_columns" t-value="widget.options['two_columns']"/> 12504 <div class="row o_website_rating_card_container justify-content-center"> 12505 <div t-attf-class="#{two_columns and 'col-lg-12' or 'col-lg-5'}" t-if="!_.isEmpty(widget.get('rating_card_values'))"> 12506 <p t-if="!two_columns" class="text-center"><strong>Average</strong></p> 12507 <div t-attf-class="o_website_rating_avg #{two_columns and 'mb-2' or 'text-center'}"> 12508 <h1><t t-esc="widget.get('rating_card_values')['avg']"/></h1> 12509 <t t-call="portal_rating.rating_stars_static"> 12510 <t t-set="val" t-value="widget.get('rating_card_values')['avg'] || 0"/> 12511 </t> 12512 <t t-call="portal.chatter_message_count"/> 12513 </div> 12514 </div> 12515 <div t-attf-class="#{two_columns and 'col-lg-12' or 'col
12515-lg-7'}" t-if="!_.isEmpty(widget.get('rating_card_values'))"> 12516 <hr t-if="two_columns"/> 12517 <p t-if="!two_columns"><strong>Details</strong></p> 12518 <t t-set="selected_rating" t-value="widget.get('rating_value')"/> 12519 <table t-attf-class="o_website_rating_table #{selected_rating and 'o_website_rating_table_has_selection' or ''}"> 12520 <t t-foreach="widget.get('rating_card_values')['percent']" t-as="percent"> 12521 <t t-set="row_selected" t-value="percent['num'] == selected_rating"/> 12522 <tr t-attf-class="o_website_rating_table_row #{row_selected ? 'o_website_rating_table_row_selected' : (selected_rating ? 'opacity-50' : '')}" t-att-data-star="percent['num']"> 12523 <td class="o_website_rating_table_star_num text-nowrap" t-att-data-star="percent['num']"> 12524 <t t-esc="percent['num']"/> stars 12525 </td> 12526 <td class="o_website_rating_table_progress"> 12527 <div class="progress"> 12528 <div class="progress-bar o_rating_progressbar" role="progressbar" t-att-aria-valuenow="percent['percent']" aria-valuemin="0" aria-valuemax="100" t-att-style="'width:' + percent['percent'] + '%;'"> 12529 </div> 12530 </div> 12531 </td> 12532 <td class="o_website_rating_table_percent"> 12533 <strong><t t-esc="Math.round(percent['percent'] * 100) / 100"/>%</strong> 12534 </td> 12535 <td class="o_website_rating_table_reset"> 12536 <button t-attf-class="btn btn-link o_website_rating_selection_reset #{row_selected and 'visible' or 'invisible'}" t-att-data-star="percent['num']"> 12537 <i class="fa fa-times d-block" role="img" aria-label="Remove Selection"/> 12538 </button> 12539 </td> 12540 </tr> 12541 </t> 12542 </table> 12543 </div> 12544 </div> 12545 </t> 12546 12547 <t t-name="portal_rating.rating_star_input"> 12548 <div class="o_rating_star_card" t-if="widget.options['display_rating']"> 12549 <t t-set="val_integer" t-value="Math.floor(default_rating)"/> 12550 <t t-set="val_decimal" t-value="default_rating - val_integer"/> 12551 <t t-set="empty_star" t-value="5 - (val_integer+Math.ceil(val_decimal))"/> 12552 12553 <div class="stars enabled"> 12554 <t t-foreach="_.range(0, val_integer)" t-as="num"> 12555 <i class="fa fa-star" role="img" aria-label="Full star"/> 12556 </t> 12557 <t t-if="val_decimal"> 12558 <i class="fa fa-star-half-o" role="img" aria-label="Half a star"/> 12559 </t> 12560 <t t-foreach="_.range(0, empty_star)" t-as="num"> 12561 <i class="fa fa-star-o text-black-25" role="img" aria-label="Empty star"/> 12562 </t> 12563 </div> 12564 <div class="rate_text"> 12565 <span class="badge text-bg-info"/> 12566 </div> 12567 <input type="hidden" readonly="readonly" name="rating_value" t-att-value="default_rating || ''"/> 12568 </div> 12569 </t> 12570<t t-name="website_sale.FieldVideoPreview" owl="1"> 12571 <div class="ratio ratio-16x9 mt-2" t-if="props.value"> 12572 <t t-out="props.value"/> 12573 </div> 12574 </t> 12575 12576<we-button t-name="website_sale.ribbonSelectItem" t-att-data-set-ribbon="ribbon.id">
12577 <t t-out="ribbon.html"/> 12578 <span t-attf-class="fa fa-#{isTag ? 'tag' : 'bookmark'} ms-auto"/> 12579 <span t-attf-class="fa fa-arrow-#{isLeft ? 'left' : 'right'} ms-1"/> 12580 <span t-attf-class="o_wsale_color_preview #{colorClasses} ms-1" t-attf-style="background-color: #{ribbon.bg_color}"/> 12581 <span t-attf-class="o_wsale_color_preview #{colorClasses} ms-1" t-attf-style="background-color: #{textColor} !important;"/> 12582</we-button> 12583 12584<t t-name="website_sale.ProductImageViewer" owl="1"> 12585 <div class="o_dialog" t-att-id="id" t-att-class="{ o_inactive_modal: !data.isActive }"> 12586 <div role="dialog" class="modal" t-ref="modalRef"> 12587 <div class="o_wsale_image_viewer flex-column align-items-center d-flex w-100 h-100" t-on-mousemove="onGlobalMousemove"> 12588 12589 <div class="o_wsale_image_viewer_header d-flex w-100 text-white"> 12590 <div class="flex-grow-1"/> 12591 <div class="d-flex align-items-center mb-0 px-3 h4 text-reset cursor-pointer"> 12592 <span class="fa fa-times" t-on-click="data.close"/> 12593 </div> 12594 </div> 12595 12596 <div class="o_wsale_image_viewer_image position-absolute top-0 bottom-0 start-0 end-0 align-items-center justify-content-center d-flex o_with_img overflow-hidden"> 12597 <div class="o_wsale_image_viewer_void position-absolute align-items-center justify-content-center d-flex w-100 h-100" t-ref="imageContainer" t-att-style="imageContainerStyle"> 12598 <img class="mw-100 mh-100 bg-black transition-base" t-att-src="selectedImage.src" draggable="false" alt="Viewer" t-att-style="imageStyle" t-on-wheel.stop="onWheelImage" t-on-mousedown="onMousedownImage"/> 12599 </div> 12600 </div> 12601 <t t-if="images.length > 1"> 12602 12603 <div class="o_wsale_image_viewer_carousel position-absolute bottom-0 d-flex" role="toolbar"> 12604 <ol class="d-flex justify-content-start ps-0 pt-2 pt-lg-0 mx-auto my-0 text-start"> 12605 <t t-foreach="images" t-as="image" t-key="image.thumbnailSrc"> 12606 <li t-attf-class="align-top position-relative px-1 pb-1 {{image === selectedImage ? 'active' : ''}}" t-on-click="() => this.selectedImage = image"> 12607 <div> 12608 <img t-att-src="image.thumbnailSrc" t-attf-class="img o_wsale_image_viewer_thumbnail {{image === selectedImage ? 'active' : ''}}" t-att-alt="props.title" loading="lazy"/> 12609 </div> 12610 </li> 12611 </t> 12612 </ol> 12613 </div> 12614 12615 <div class="o_wsale_image_viewer_control o_wsale_image_viewer_previous btn btn-dark position-absolute top-0 bottom-0 start-0 align-items-center justify-content-center d-flex my-auto ms-3 rounded-circle" t-on-click="previousImage" title="Previous (Left-Arrow)" role="button"> 12616 <span class="fa fa-chevron-left" role="img"/> 12617 </div> 12618 <div class="o_wsale_image_viewer_control o_wsale_image_viewer_next btn btn-dark position-absolute top-0 bottom-0 end-0 align-items-center justify-content-center d-flex my-auto me-3 rounded-circle" t-on-click="nextImage" title="Next (Right-Arrow)" role="button"> 12619 <span class="fa fa-chevron-right" role="img"/> 12620 </div> 12621 </t> 12622 </div> 12623 </div> 12624 </div> 12625 </t> 12626<t t-name="website_sale.ReorderModal" owl="1"> 12627 <Dialog title="env._t('Re-Order')"> 12628 <table id="o_wsale_reorder_table" class="table table-sm"> 12629 <thead class="bg-100"> 12630 <tr id="o_wsale_reorder_header"> 12631 12632 <th class="text-start td-img">Product</th> 12633 12634 <th/> 12635 12636 <th class="text-center td-qty">Quantity</th> 12637 12638 <th class="text-end td-price">Price</th> 12639 </tr> 12640 </thead> 12641 <tbody id="o_wsale_reorder_body" class="sale_tbody"> 12642 <t t-foreach="content.products" t-as="product" t-key="product_index"> 12643 <tr class="js_product"> 12644 <td t-if="product.has_image" class="td-img"> 12645 <img class="product_detail_img" t-att-alt="product.name" t-attf-src="/web/image/product.product/{{product.product_id}}/image_128"/> 12646 </td> 12647 <td t-att-colspan="product.has_image ? '1' : '2'"> 12648 <h5><t t-esc="product.name"/></h5>
12649 <span class="text-muted d-none d-md-inline-block" t-if="product.description_sale" t-out="product.description_sale"/> 12650 </td> 12651 <t t-if="product.add_to_cart_allowed"> 12652 <td class="text-center td-qty"> 12653 <div class="css_quantity input-group input-group-sm justify-content-center"> 12654 <a href="#" class="btn btn-link d-none d-md-inline-block" aria-label="Remove one" title="Remove one" t-on-click.stop.prevent="() => this.changeProductQty(product, product.qty - 1)"> 12655 <i class="fa fa-minus"/> 12656 </a> 12657 <input type="text" class="js_quantity text-center form-control quantity" t-on-change="(ev) => this.onChangeProductQtyInput(ev, product)" t-att-value="product.qty"/> 12658 <a href="#" class="btn btn-link d-none d-md-inline-block" aria-label="Add one" title="Add one" t-on-click.stop.prevent="() => this.changeProductQty(product, product.qty + 1)"> 12659 <i class="fa fa-plus"/> 12660 </a> 12661 </div> 12662 <div t-if="product.qty_warning and product.qty_warning !== ''" class="text-warning fw-bold"> 12663 <i class="fa fa-exclamation-triangle"/> 12664 <span t-esc="product.qty_warning"/> 12665 </div> 12666 </td> 12667 <td class="text-end td-price"> 12668 <span t-esc="formatMonetary(product.combinationInfo.price, content.currency)"/> 12669 </td> 12670 </t> 12671 <t t-else=""> 12672 <td class="text-center" colspan="2"> 12673 <div class="text-warning fw-bold"> 12674 <i class="fa fa-exclamation-triangle"/> 12675 <span t-esc="getWarningForProduct(product)"/> 12676 </div> 12677 </td> 12678 </t> 12679 </tr> 12680 </t> 12681 </tbody> 12682 </table> 12683 <div id="o_wsale_reorder_total" class="row" name="total" style="page-break-inside: avoid;"> 12684 <div class="col-sm-7 col-md-6 ms-auto"> 12685 <table class="table table-sm"> 12686 <tr class="border-black o_total"> 12687 <td> 12688 <strong>Total</strong> 12689 </td> 12690 <td class="text-end"> 12691 <span t-out="formatMonetary(total, content.currency)"/> 12692 </td> 12693 </tr> 12694 </table> 12695 </div> 12696 </div> 12697 <t t-set-slot="footer"> 12698 <button class="btn btn-primary o_wsale_reorder_confirm" t-att-disabled="!hasBuyableProducts" t-on-click="confirmReorder"> 12699 Add To Cart 12700 </button> 12701 <button class="btn btn-secondary o_wsale_reorder_cancel" t-on-click.stop.prevent="props.close"> 12702 Discard 12703 </button> 12704 </t> 12705 </Dialog> 12706 </t> 12707 12708 <t t-name="website_sale.ReorderConfirmationDialog" owl="1"> 12709 <Dialog size="'md'" title="props.title" modalRef="modalRef"> 12710 <p t-out="props.body" style="white-space: pre-wrap;"/> 12711 <t t-set-slot="footer" owl="1"> 12712 <button class="btn btn-primary" t-on-click="_confirm"> 12713 Yes 12714 </button> 12715 <button class="btn btn-secondary" t-on-click="_cancel"> 12716 No 12717 </button> 12718 </t> 12719 </Dialog> 12720 </t> 12721 12722 <t t-name="website_links.RecentLink"> 12723 <div class="row mb16"> 12724 <div class="col-md-1 col-2 text-center"> 12725 <h4><t t-esc="widget.link_obj.count"/></h4> 12726 <p class="text-muted" style="margin-top: -5px;">clicks</p> 12727 </div>
12728 <div class="col-md-7 col-7"> 12729 <h4 class="truncate_text"> 12730 <img t-attf-src="http://www.google.com/s2/favicons?domain={{ widget.link_obj.url }}" loading="lazy" alt="Icon" onerror="this.src='/website_links/static/img/default_favicon.png'"/> 12731 <a class="no-link-style" t-att-href="widget.link_obj.url"><t t-esc="widget.link_obj.title"/></a> 12732 </h4> 12733 <p class="text-muted mb0" style="margin-top: -5px;"> 12734 <span class="o_website_links_short_url text-muted" style="position:relative;"> 12735 <span id="o_website_links_host"><t t-esc="widget.link_obj.short_url_host"/></span><span id="o_website_links_code"><t t-esc="widget.link_obj.code"/></span> 12736 </span> 12737 12738 <span class="o_website_links_edit_tools" style="display:none;"> 12739 <a role="button" class="o_website_links_ok_edit btn btn-sm btn-primary" href="#">ok</a> or 12740 <a class="o_website_links_cancel_edit" href="#">cancel</a> 12741 </span> 12742 12743 <a class="o_website_links_edit_code" aria-label="Edit code" title="Edit code"><span class="fa fa-pencil gray"/></a> 12744 12745 <br/> 12746 <span class="badge text-bg-success"><t t-esc="widget.link_obj.campaign_id[1]"/></span> 12747 <span class="badge text-bg-success"><t t-esc="widget.link_obj.medium_id[1]"/></span> 12748 <span class="badge text-bg-success">
12748<t t-esc="widget.link_obj.source_id[1]"/></span> 12749 </p> 12750 <p class="o_website_links_code_error" style="color:red;font-weight:bold;"/> 12751 </div> 12752 12753 <div class="col-md-4 col-2"> 12754 <button class="btn btn-info btn_shorten_url_clipboard mt8" t-att-data-clipboard-text="widget.link_obj.short_url">Copy</button> 12755 <a role="button" t-attf-href="{{widget.link_obj.short_url}}+" class="btn btn-warning mt8">Stats</a> 12756 </div> 12757 </div> 12758 </t> 12759<t t-name="website_mass_mailing.edition.wrapper"> 12760 <div class="modal fade show d-block o_newsletter_modal"> 12761 <div role="dialog" class="modal-dialog modal-dialog-centered"> 12762 <div class="modal-content"> 12763 <header class="modal-header"> 12764 <button type="button" class="close" aria-label="Close" tabindex="-1">Ã</button> 12765 </header> 12766 <div id="wrapper" class="modal-body p-0 oe_structure oe_empty"/> 12767 </div> 12768 </div> 12769 </div> 12770</t> 12771 12772</templates>`; 12773 return loadXML(templates); 12774 });
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.