edges reordser fix

This commit is contained in:
lexx committed 2023-11-01 13:09:32 +02:00
1 parent 7ac59fc0fe
commit 1442b68503
4 files changed
+24 -24

No files matched your search

@@ -37,7 +37,7 @@ function print() { __p += __j.call(arguments, '') }
*/var Vwe=Object.prototype.toString,YD=Array.isArray||function(e){return Vwe.call(e)==="[object Array]"};function tre(o){return typeof o=="function"}function Wwe(o){return YD(o)?"array":typeof o}function fne(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ale(o,e){return o!=null&&typeof o=="object"&&e in o}function Uwe(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var Ywe=RegExp.prototype.test;function Xwe(o,e){return Ywe.call(o,e)}var jwe=/\S/;function qwe(o){return!Xwe(jwe,o)}var Gwe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Kwe(o){return String(o).replace(/[&<>"'`=\/]/g,function(t){return Gwe[t]})}var Jwe=/\s*/,e_e=/\s+/,Dle=/\s*=/,t_e=/\s*\}/,n_e=/#|\^|\/|>|\{|&|=|!/;function o_e(o,e){if(!o)return[];var t=!1,s=[],a=[],l=[],f=!1,d=!1,h="",b=0;function y(){if(f&&!d)for(;l.length;)delete a[l.pop()];else l=[];f=!1,d=!1}var k,E,R;function $(ye){if(typeof ye=="string"&&(ye=ye.split(e_e,2)),!YD(ye)||ye.length!==2)throw new Error("Invalid tags: "+ye);k=new RegExp(fne(ye[0])+"\\s*"),E=new RegExp("\\s*"+fne(ye[1])),R=new RegExp("\\s*"+fne("}"+ye[1]))}$(e||Qp.tags);for(var Q=new j6(o),F,U,K,L,te,ne;!Q.eos();){if(F=Q.pos,K=Q.scanUntil(k),K)for(var oe=0,Y=K.length;oe<Y;++oe)L=K.charAt(oe),qwe(L)?(l.push(a.length),h+=L):(d=!0,t=!0,h+=" "),a.push(["text",L,F,F+1]),F+=1,L===`
`&&(y(),h="",b=0,t=!1);if(!Q.scan(k))break;if(f=!0,U=Q.scan(n_e)||"name",Q.scan(Jwe),U==="="?(K=Q.scanUntil(Dle),Q.scan(Dle),Q.scanUntil(E)):U==="{"?(K=Q.scanUntil(R),Q.scan(t_e),Q.scanUntil(E),U="&"):K=Q.scanUntil(E),!Q.scan(E))throw new Error("Unclosed tag at "+Q.pos);if(U==">"?te=[U,K,F,Q.pos,h,b,t]:te=[U,K,F,Q.pos],b++,a.push(te),U==="#"||U==="^")s.push(te);else if(U==="/"){if(ne=s.pop(),!ne)throw new Error('Unopened section "'+K+'" at '+F);if(ne[1]!==K)throw new Error('Unclosed section "'+ne[1]+'" at '+F)}else U==="name"||U==="{"||U==="&"?d=!0:U==="="&&$(K)}if(y(),ne=s.pop(),ne)throw new Error('Unclosed section "'+ne[1]+'" at '+Q.pos);return r_e(s_e(a))}function s_e(o){for(var e=[],t,s,a=0,l=o.length;a<l;++a)t=o[a],t&&(t[0]==="text"&&s&&s[0]==="text"?(s[1]+=t[1],s[3]=t[3]):(e.push(t),s=t));return e}function r_e(o){for(var e=[],t=e,s=[],a,l,f=0,d=o.length;f<d;++f)switch(a=o[f],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":l=s.pop(),l[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function j6(o){this.string=o,this.tail=o,this.pos=0}j6.prototype.eos=function(){return this.tail===""};j6.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var s=t[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s};j6.prototype.scanUntil=function(e){var t=this.tail.search(e),s;switch(t){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=s.length,s};function AD(o,e){this.view=o,this.cache={".":this.view},this.parent=e}AD.prototype.push=function(e){return new AD(e,this)};AD.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,l,f,d,h=!1;a;){if(e.indexOf(".")>0)for(l=a.view,f=e.split("."),d=0;l!=null&&d<f.length;)d===f.length-1&&(h=Ale(l,f[d])||Uwe(l,f[d])),l=l[f[d++]];else l=a.view[e],h=Ale(a.view,e);if(h){s=l;break}a=a.parent}t[e]=s}return tre(s)&&(s=s.call(this.view)),s};function Fg(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Fg.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Fg.prototype.parse=function(e,t){var s=this.templateCache,a=e+":"+(t||Qp.tags).join(":"),l=typeof s<"u",f=l?s.get(a):void 0;return f==null&&(f=o_e(e,t),l&&s.set(a,f)),f};Fg.prototype.render=function(e,t,s,a){var l=this.getConfigTags(a),f=this.parse(e,l),d=t instanceof AD?t:new AD(t,void 0);return this.renderTokens(f,d,s,e,a)};Fg.prototype.renderTokens=function(e,t,s,a,l){for(var f="",d,h,b,y=0,k=e.length;y<k;++y)b=void 0,d=e[y],h=d[0],h==="#"?b=this.renderSection(d,t,s,a,l):h==="^"?b=this.renderInverted(d,t,s,a,l):h===">"?b=this.renderPartial(d,t,s,l):h==="&"?b=this.unescapedValue(d,t):h==="name"?b=this.escapedValue(d,t,l):h==="text"&&(b=this.rawValue(d)),b!==void 0&&(f+=b);return f};Fg.prototype.renderSection=function(e,t,s,a,l){var f=this,d="",h=t.lookup(e[1]);function b(E){return f.render(E,t,s,l)}if(!!h){if(YD(h))for(var y=0,k=h.length;y<k;++y)d+=this.renderTokens(e[4],t.push(h[y]),s,a,l);else if(typeof h=="object"||typeof h=="string"||typeof h=="number")d+=this.renderTokens(e[4],t.push(h),s,a,l);else if(tre(h)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");h=h.call(t.view,a.slice(e[3],e[5]),b),h!=null&&(d+=h)}else d+=this.renderTokens(e[4],t,s,a,l);return d}};Fg.prototype.renderInverted=function(e,t,s,a,l){var f=t.lookup(e[1]);if(!f||YD(f)&&f.length===0)return this.renderTokens(e[4],t,s,a,l)};Fg.prototype.indentPartial=function(e,t,s){for(var a=t.replace(/[^ \t]/g,""),l=e.split(`
`),f=0;f<l.length;f++)l[f].length&&(f>0||!s)&&(l[f]=a+l[f]);return l.join(`
`)};Fg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),f=tre(s)?s(e[1]):s[e[1]];if(f!=null){var d=e[6],h=e[5],b=e[4],y=f;h==0&&b&&(y=this.indentPartial(f,b,d));var k=this.parse(y,l);return this.renderTokens(k,t,s,y,a)}}};Fg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Fg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Qp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Qp.escape?String(l):a(l)};Fg.prototype.rawValue=function(e){return e[1]};Fg.prototype.getConfigTags=function(e){return YD(e)?e:e&&typeof e=="object"?e.tags:void 0};Fg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!YD(e))return e.escape};var Qp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(o){y6.templateCache=o},get templateCache(){return y6.templateCache}},y6=new Fg;Qp.clearCache=function(){return y6.clearCache()};Qp.parse=function(e,t){return y6.parse(e,t)};Qp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Wwe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return y6.render(e,t,s,a)};Qp.escape=Kwe;Qp.Scanner=j6;Qp.Context=AD;Qp.Writer=Fg;function KH(o){return KH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KH(o)}function hE(o){if(o===null||o===!0||o===!1)return NaN;var e=Number(o);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Sc(o,e){if(e.length<o)throw new TypeError(o+" argument"+(o>1?"s":"")+" required, but only "+e.length+" present")}function cc(o){Sc(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||KH(o)==="object"&&e==="[object Date]"?new Date(o.getTime()):typeof o=="number"||e==="[object Number]"?new Date(o):((typeof o=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function i_e(o,e){Sc(2,arguments);var t=cc(o).getTime(),s=hE(e);return new Date(t+s)}var a_e={};function q6(){return a_e}function Poe(o){var e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return e.setUTCFullYear(o.getFullYear()),o.getTime()-e.getTime()}function kH(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function l_e(o){return Sc(1,arguments),o instanceof Date||KH(o)==="object"&&Object.prototype.toString.call(o)==="[object Date]"}function c_e(o){if(Sc(1,arguments),!l_e(o)&&typeof o!="number")return!1;var e=cc(o);return!isNaN(Number(e))}function u_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function f_e(o,e){return Sc(2,arguments),cc(o).getTime()-cc(e).getTime()}var Ple={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},d_e="trunc";function h_e(o){return o?Ple[o]:Ple[d_e]}function m_e(o){Sc(1,arguments);var e=cc(o);return e.setHours(23,59,59,999),e}function g_e(o){Sc(1,arguments);var e=cc(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function p_e(o){Sc(1,arguments);var e=cc(o);return m_e(e).getTime()===g_e(e).getTime()}function b_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=kH(t,s),l=Math.abs(u_e(t,s)),f;if(l<1)f=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*l);var d=kH(t,s)===-a;p_e(cc(o))&&l===1&&kH(o,s)===1&&(d=!1),f=a*(l-Number(d))}return f===0?0:f}function v_e(o,e,t){Sc(2,arguments);var s=f_e(o,e)/1e3;return h_e(t==null?void 0:t.roundingMethod)(s)}function O_e(o,e){Sc(2,arguments);var t=hE(e);return i_e(o,-t)}var y_e=864e5;function w_e(o){Sc(1,arguments);var e=cc(o),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),a=t-s;return Math.floor(a/y_e)+1}function JH(o){Sc(1,arguments);var e=1,t=cc(o),s=t.getUTCDay(),a=(s<e?7:0)+s-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function xpe(o){Sc(1,arguments);var e=cc(o),t=e.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(t+1,0,4),s.setUTCHours(0,0,0,0);var a=JH(s),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var f=JH(l);return e.getTime()>=a.getTime()?t+1:e.getTime()>=f.getTime()?t:t-1}function __e(o){Sc(1,arguments);var e=xpe(o),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var s=JH(t);return s}var S_e=6048e5;function C_e(o){Sc(1,arguments);var e=cc(o),t=JH(e).getTime()-__e(e).getTime();return Line truncated
`)};Fg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),f=tre(s)?s(e[1]):s[e[1]];if(f!=null){var d=e[6],h=e[5],b=e[4],y=f;h==0&&b&&(y=this.indentPartial(f,b,d));var k=this.parse(y,l);return this.renderTokens(k,t,s,y,a)}}};Fg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Fg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Qp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Qp.escape?String(l):a(l)};Fg.prototype.rawValue=function(e){return e[1]};Fg.prototype.getConfigTags=function(e){return YD(e)?e:e&&typeof e=="object"?e.tags:void 0};Fg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!YD(e))return e.escape};var Qp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(o){y6.templateCache=o},get templateCache(){return y6.templateCache}},y6=new Fg;Qp.clearCache=function(){return y6.clearCache()};Qp.parse=function(e,t){return y6.parse(e,t)};Qp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Wwe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return y6.render(e,t,s,a)};Qp.escape=Kwe;Qp.Scanner=j6;Qp.Context=AD;Qp.Writer=Fg;function KH(o){return KH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KH(o)}function hE(o){if(o===null||o===!0||o===!1)return NaN;var e=Number(o);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Sc(o,e){if(e.length<o)throw new TypeError(o+" argument"+(o>1?"s":"")+" required, but only "+e.length+" present")}function cc(o){Sc(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||KH(o)==="object"&&e==="[object Date]"?new Date(o.getTime()):typeof o=="number"||e==="[object Number]"?new Date(o):((typeof o=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function i_e(o,e){Sc(2,arguments);var t=cc(o).getTime(),s=hE(e);return new Date(t+s)}var a_e={};function q6(){return a_e}function Poe(o){var e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return e.setUTCFullYear(o.getFullYear()),o.getTime()-e.getTime()}function kH(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function l_e(o){return Sc(1,arguments),o instanceof Date||KH(o)==="object"&&Object.prototype.toString.call(o)==="[object Date]"}function c_e(o){if(Sc(1,arguments),!l_e(o)&&typeof o!="number")return!1;var e=cc(o);return!isNaN(Number(e))}function u_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function f_e(o,e){return Sc(2,arguments),cc(o).getTime()-cc(e).getTime()}var Ple={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},d_e="trunc";function h_e(o){return o?Ple[o]:Ple[d_e]}function m_e(o){Sc(1,arguments);var e=cc(o);return e.setHours(23,59,59,999),e}function g_e(o){Sc(1,arguments);var e=cc(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function p_e(o){Sc(1,arguments);var e=cc(o);return m_e(e).getTime()===g_e(e).getTime()}function b_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=kH(t,s),l=Math.abs(u_e(t,s)),f;if(l<1)f=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*l);var d=kH(t,s)===-a;p_e(cc(o))&&l===1&&kH(o,s)===1&&(d=!1),f=a*(l-Number(d))}return f===0?0:f}function v_e(o,e,t){Sc(2,arguments);var s=f_e(o,e)/1e3;return h_e(t==null?void 0:t.roundingMethod)(s)}function O_e(o,e){Sc(2,arguments);var t=hE(e);return i_e(o,-t)}var y_e=864e5;function w_e(o){Sc(1,arguments);var e=cc(o),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),a=t-s;return Math.floor(a/y_e)+1}function JH(o){Sc(1,arguments);var e=1,t=cc(o),s=t.getUTCDay(),a=(s<e?7:0)+s-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function xpe(o){Sc(1,arguments);var e=cc(o),t=e.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(t+1,0,4),s.setUTCHours(0,0,0,0);var a=JH(s),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var f=JH(l);return e.getTime()>=a.getTime()?t+1:e.getTime()>=f.getTime()?t:t-1}function __e(o){Sc(1,arguments);var e=xpe(o),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var s=JH(t);return s}var S_e=6048e5;function C_e(o){Sc(1,arguments);var e=cc(o),t=JH(e).getTime()-__e(e).getTime();return Line truncated
Save`),z(t,"class","spinner-border spinner-border-sm"),z(t,"role","status"),z(t,"aria-hidden","true"),e.disabled=a=!o[6],z(e,"class","ms-2 btn btn-primary btn-spinner")},m(d,h){Me(d,e,h),j(e,t),j(e,s),l||(f=vn(e,"click",o[11]),l=!0)},p(d,h){h&64&&a!==(a=!d[6])&&(e.disabled=a)},d(d){d&&Pe(e),l=!1,f()}}}function kCe(o){let e,t,s;return{c(){e=ie("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Add`,z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Me(a,e,l),t||(s=vn(e,"click",o[11]),t=!0)},p:pn,d(a){a&&Pe(e),t=!1,s()}}}function xCe(o){let e,t,s,a,l,f,d,h,b,y=[],k=new Map,E,R,$,Q,F,U,K,L,te;t=new X6({props:{message:o[7]}});function ne(ot){o[12](ot)}let oe={schema:o[2],isCreateMode:o[3],record:o[0]};o[5]!==void 0&&(oe.active=o[5]),l=new Lpe({props:oe}),Vo.push(()=>cr(l,"active",ne)),h=new Bpe({props:{record:o[0],schema:o[2]}});let Y=o[8];const ye=ot=>ot[23].name;for(let ot=0;ot<Y.length;ot+=1){let et=yce(o,Y,ot),yt=ye(et);k.set(yt,y[ot]=_ce(yt,et))}let _e=o[2].hasDrafts&&Sce(o);function Be(ot,et){return ot[3]?kCe:CCe}let ve=Be(o),ue=ve(o);return{c(){e=ie("div"),tn(t.$$.fragment),s=Ze(),a=ie("div"),tn(l.$$.fragment),d=Ze(),tn(h.$$.fragment),b=Ze();for(let ot=0;ot<y.length;ot+=1)y[ot].c();E=Ze(),R=ie("div"),$=ie("div"),_e&&_e.c(),Q=Ze(),ue.c(),F=Ze(),U=ie("button"),U.textContent="cancel",z(a,"class","mt-1"),z(U,"class","ms-2 btn btn-link"),z($,"class","d-flex mt-3 align-items-center justify-content-center"),z(e,"class","inline-edit my-4 svelte-sl11hx")},m(ot,et){Me(ot,e,et),Kt(t,e,null),j(e,s),j(e,a),Kt(l,a,null),j(a,d),Kt(h,a,null),j(a,b);for(let yt=0;yt<y.length;yt+=1)y[yt]&&y[yt].m(a,null);j(e,E),j(e,R),j(R,$),_e&&_e.m($,null),j($,Q),ue.m($,null),j($,F),j($,U),K=!0,L||(te=[vn(window,"beforeunload",o[9]),vn(U,"click",o[10])],L=!0)},p(ot,[et]){const yt={};et&128&&(yt.message=ot[7]),t.$set(yt);const V={};et&4&&(V.schema=ot[2]),et&8&&(V.isCreateMode=ot[3]),et&1&&(V.record=ot[0]),!f&&et&32&&(f=!0,V.active=ot[5],mr(()=>f=!1)),l.$set(V);const ut={};et&1&&(ut.record=ot[0]),et&4&&(ut.schema=ot[2]),h.$set(ut),et&319&&(Y=ot[8],wo(),y=Xh(y,et,ye,1,ot,Y,k,a,xv,_ce,null,yce),_o()),ot[2].hasDrafts?_e?(_e.p(ot,et),et&4&&xe(_e,1)):(_e=Sce(ot),_e.c(),xe(_e,1),_e.m($,Q)):_e&&(wo(),Qe(_e,1,1,()=>{_e=null}),_o()),ve===(ve=Be(ot))&&ue?ue.p(ot,et):(ue.d(1),ue=ve(ot),ue&&(ue.c(),ue.m($,F)))},i(ot){if(!K){xe(t.$$.fragment,ot),xe(l.$$.fragment,ot),xe(h.$$.fragment,ot);for(let et=0;et<Y.length;et+=1)xe(y[et]);xe(_e),K=!0}},o(ot){Qe(t.$$.fragment,ot),Qe(l.$$.fragment,ot),Qe(h.$$.fragment,ot);for(let et=0;et<y.length;et+=1)Qe(y[et]);Qe(_e),K=!1},d(ot){ot&&Pe(e),Jt(t),Jt(l),Jt(h);for(let et=0;et<y.length;et+=1)y[et].d();_e&&_e.d(),ue.d(),L=!1,$i(te)}}}function TCe(o,e,t){let s,a;const l=si("channel"),f=Hp();let{schema:d}=e,{record:h}=e,{graph:b={records:[],edges:[]}}=e,{isCreateMode:y}=e,k,E="",R=!1,$=d.fields.filter(_e=>_e.name!=="id"),Q="_default";d.fields.reduce((_e,Be)=>{var ve;return Be.ui==="tab"?(Q=Be.name,_e):(_e[Q]=[...(ve=_e[Q])!=null?ve:[],Be.name],_e)},[]),W1(()=>{F()});function F(){k={data:JSON.parse(JSON.stringify(h.data)),schema:h.schema,status:h.status,_sys:JSON.parse(JSON.stringify(h._sys)),_file:JSON.parse(JSON.stringify(h._file)),edges:JSON.parse(JSON.stringify(b.edges))}}wpe(()=>{t(6,R=K())});function U(_e){return R?_e.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete _e.returnValue,"...")}function K(){return y?!1:!Lc.exports.isEqual(k,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function L(_e){_e.preventDefault(),f("cancel")}function te(_e){return _e.preventDefault(),console.log("SAVE: Attempt"),t(4,s=null),t(7,a=""),new Promise(function(Be,ve){var ue,ot;if(!R&&!y){Be(null);return}if(!h){Be(null);return}t(1,b.edges=(ot=(ue=b.edges)==null?void 0:ue.filter(et=>!et._isTrashed&&et.source===h.id))!=null?ot:[],b),axios.post(l.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:y}).then(function(et){console.log("SAVE: SAVED INLINE"),t(0,h=et.data.records[0]),t(1,b=et.data),y||F(),f("inlinesaved",{records:[h]}),Be(null)}).catch(function(et){et.response&&(typeof et.response.data.error=="string"?t(7,a=et.response.data.error):t(4,s=et.response.data.error)),Be(null)})})}function ne(_e){E=_e,t(5,E)}function oe(_e){o.$$.not_equal(h.data,_e)&&(h.data=_e,t(0,h))}function Y(_e){b=_e,t(1,b)}function ye(_e){o.$$.not_equal(h.status,_e)&&(h.status=_e,t(0,h))}return o.$$set=_e=>{"schema"in _e&&t(2,d=_e.schema),"record"in _e&&t(0,h=_e.record),"graph"in _e&&t(1,b=_e.graph),"isCreateMode"in _e&&t(3,y=_e.isCreateMode)},o.$$.update=()=>{o.$$.dirty&16&&t(7,a=s?`Record submission failed. ${Object.entries(s).length} error(s)`:null)},t(4,s=null),[h,b,d,y,s,E,R,a,$,U,L,te,ne,oe,Y,ye]}class Zpe extends vo{constructor(e){super(),bo(this,e,TCe,xCe,po,{schema:2,record:0,graph:1,isCreateMode:3})}}function Cce(o,e,t){const s=o.slice();return s[19]=e[t],s}function kce(o,e,t){const s=o.slice();return s[22]=e[t],s}function xce(o){let e,t=o[22].label+"",s;return{c(){e=ie("option"),s=Xt(t),e.__value=o[22],e.value=e.__value},m(a,l){Me(a,e,l),j(e,s)},p:pn,d(a){a&&Pe(e)}}}function Tce(o){let e,t=o[19].label+"",s,a;return{c(){e=ie("option"),s=Xt(t),e.__value=a=o[19],e.value=e.__value},m(l,f){Me(l,e,f),j(e,s)},p(l,f){f&2&&t!==(t=l[19].label+"")&&Wn(s,t),f&2&&a!==(a=l[19])&&(e.__value=a,e.value=e.__value)},d(l){l&&Pe(e)}}}function ECe(o){let e,t,s,a,l, Line truncated
`),a=ie("span"),a.innerHTML='<span class="visually-hidden">Loading...</span>',l=Ze(),f=ie("input"),z(a,"class","spinner-border spinner-border-sm"),z(a,"role","status"),z(a,"aria-hidden","true"),z(f,"class","form-control"),z(f,"type","file"),z(f,"id","formFile"),f.multiple=!0,z(f,"accept",MCe),f.disabled=o[0],f.hidden=!0,z(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=o[0]},m(b,y){Me(b,e,y),j(e,t),j(t,s),j(t,a),j(t,l),j(t,f),d||(h=vn(f,"input",o[1]),d=!0)},p(b,[y]){y&1&&(f.disabled=b[0]),y&1&&(e.disabled=b[0])},i:pn,o:pn,d(b){b&&Pe(e),d=!1,h()}}}let MCe="";function RCe(o,e,t){const s=Hp(),a=si("channel");let{schema:l}=e,f=[],d=!1;function h(b){t(0,d=!0),f=b.target.files?[...b.target.files]:[];let y=new FormData;y.append("schema",l.name),Array.from(f).forEach(function(k){y.append("files[]",k)}),s("beforeUpload",f),axios.post(a.lucentUrl+"/files/upload",y,{headers:{"Content-Type":"multipart/form-data"}}).then(k=>{k.data.error?s("uploadError",k.data.error):s("uploadComplete",k.data),t(0,d=!1)}).catch(k=>{t(0,d=!1),console.log(k.response.data)})}return o.$$set=b=>{"schema"in b&&t(2,l=b.schema)},[d,h,l]}class $Ce extends vo{constructor(e){super(),bo(this,e,RCe,PCe,po,{schema:2})}}function Ece(o,e,t){const s=o.slice();return s[18]=e[t],s}function Ace(o,e,t){const s=o.slice();return s[18]=e[t],s}function NCe(o){let e,t;return e=new ml({props:{icon:"arrow-up-short-wide"}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function ICe(o){let e,t;return e=new ml({props:{icon:"arrow-down-wide-short"}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Dce(o){let e,t,s,a,l,f,d,h,b,y,k,E=o[18].label+"",R,$,Q,F,U;a=new ml({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[10](o[18],...ne)}h=new ml({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[11](o[18],...ne)}function te(...ne){return o[12](o[18],...ne)}return{c(){e=ie("div"),t=ie("div"),s=ie("button"),tn(a.$$.fragment),f=Ze(),d=ie("button"),tn(h.$$.fragment),y=Ze(),k=ie("button"),R=Xt(E),$=Ze(),z(s,"title","Sort Ascending"),z(s,"class",l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),z(d,"title","Sort Descending"),z(d,"class",b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),z(k,"title","Sort Ascending"),z(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),ss(k,"overflow","hidden"),z(t,"class","btn-group w-100"),z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Me(ne,e,oe),j(e,t),j(t,s),Kt(a,s,null),j(t,f),j(t,d),Kt(h,d,null),j(t,y),j(t,k),j(k,R),j(e,$),Q=!0,F||(U=[vn(s,"click",K),vn(d,"click",L),vn(k,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&11&&l!==(l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&z(s,"class",l),(!Q||oe&11&&b!==(b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&z(d,"class",b),(!Q||oe&8)&&E!==(E=o[18].label+"")&&Wn(R,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Qe(a.$$.fragment,ne),Qe(h.$$.fragment,ne),Q=!1},d(ne){ne&&Pe(e),Jt(a),Jt(h),F=!1,$i(U)}}}function Pce(o){let e,t,s,a,l,f,d,h,b,y,k,E=o[18].label+"",R,$,Q,F,U;a=new ml({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[13](o[18],...ne)}h=new ml({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[14](o[18],...ne)}function te(...ne){return o[15](o[18],...ne)}return{c(){e=ie("div"),t=ie("div"),s=ie("button"),tn(a.$$.fragment),f=Ze(),d=ie("button"),tn(h.$$.fragment),y=Ze(),k=ie("button"),R=Xt(E),$=Ze(),z(s,"title","Sort Ascending"),z(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),z(d,"title","Sort Descending"),z(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),z(k,"title","Sort Ascending"),z(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),ss(k,"overflow","hidden"),z(t,"class","btn-group w-100"),z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Me(ne,e,oe),j(e,t),j(t,s),Kt(a,s,null),j(t,f),j(t,d),Kt(h,d,null),j(t,y),j(t,k),j(k,R),j(e,$),Q=!0,F||(U=[vn(s,"click",K),vn(d,"click",L),vn(k,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&5&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&z(s,"class",l),(!Q||oe&5&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&z(d,"class",b),(!Q||oe&4)&&E!==(E=o[18].label+"")&&Wn(R,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Qe(a.$$.fragment,ne),Qe(h.$$.fragment,ne),Q=!1},d(ne){ne&&Pe(e),Jt(a),Jt(h),F=!1,$i(U)}}}function BCe(o){let e,t,s,a,l,f,d,h=o[1].label+"",b,y,k,E,R,$,Q,F,U;const K=[ICe,NCe],L=[];function te(ve,ue){return ue&1&&(s=null),s==null&&(s=!!ve[0].startsWith("-")),s?0:1}a=te( Line truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"main.js": {
"file": "assets/main.016edc6c.js",
"file": "assets/main.96863591.js",
"src": "main.js",
"isEntry": true,
"css": [
@@ -21,7 +21,6 @@
.map((edge) => {
return graph.records.find((increc) => increc.id === edge.target && record.id === edge.source);
}).filter((rec) => (rec?.id ? true : false)) ?? [];
let collections = channel.schemas.filter((aschema) =>
field.collections.includes(aschema.name)
);
@@ -44,7 +43,7 @@
function insert(e) {
e.preventDefault();
graph = insertEdges(graph,record,e.detail.records,field.name,e.detail.action);
graph = insertEdges(graph, record, e.detail.records, field.name, e.detail.action);
}
$:visibleColumns = [];
@@ -62,11 +61,11 @@
{/if}
<div class="inline-card-wrapper">
<ReferenceInlineButtons
buttonClass="mt-2"
recordId={null}
schemas={collections}
on:insert={insert}
on:save={insert}
buttonClass="mt-2"
recordId={null}
schemas={collections}
on:insert={insert}
on:save={insert}
/>
</div>
{#if references.length > 0}
@@ -78,11 +77,11 @@
{#each visibleColumns as field}
<th
class="field-ui-{field.ui}"
scope="col"
title={field.help}
data-bs-toggle="tooltip"
data-bs-placement="top">{field.label}</th
class="field-ui-{field.ui}"
scope="col"
title={field.help}
data-bs-toggle="tooltip"
data-bs-placement="top">{field.label}</th
>
{/each}
<th/>
@@ -95,9 +94,9 @@
<div class="">
<div class="d-flex align-items-center">
<a
class="me-2 text-decoration-none text-dark fs-6"
href="{channel.lucentUrl}/records/{record.id}"
target="_blank"
class="me-2 text-decoration-none text-dark fs-6"
href="{channel.lucentUrl}/records/{record.id}"
target="_blank"
>
{previewTitle(channel.schemas, record)}
</a>
@@ -107,17 +106,17 @@
{#each visibleColumns as field, index}
<td class="field-ui-{field.ui}">
<RenderField
{record}
{graph}
schema={collection}
{field}
{record}
{graph}
schema={collection}
{field}
/>
</td>
{/each}
<td>
<button
class="trash-button text-dark btn btn-sm btn-link"
on:click={(e) =>
class="trash-button text-dark btn btn-sm btn-link"
on:click={(e) =>
removeReference(e, record.id)}
>
<Icon icon="trash-can"/>
@@ -8,6 +8,7 @@ export function insertEdges(graph, sourceRecord, targetRecords, fieldName, actio
sourceSchema: sourceRecord.schema,
targetSchema: r.schema,
field: fieldName,
depth: 1,
rank: ""
};
});
@@ -18,6 +19,6 @@ export function insertEdges(graph, sourceRecord, targetRecords, fieldName, actio
}
graph.records = uniqBy([...graph.records, ...targetRecords], (r) => r.id);
graph.edges = uniqBy([...replacedEdges, ...newEdges], (edge) => edge.source + edge.target + edge.field);
graph.edges = uniqBy([...replacedEdges, ...newEdges], (edge) => edge.source + edge.target + edge.field + edge.depth);
return graph;
}