Loading
function(e,r,a){a.d(r,{Mf:()=>p,R9:()=>o,Y_:()=>f,h4:()=>c,ui:()=>m});var n=a(102607),t=a(754474),l=a(374380);let i="responsive",o={foreground:t.u.FRONT,background:t.u.BACK},s=new Set([l.O.STAPLE,l.O.RAIL,l.O.BORDER]),u=new Set([n.T.TOP,n.T.BOTTOM,n.T.CENTER]),c={wrong_part_count:"wrong filename format",invalid_index:"invalid index",invalid_type:`invalid type (expected: ${[...s].join(", ")})`,invalid_anchor:`invalid anchor (expected: ${[...u].join(", ")})`,invalid_responsive:`invalid suffix (expected '${i}')`,border_has_anchor:"border layers must omit the anchor"};function p(e){var r;let a=e.replace(/\.\w+$/,"").split("_");if(a.length<2||a.length>4)return{parsed:null,errorType:"wrong_part_count"};let[t,o,...c]=a;if(!/^\d+$/.test(t))return{parsed:null,errorType:"invalid_index"};if(!s.has(o))return{parsed:null,errorType:"invalid_type"};if(o===l.O.BORDER){if(c.length>0&&(r=c[0],u.has(r)))return{parsed:null,errorType:"border_has_anchor"};if(c.length>1)return{parsed:null,errorType:"wrong_part_count"};if(1===c.length&&c[0]!==i)return{parsed:null,errorType:"invalid_responsive"};let e=1===c.length;return{parsed:{index:Number(t),type:o,anchor:n.T.CENTER,responsive:e},errorType:null}}let p=c[0];if(null==p||!u.has(p))return{parsed:null,errorType:"invalid_anchor"};if(c.length>2)return{parsed:null,errorType:"wrong_part_count"};if(2===c.length&&c[1]!==i)return{parsed:null,errorType:"invalid_responsive"};let d=2===c.length||o===l.O.RAIL;return{parsed:{index:Number(t),type:o,anchor:p,responsive:d},errorType:null}}let d={[t.u.FRONT]:0,[t.u.BACK]:1};function m(e,r){let a=d[e.order]-d[r.order];return 0!==a?a:e.index-r.index}function f(e){return"preview"===e.replace(/\.\w+$/,"")}}